Revision: 77481
          http://sourceforge.net/p/brlcad/code/77481
Author:   starseeker
Date:     2020-10-18 14:08:58 +0000 (Sun, 18 Oct 2020)
Log Message:
-----------
It will be better if we can define this once at a toplevel and use it 
throughout...

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-10-18 08:09:08 UTC (rev 77480)
+++ brlcad/branches/thirdparty_rework/src/superbuild/CMakeLists.txt     
2020-10-18 14:08:58 UTC (rev 77481)
@@ -55,11 +55,27 @@
 # and mess up the results...
 set(CMAKE_SYSTEM_IGNORE_PATH "${CMAKE_INSTALL_PREFIX}")
 
-
 # We will build up a list of all include dirs coming from 3rd party
 # projects, so we can include them with -isystem
 unset(SYS_INCLUDE_PATTERNS CACHE)
 
+# For the individual builds to be done here, we need to target their installs
+# to locations in the CMAKE_BINARY_DIR, which is the only place we can be
+# assured of having write access.  However, for multiconfig build systems, we
+# need to define per-config output targets so each individual config's build
+# won't stomp on the output from other configs.  We also *don't* want to do
+# that for single config builds, where user expectation is that
+# CMAKE_BINARY_DIR is the root for such paths.  The $<CONFIG> generator
+# expression lets us set up per-config paths, but as $<CONFIG> is ALSO defined
+# for non-multiconfig builds when CMAKE_BUILD_TYPE is set we need to define
+# $<CONFIG> based paths ONLY when we have CMAKE_CONFIGURATION_TYPES set
+# (which indicates a multiconfig generator is in use.)
+if (CMAKE_CONFIGURATION_TYPES)
+  set(CMAKE_BINARY_ROOT "${CMAKE_BINARY_DIR}/$<CONFIG>")
+else (CMAKE_CONFIGURATION_TYPES)
+  set(CMAKE_BINARY_ROOT "${CMAKE_BINARY_DIR}")
+endif (CMAKE_CONFIGURATION_TYPES)
+
 #---------------------------------------------------------------------
 # Define relative install locations and output directories.  Don't set
 # these if they have already been set by some other means (like a

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