[Boost-bugs] [Boost C++ Libraries] #2965: BoostTesting.cmake uses an incorrect variable and causes build to fail when used as a subdirectory

Subject: [Boost-bugs] [Boost C++ Libraries] #2965: BoostTesting.cmake uses an incorrect variable and causes build to fail when used as a subdirectory
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-04-23 07:49:27


#2965: BoostTesting.cmake uses an incorrect variable and causes build to fail when
used as a subdirectory
---------------------------------+------------------------------------------
 Reporter: steve_at_[hidden] | Owner: dgregor
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: CMake
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: Build |
---------------------------------+------------------------------------------
 Build fails when using the boost directory as a child node of another
 CMake-based project. That is, when another CMake-built project has the
 boost directory as a sub-project, as in,
 add_subdirectory(boost_1_38_0)

 then BoostTesting incorrectly sets BOOST_LIBS_DIR to
 ${CMAKE_SOURCE_DIR}/libs

 This is incorrect, because it assumes that the top level directory of the
 project will always include /libs in the source. More specifically, this
 is indicative of an overall problem where it assumes that the boost
 directory source is ALWAYS the top level CMake source directory, but this
 is not always the case. The fix to this problem is trivial. Change the
 relevant lines (56-59) in
 tools/build/CMake/BoostTesting.cmake from

 if(BOOST_BUILD_SANITY_TEST)
   set(BOOST_LIBS_DIR ${CMAKE_SOURCE_DIR}/tools/build/CMake/sanity)
   configure_file(${CMAKE_SOURCE_DIR}/libs/CMakeLists.txt
 ${BOOST_LIBS_DIR}/CMakeLists.txt COPYONLY)
 else(BOOST_BUILD_SANITY_TEST)
   set(BOOST_LIBS_DIR ${CMAKE_SOURCE_DIR}/libs)
 endif(BOOST_BUILD_SANITY_TEST)

 to

 if(BOOST_BUILD_SANITY_TEST)
   set(BOOST_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tools/build/CMake/sanity)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libs/CMakeLists.txt
 ${BOOST_LIBS_DIR}/CMakeLists.txt COPYONLY)
 else(BOOST_BUILD_SANITY_TEST)
   set(BOOST_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs)
 endif(BOOST_BUILD_SANITY_TEST)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2965>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC