Commit ee4a2a9e authored by Nicolas Cadart's avatar Nicolas Cadart
Browse files

Check for Boost environment variables hiding superbuild Boost install

If some Boost environment variables are defined, they could hide the
superbuild Boost install.
This can lead to superbuild failure if the system boost does not have
all required components.
It may also lead to runtime errors if all binaries were not built using
the same boost libs (system VS superbuild ones).
This commit add a check to verify the definition of these environment
variables if user does not want to use his system boost install.
parent 8e2a3656
...@@ -203,6 +203,13 @@ set(boost_libraries ...@@ -203,6 +203,13 @@ set(boost_libraries
set(boost_extra_options set(boost_extra_options
"-sNO_BZIP2=1") "-sNO_BZIP2=1")
# Check if some Boost environment variables could hide local Boost install
if (NOT ${USE_SYSTEM_boost} AND (DEFINED ENV{BOOSTROOT} OR DEFINED ENV{BOOST_ROOT} OR DEFINED ENV{BOOST_LIBRARYDIR} OR DEFINED ENV{BOOST_INCLUDEDIR}))
message(WARNING "Some Boost environment variables are set and may hide the local superbuild Boost installation. "
"Consider enabling USE_SYSTEM_boost flag or unsetting the following environement variables :\n"
" BOOSTROOT=$ENV{BOOSTROOT}\n BOOST_ROOT=$ENV{BOOST_ROOT}\n BOOST_LIBRARYDIR=$ENV{BOOST_LIBRARYDIR}\n BOOST_INCLUDEDIR=$ENV{BOOST_INCLUDEDIR}")
endif()
list(APPEND superbuild_version_files list(APPEND superbuild_version_files
"${CMAKE_CURRENT_LIST_DIR}/versions.cmake") "${CMAKE_CURRENT_LIST_DIR}/versions.cmake")
list(APPEND superbuild_project_roots list(APPEND superbuild_project_roots
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment