From 6dd61417bbb98d8754a131197150a7afd3ad8a82 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Mon, 9 Nov 2015 21:53:26 -0500 Subject: [PATCH] Modify CMake commands in Boost build-up scripts to use platform-independent form --- modules/boost/boost.cmake | 3 ++- modules/boost/boost_build.cmake | 1 + modules/boost/boost_configure.cmake | 1 + modules/boost/boost_install.cmake | 1 + modules/boost/boost_unpack.cmake | 2 +- modules/boost/boost_userconfig.cmake | 2 +- 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/boost/boost.cmake b/modules/boost/boost.cmake index 8a83c58..88cbfe7 100644 --- a/modules/boost/boost.cmake +++ b/modules/boost/boost.cmake @@ -3,6 +3,7 @@ # Detect, build, and link Boost libraries. # This modules downloads the .zip archive from SourceForge at # Autocmake update time. +# Note that the build-up commands are not Windows-compatible! # # Your autocmake.cfg should look like this:: # @@ -164,7 +165,7 @@ if(BUILD_CUSTOM_BOOST) set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR}) - if(CMAKE_SYSTEM_NAME MATCHES "Linux") + if(CMAKE_SYSTEM_NAME MATCHES Linux) list(APPEND Boost_LIBRARIES rt) endif() endif() diff --git a/modules/boost/boost_build.cmake b/modules/boost/boost_build.cmake index 885488a..8fcea49 100644 --- a/modules/boost/boost_build.cmake +++ b/modules/boost/boost_build.cmake @@ -1,4 +1,5 @@ # Build Boost +# This is not Windows-friendly! add_custom_command( OUTPUT ${CUSTOM_BOOST_LOCATION}/boost.built COMMAND ./b2 toolset=${toolset} variant=${type} link=static cxxflags=-fPIC diff --git a/modules/boost/boost_configure.cmake b/modules/boost/boost_configure.cmake index aa5c3dd..36c65ee 100644 --- a/modules/boost/boost_configure.cmake +++ b/modules/boost/boost_configure.cmake @@ -1,4 +1,5 @@ # Run bootstrap.sh to configure the build. We will install in ${PROJECT_BINARY_DIR}/boost +# This is not Windows-friendly! add_custom_command( OUTPUT ${CUSTOM_BOOST_LOCATION}/boost.configured COMMAND ./bootstrap.sh --with-toolset=${toolset} diff --git a/modules/boost/boost_install.cmake b/modules/boost/boost_install.cmake index 2d79831..21354b1 100644 --- a/modules/boost/boost_install.cmake +++ b/modules/boost/boost_install.cmake @@ -1,4 +1,5 @@ # Install Boost +# This is not Windows-friendly! add_custom_command( OUTPUT ${CUSTOM_BOOST_LOCATION}/boost.installed COMMAND ./b2 install toolset=${toolset} variant=${type} link=static diff --git a/modules/boost/boost_unpack.cmake b/modules/boost/boost_unpack.cmake index 64b311a..93dc0c7 100644 --- a/modules/boost/boost_unpack.cmake +++ b/modules/boost/boost_unpack.cmake @@ -2,7 +2,7 @@ add_custom_command( OUTPUT ${CUSTOM_BOOST_LOCATION}/boost.unpacked COMMAND ${CMAKE_COMMAND} -E tar xzf ${BOOST_ARCHIVE_LOCATION}/${BOOST_ARCHIVE} - COMMAND touch boost.unpacked + COMMAND ${CMAKE_COMMAND} -E touch boost.unpacked DEPENDS ${BOOST_ARCHIVE_LOCATION}/${BOOST_ARCHIVE} WORKING_DIRECTORY ${CUSTOM_BOOST_LOCATION} COMMENT "Unpacking Boost") diff --git a/modules/boost/boost_userconfig.cmake b/modules/boost/boost_userconfig.cmake index 68e5293..73236ee 100644 --- a/modules/boost/boost_userconfig.cmake +++ b/modules/boost/boost_userconfig.cmake @@ -9,7 +9,7 @@ file(WRITE ${CUSTOM_BOOST_LOCATION}/user-config.jam ${MPI_SENT}) add_custom_command( OUTPUT ${CUSTOM_BOOST_LOCATION}/boost.user-config COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CUSTOM_BOOST_LOCATION}/user-config.jam ${BOOST_BUILD_DIR}/user-config.jam - COMMAND touch boost.user-config + COMMAND ${CMAKE_COMMAND} -E touch boost.user-config DEPENDS ${CUSTOM_BOOST_LOCATION}/boost.unpacked WORKING_DIRECTORY ${CUSTOM_BOOST_LOCATION} COMMENT "Generating user-config.jam")