Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2007-07-03 09:51:40


Author: dgregor
Date: 2007-07-03 09:51:39 EDT (Tue, 03 Jul 2007)
New Revision: 7348
URL: http://svn.boost.org/trac/boost/changeset/7348

Log:
CMakeLists.txt: Tweak ordering of multi-threaded/single-threaded for MSVC

libs/python/test/CMakeLists.txt: Tweak the Python path appropriately

libs/xpressive/CMakeLists.txt: Remove the "example" executable

tools/build/CMake/BoostConfig.cmake: Handle EXE linking flags

tools/build/CMake/BoostCore.cmake: Handle debug/release configurations in Visual Studio

tools/build/CMake/BoostTesting.cmake: Use CMAKE_CFG_INTDIR

Text files modified:
   sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt | 6 +++++-
   sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt | 3 +++
   sandbox-branches/boost-cmake/boost_1_34_0/libs/xpressive/CMakeLists.txt | 2 --
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake | 14 +++++++++++++-
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake | 29 ++++++++++++++++++-----------
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostTesting.cmake | 4 ++--
   6 files changed, 41 insertions(+), 17 deletions(-)

Modified: sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt 2007-07-03 09:51:39 EDT (Tue, 03 Jul 2007)
@@ -73,7 +73,11 @@
 # The default set of library variants that we will be building
 boost_add_default_variant(RELEASE DEBUG)
 boost_add_default_variant(STATIC SHARED)
-boost_add_default_variant(SINGLE_THREADED MULTI_THREADED)
+if(MSVC)
+ boost_add_default_variant(MULTI_THREADED SINGLE_THREADED)
+else(MSVC)
+ boost_add_default_variant(SINGLE_THREADED MULTI_THREADED)
+endif(MSVC)
 boost_add_default_variant(DYNAMIC_RUNTIME STATIC_RUNTIME)
 
 # Extra features used by some libraries

Modified: sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt 2007-07-03 09:51:39 EDT (Tue, 03 Jul 2007)
@@ -37,6 +37,9 @@
     
   # Run the test itself
   file(TO_NATIVE_PATH ${LIBRARY_OUTPUT_PATH} PYTHONPATH)
+ if(WIN32 AND NOT UNIX)
+ string(REPLACE "\\" "\\\\" PYTHONPATH ${PYTHONPATH})
+ endif(WIN32 AND NOT UNIX)
   add_test("${PROJECT_NAME}::${TESTNAME}"
     ${PYTHON_EXECUTABLE}
     "${CMAKE_CURRENT_SOURCE_DIR}/pyrun.py"

Modified: sandbox-branches/boost-cmake/boost_1_34_0/libs/xpressive/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/libs/xpressive/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/xpressive/CMakeLists.txt 2007-07-03 09:51:39 EDT (Tue, 03 Jul 2007)
@@ -2,5 +2,3 @@
   Xpressive
   TESTDIRS test
 )
-
-add_executable(example example/main.cpp)

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake 2007-07-03 09:51:39 EDT (Tue, 03 Jul 2007)
@@ -109,10 +109,18 @@
   set(RELEASE_LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING "Link flags for release libraries")
 endif(CMAKE_SHARED_LINKER_FLAGS_RELEASE)
 
+# Set DEBUG_EXE_LINK_FLAGS, RELEASE_EXE_LINK_FLAGS
+if (CMAKE_EXE_LINKER_FLAGS_DEBUG)
+ set(DEBUG_EXE_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+endif (CMAKE_EXE_LINKER_FLAGS_DEBUG)
+if (CMAKE_EXE_LINKER_FLAGS_RELEASE)
+ set(RELEASE_EXE_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
+endif (CMAKE_EXE_LINKER_FLAGS_RELEASE)
+
 # Tweak the configuration and build types appropriately.
 if(CMAKE_CONFIGURATION_TYPES)
   # Limit CMAKE_CONFIGURATION_TYPES to Debug and Release
- set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
+ set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Semicolon-separate list of supported configuration types" FORCE)
 else(CMAKE_CONFIGURATION_TYPES)
   # Build in release mode by default
   if (NOT CMAKE_BUILD_TYPE)
@@ -125,12 +133,16 @@
 set(CMAKE_CXX_FLAGS_DEBUG "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "Unused by Boost")
+set(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_CXX_FLAGS_RELEASE "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "" CACHE INTERNAL "Unused by Boost")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused by Boost")
+set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused by Boost")
 set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused by Boost")
+set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused by Boost")

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake 2007-07-03 09:51:39 EDT (Tue, 03 Jul 2007)
@@ -871,17 +871,17 @@
       endif (NOT THIS_EXE_FOUND_FEATURE)
     endif (NOT THIS_EXE_REQUESTED_FROM_SET)
   endforeach(FEATURESET_STR ${BOOST_FEATURES})
-
+
   # Propagate flags from each of the features
   if (THIS_EXE_OKAY)
     foreach (FEATURE ${THIS_EXE_VARIANT})
       # Add all of the flags for this feature
       set(THIS_EXE_COMPILE_FLAGS
- "${THIS_EXE_COMPILE_FLAGS} ${THIS_EXE_${FEATURE}_COMPILE_FLAGS} ${${FEATURE}_COMPILE_FLAGS}")
+ "${THIS_EXE_COMPILE_FLAGS} ${THIS_EXE_${FEATURE}_COMPILE_FLAGS} ${${FEATURE}_COMPILE_FLAGS}")
       set(THIS_EXE_LINK_FLAGS
- "${THIS_EXE_LINK_FLAGS} ${THIS_EXE_${FEATURE}_LINK_FLAGS} ${${FEATURE}_LINK_FLAGS}")
+ "${THIS_EXE_LINK_FLAGS} ${THIS_EXE_${FEATURE}_LINK_FLAGS} ${${FEATURE}_LINK_FLAGS} ${${FEATURE}_EXE_LINK_FLAGS}")
       set(THIS_EXE_LINK_LIBS
- ${THIS_EXE_LINK_LIBS} ${THIS_EXE_${FEATURE}_LINK_LIBS} ${${FEATURE}_LINK_LIBS})
+ ${THIS_EXE_LINK_LIBS} ${THIS_EXE_${FEATURE}_LINK_LIBS} ${${FEATURE}_LINK_LIBS})
     endforeach (FEATURE ${THIS_EXE_VARIANT})
 
     # Handle feature interactions
