Revision: 77615
http://sourceforge.net/p/brlcad/code/77615
Author: starseeker
Date: 2020-10-23 17:44:40 +0000 (Fri, 23 Oct 2020)
Log Message:
-----------
Generator expressions in install(CODE) is supported starting in CMake 3.14, but
some of the stable Linux distros aren't shipping a version that new yet. For
the one case we're using it, force the executable we need to run to build in a
predictable location and then just execute it directly from there.
Deliberately leaving the generator expression form of this commented out,
because we should swap it back in as soon as we can require 3.14.
Modified Paths:
--------------
brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
brlcad/branches/extbuild/src/other/ext/CMakeLists.txt
Modified:
brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
===================================================================
--- brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
2020-10-23 15:49:02 UTC (rev 77614)
+++ brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
2020-10-23 17:44:40 UTC (rev 77615)
@@ -83,7 +83,16 @@
if (E_FIXPATH)
# Note - proper quoting for install(CODE) is extremely important for
CPack, see
# https://stackoverflow.com/a/48487133
- install(CODE "execute_process(COMMAND $<TARGET_FILE:buildpath_replace>
\"\${CMAKE_INSTALL_PREFIX}/${dir}/${bpf}\")")
+ #install(CODE "execute_process(COMMAND $<TARGET_FILE:buildpath_replace>
\"\${CMAKE_INSTALL_PREFIX}/${dir}/${bpf}\")")
+
+ # The proper way to do this is the line above with generator
+ # expressions, but support for using them in INSTALL(CODE) wasn't added
+ # until CMake 3.14. The workaround is to manually specify he output
+ # path and force the buildpath_replace target to output in a specific
+ # location via its RUNTIME_OUTPUT_DIRECTORY properties.
+ get_filename_component(EXE_EXT "${CMAKE_COMMAND}" EXT)
+ install(CODE "execute_process(COMMAND
${CMAKE_BINARY_DIR}/CMakeTmp/buildpath_replace${EXE_EXT}
\"\${CMAKE_INSTALL_PREFIX}/${dir}/${bpf}\")")
+
endif (E_FIXPATH)
endif (NOT E_NOINSTALL)
Modified: brlcad/branches/extbuild/src/other/ext/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/CMakeLists.txt 2020-10-23
15:49:02 UTC (rev 77614)
+++ brlcad/branches/extbuild/src/other/ext/CMakeLists.txt 2020-10-23
17:44:40 UTC (rev 77615)
@@ -150,6 +150,16 @@
# CMAKE_INSTALL_PREFIX are finalized before generating this file!
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/buildpath_replace.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/buildpath_replace.cxx)
add_executable(buildpath_replace
${CMAKE_CURRENT_BINARY_DIR}/buildpath_replace.cxx)
+# TODO - remove once we require CMake >=3.14
+# Until we can require CMake 3.14 for generator expressions in install(CODE),
force
+# the location of buildpath_replace to a known location in all cases
+set_property(TARGET buildpath_replace PROPERTY RUNTIME_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/CMakeTmp)
+if(CMAKE_CONFIGURATION_TYPES)
+ foreach(ct ${CMAKE_CONFIGURATION_TYPES})
+ string(TOUPPER "${ct}" CTU)
+ set_property(TARGET buildpath_replace PROPERTY
RUNTIME_OUTPUT_DIRECTORY_${CTU} ${CMAKE_BINARY_DIR}/CMakeTmp)
+ endforeach(ct ${CMAKE_CONFIGURATION_TYPES})
+endif(CMAKE_CONFIGURATION_TYPES)
# BRL-CAD defines some additional custom targets used to manage the outputs of
# ExternalProject_Add targets.
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