Revision: 77293
          http://sourceforge.net/p/brlcad/code/77293
Author:   starseeker
Date:     2020-09-30 21:43:42 +0000 (Wed, 30 Sep 2020)
Log Message:
-----------
Add a 'brlcad' custom target with ALL set, that depends on the deps target and 
triggers the BRL-CAD subbuild.  This has the effect of making BRL-CAD building 
a 'top-level' action for the superbuild project.  I.e., editing a source file 
in (say) libbu and then typing 'make' will rebuild the relevant portions of 
BRL-CAD, whereas with just the BRLCAD_BLD external project it would view the 
external project as 'complete' and not rebuild it.  The build will still not 
trigger on changes to the src/other files, which is a departure from the 
integrated src/other build but is apparently typical of ExternalProject_Add 
setups.  In particular, with non-CMake build systems possibly in use in 
external projects, the behavior we would see may be less than ideal in a 
rebuild scenario - it may be preferable to require a manual build+install step 
on the relatively rare occasions we need to change src/other files.

Modified Paths:
--------------
    brlcad/branches/thirdparty_rework/src/superbuild/CMakeLists.txt

Modified: brlcad/branches/thirdparty_rework/src/superbuild/CMakeLists.txt
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/CMakeLists.txt     
2020-09-30 21:04:56 UTC (rev 77292)
+++ brlcad/branches/thirdparty_rework/src/superbuild/CMakeLists.txt     
2020-09-30 21:43:42 UTC (rev 77293)
@@ -221,6 +221,7 @@
 endif(BRLCAD_DEPS)
 
 # We've built everything we needed to build - now we can build BRL-CAD itself
+
 ExternalProject_Add(BRLCAD_BLD
   SOURCE_DIR "${BRLCAD_SOURCE_DIR}"
   PREFIX ${BRLCAD_BINARY_DIR}/brlcad
@@ -249,6 +250,24 @@
   DEPENDS ${BRLCAD_DEPS}
   )
 
+if("${CMAKE_GENERATOR}" MATCHES "Make")
+  add_custom_target(brlcad ALL
+    COMMAND cd ${BRLCAD_BINARY_DIR}/brlcad-build && $(MAKE) && $(MAKE) install
+    DEPENDS deps
+    )
+elseif("${CMAKE_GENERATOR}" MATCHES "Ninja")
+  add_custom_target(brlcad ALL
+    COMMAND cd ${BRLCAD_BINARY_DIR}/brlcad-build && ninja && ninja install
+    DEPENDS deps
+    )
+else()
+  add_custom_target(brlcad ALL
+    COMMAND ${CMAKE_COMMAND} --build ${BRLCAD_BINARY_DIR}/brlcad-build
+    COMMAND ${CMAKE_COMMAND} --build ${BRLCAD_BINARY_DIR}/brlcad-build 
--target install
+    DEPENDS deps
+    )
+endif()
+
 # Local Variables:
 # tab-width: 8
 # mode: cmake

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to