@@ -945,8 +945,8 @@
         PROPERTIES
         COMPILE_FLAGS_DEBUG "${DEBUG_COMPILE_FLAGS} ${THIS_EXE_COMPILE_FLAGS}"
         COMPILE_FLAGS_RELEASE "${RELEASE_COMPILE_FLAGS} ${THIS_EXE_COMPILE_FLAGS}"
- LINK_FLAGS_DEBUG "${DEBUG_LINK_FLAGS} ${THIS_EXE_LINK_FLAGS}"
- LINK_FLAGS_RELEASE "${RELEASE_LINK_FLAGS} ${THIS_EXE_LINK_FLAGS}"
+ LINK_FLAGS_DEBUG "${DEBUG_LINK_FLAGS} ${DEBUG_EXE_LINK_FLAGS} ${THIS_EXE_LINK_FLAGS}"
+ LINK_FLAGS_RELEASE "${RELEASE_LINK_FLAGS} ${RELEASE_EXE_LINK_FLAGS} ${THIS_EXE_LINK_FLAGS}"
         )
     endif (THIS_EXE_DEBUG_AND_RELEASE)
 
@@ -960,11 +960,18 @@
 
     # Link against the various libraries
     if (THIS_EXE_DEBUG_AND_RELEASE)
- target_link_libraries(${EXENAME}
- ${THIS_EXE_LINK_LIBS}
- release ${THIS_EXE_RELEASE_ACTUAL_DEPENDS} ${THIS_EXE_RELEASE_LINK_LIBS}
- debug ${THIS_EXE_DEBUG_ACTUAL_DEPENDS} ${THIS_EXE_DEBUG_LINK_LIBS}
- )
+ # Configuration-agnostic libraries
+ target_link_libraries(${EXENAME} ${THIS_EXE_LINK_LIBS})
+
+ # Link against libraries for "release" configuration
+ foreach(LIB ${THIS_EXE_RELEASE_ACTUAL_DEPENDS} ${THIS_EXE_RELEASE_LINK_LIBS})
+ target_link_libraries(${EXENAME} optimized ${LIB})
+ endforeach(LIB ${THIS_EXE_RELEASE_ACTUAL_DEPENDS} ${THIS_EXE_RELEASE_LINK_LIBS})
+
+ # Link against libraries for "debug" configuration
+ foreach(LIB ${THIS_EXE_DEBUG_ACTUAL_DEPENDS} ${THIS_EXE_DEBUG_LINK_LIBS})
+ target_link_libraries(${EXENAME} debug ${LIB})
+ endforeach(LIB ${THIS_EXE_DEBUG_ACTUAL_DEPENDS} ${THIS_EXE_DEBUG_LINK_LIBS})
     else (THIS_EXE_DEBUG_AND_RELEASE)
       target_link_libraries(${EXENAME}
         ${THIS_EXE_ACTUAL_DEPENDS}

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostTesting.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostTesting.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostTesting.cmake 2007-07-03 09:51:39 EDT (Tue, 03 Jul 2007)
@@ -167,7 +167,7 @@
       NO_INSTALL)
     if (THIS_EXE_OKAY)
       add_test("${PROJECT_NAME}::${testname}"
- ${EXECUTABLE_OUTPUT_PATH}/tests/${PROJECT_NAME}/${testname}
+ ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/tests/${PROJECT_NAME}/${testname}
         ${THIS_EXE_ARGS})
     endif (THIS_EXE_OKAY)
   endif(BUILD_TESTING)
@@ -233,7 +233,7 @@
       NO_INSTALL)
     if (THIS_EXE_OKAY)
       add_test("${PROJECT_NAME}::${testname}"
- ${EXECUTABLE_OUTPUT_PATH}/tests/${PROJECT_NAME}/${testname}
+ ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/tests/${PROJECT_NAME}/${testname}
         ${THIS_EXE_ARGS})
       set_tests_properties("${PROJECT_NAME}::${testname}"
         PROPERTIES WILL_FAIL TRUE)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk