diff --git a/modules/boost/boost.cmake b/modules/boost/boost.cmake index f48b31c..966a768 100644 --- a/modules/boost/boost.cmake +++ b/modules/boost/boost.cmake @@ -74,6 +74,9 @@ if(FORCE_CUSTOM_BOOST) set(BOOST_INCLUDEDIR "") set(BOOST_LIBRARYDIR "") else() + # Read from cache, needed for rebuilds + set(BOOST_INCLUDEDIR ${Boost_INCLUDE_DIR}) + set(BOOST_LIBRARYDIR ${Boost_LIBRARY_DIR}) find_package(Boost ${BOOST_MINIMUM_REQUIRED} COMPONENTS "${BOOST_COMPONENTS_REQUIRED}") if(NOT Boost_FOUND) set(BUILD_CUSTOM_BOOST TRUE) @@ -104,7 +107,7 @@ if(BUILD_CUSTOM_BOOST) include(${CMAKE_CURRENT_LIST_DIR}/boost_unpack.cmake) include(${CMAKE_CURRENT_LIST_DIR}/boost_userconfig.cmake) - if(NOT BOOST_COMPONENTS_REQUIRED STREQUAL "") + if(NOT "${BOOST_COMPONENTS_REQUIRED}" STREQUAL "") # Non-empty list. Compiled libraries needed # Transform the ;-separated list to a ,-separated list (digested by the Boost build toolchain!) string(REPLACE ";" "," b2_needed_components "${BOOST_COMPONENTS_REQUIRED}") diff --git a/modules/boost/boost_headers.cmake b/modules/boost/boost_headers.cmake index 5004741..9e33d8c 100644 --- a/modules/boost/boost_headers.cmake +++ b/modules/boost/boost_headers.cmake @@ -1,7 +1,7 @@ # Install Boost add_custom_command( OUTPUT ${CUSTOM_BOOST_LOCATION}/boost.installed - COMMAND ${CMAKE_COMMAND} -E copy_directory ${BOOST_BUILD_DIR}/boost ${CUSTOM_BOOST_LOCATION}/include + COMMAND ${CMAKE_COMMAND} -E copy_directory ${BOOST_BUILD_DIR}/boost ${CUSTOM_BOOST_LOCATION}/include/boost COMMAND ${CMAKE_COMMAND} -E touch ${CUSTOM_BOOST_LOCATION}/boost.installed WORKING_DIRECTORY ${BOOST_BUILD_DIR} DEPENDS ${CUSTOM_BOOST_LOCATION}/boost.user-config