|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49913 - in trunk: . tools/build/CMake
From: mike.jackson_at_[hidden]
Date: 2008-11-24 10:38:23
Author: imikejackson
Date: 2008-11-24 10:38:22 EST (Mon, 24 Nov 2008)
New Revision: 49913
URL: http://svn.boost.org/trac/boost/changeset/49913
Log:
Changing the initial warning to the user for first time run of CMake so that the user needs to enter "-DCMAKE_IS_EXPERIMENTAL:bool=TRUE' instead of having to uncomment code in the CMake file. This is only needed one time during the initial run of CMake on the boost source directory.
Text files modified:
trunk/CMakeLists.txt | 31 ++++++---------------
trunk/tools/build/CMake/BoostCore.cmake | 56 ++++++++++++++++++++++++++-------------
2 files changed, 46 insertions(+), 41 deletions(-)
Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt (original)
+++ trunk/CMakeLists.txt 2008-11-24 10:38:22 EST (Mon, 24 Nov 2008)
@@ -32,13 +32,16 @@
# Post a warning to those attempting to use the CMake Build system. When #
# the build system stabilizes this can be removed. #
##########################################################################
+if (NOT CMAKE_IS_EXPERIMENTAL)
message(STATUS "##########################################################################")
message(STATUS " THE CMAKE BUILD SYSTEM IS CURRENTLY UNDER DEVELOPMENT. PLEASE USE THE ")
-message(STATUS " BJAM BASED SYSTEM INSTEAD. IF YOU STILL WANT TO TRY IT OUT PLEASE COMMENT")
-message(STATUS " OUT THE LINE 'message(FATAL_ERROR \"\")' THAT APPEARS IN THE FILE ")
-message(STATUS " ${Boost_SOURCE_DIR}/CMakeLists.txt FILE.")
+message(STATUS " BJAM BASED SYSTEM INSTEAD TO BUILD A PRODUCTION VERSION OF BOOST. IF YOU ")
+message(STATUS " STILL WANT TO TRY IT OUT INVOKE CMake WITH '-DCMAKE_IS_EXPERIMENTAL:boolean=TRUE'")
+message(STATUS " ARGUMENT. After this first run of cmake you will no longer have to supply")
+message(STATUS " the argument unless you need to run a cmake on a clean build directory.")
message(STATUS "##########################################################################")
-#message(FATAL_ERROR "")
+message(FATAL_ERROR "")
+endif (NOT CMAKE_IS_EXPERIMENTAL)
##########################################################################
# Version information #
@@ -55,24 +58,8 @@
# tree rather than installed Boost libraries.
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-if (FALSE)
-# ---------- Setup output Directories -------------------------
-SET (LIBRARY_OUTPUT_PATH
- ${PROJECT_BINARY_DIR}/lib
- CACHE PATH
- "Directory for all Libraries"
- )
-
-# --------- Setup the Executable output Directory -------------
-SET (EXECUTABLE_OUTPUT_PATH
- ${PROJECT_BINARY_DIR}/bin
- CACHE PATH
- "Directory for all Executables."
- )
-endif(FALSE)
-
-
##########################################################################
# Boost CMake modules #
##########################################################################
@@ -212,7 +199,7 @@
if(COMMAND cpack_configure_downloads)
cpack_configure_downloads(
- "http://www.osl.iu.edu/~dgregor/Boost-CMake/1.36.0/"
+ "http://www.osl.iu.edu/~dgregor/Boost-CMake/${BOOST_VERSION}/"
ALL ADD_REMOVE)
endif()
##########################################################################
Modified: trunk/tools/build/CMake/BoostCore.cmake
==============================================================================
--- trunk/tools/build/CMake/BoostCore.cmake (original)
+++ trunk/tools/build/CMake/BoostCore.cmake 2008-11-24 10:38:22 EST (Mon, 24 Nov 2008)
@@ -620,7 +620,7 @@
set(THIS_VARIANT_COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS}")
set(THIS_VARIANT_LINK_FLAGS "${THIS_LIB_LINK_FLAGS}")
set(THIS_VARIANT_LINK_LIBS ${THIS_LIB_LINK_LIBS})
-
+
# Determine if it is okay to build this variant
set(THIS_VARIANT_OKAY TRUE)
foreach(ARG ${ARGN})
@@ -649,6 +649,7 @@
boost_feature_interactions("THIS_VARIANT" ${ARGN})
if (THIS_VARIANT_OKAY)
+
# Determine the suffix for this library target
boost_library_variant_target_name(${ARGN})
set(VARIANT_LIBNAME "${LIBNAME}${VARIANT_TARGET_NAME}")
@@ -696,12 +697,12 @@
CLEAN_DIRECT_OUTPUT 1
COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}"
LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}"
- SOVERSION "${BOOST_VERSION}"
+ # SOVERSION "${BOOST_VERSION}"
)
else (THIS_LIB_IS_STATIC)
+ #TODO: Check the SOVERSION behavior on Linux and Windows
# Add a module
add_library(${VARIANT_LIBNAME} SHARED ${THIS_LIB_SOURCES})
-
# Set properties on this library
set_target_properties(${VARIANT_LIBNAME}
PROPERTIES
@@ -709,7 +710,7 @@
CLEAN_DIRECT_OUTPUT 1
COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}"
LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}"
- SOVERSION "${BOOST_VERSION}"
+ # SOVERSION "${BOOST_VERSION}"
)
endif (THIS_LIB_IS_STATIC)
@@ -733,18 +734,18 @@
string(TOLOWER ${PROJECT_NAME} libname)
install(TARGETS ${VARIANT_LIBNAME} DESTINATION lib COMPONENT ${LIB_COMPONENT})
set_property(
- TARGET ${VARIANT_LIBNAME}
- PROPERTY BOOST_CPACK_COMPONENT
- ${LIB_COMPONENT})
+ TARGET ${VARIANT_LIBNAME}
+ PROPERTY BOOST_CPACK_COMPONENT
+ ${LIB_COMPONENT})
# Make the library installation component dependent on the library
# installation components of dependent libraries.
set(THIS_LIB_COMPONENT_DEPENDS)
foreach(DEP ${THIS_LIB_DEPENDS})
- # We ask the library variant that this library depends on to tell us
- # what it's associated installation component is. We depend on that
- # installation component.
- get_property(DEP_COMPONENT
+ # We ask the library variant that this library depends on to tell us
+ # what it's associated installation component is. We depend on that
+ # installation component.
+ get_property(DEP_COMPONENT
TARGET "${DEP}${VARIANT_TARGET_NAME}"
PROPERTY BOOST_CPACK_COMPONENT)
@@ -880,7 +881,7 @@
# boost_add_extra_variant is that adding a new default variant
# introduces additional variants to *all* Boost libraries, unless
# those variants are explicitly excluded by the library. Adding a new
-# extra variant, on the other hand, allows librarie to specifically
+# extra variant, on the other hand, allows libraries to specifically
# request extra variants using that feature.
#
# Variables affected:
@@ -930,7 +931,8 @@
# [STATIC_TAG]
# [MODULE]
# [NOT_feature]
-# [EXTRA_VARIANTS variant1 variant2 ...])
+# [EXTRA_VARIANTS variant1 variant2 ...]
+# [FORCE_VARIANTS variant1])
#
# where libname is the name of Boost library binary (e.g.,
# "boost_regex") and source1, source2, etc. are the source files used
@@ -1023,6 +1025,9 @@
# some with the PYTHON_NODEBUG feature and some with the
# PYTHON_DEBUG feature.
#
+# FORCE_VARIANTS: This will force the build system to ALWAYS build this
+# variant of the library not matter what variants are set.
+#
# Example:
# boost_add_library(
# boost_thread
@@ -1031,20 +1036,18 @@
# tss.cpp xtime.cpp
# SHARED_COMPILE_FLAGS "-DBOOST_THREAD_BUILD_DLL=1"
# STATIC_COMPILE_FLAGS "-DBOOST_THREAD_BUILD_LIB=1"
-# NO_SINGLE_THREADED
+# NOT_SINGLE_THREADED
# )
macro(boost_add_library LIBNAME)
parse_arguments(THIS_LIB
- "DEPENDS;COMPILE_FLAGS;LINK_FLAGS;LINK_LIBS;EXTRA_VARIANTS;${BOOST_ADD_ARG_NAMES}"
+ "DEPENDS;COMPILE_FLAGS;LINK_FLAGS;LINK_LIBS;EXTRA_VARIANTS;FORCE_VARIANTS;${BOOST_ADD_ARG_NAMES}"
"STATIC_TAG;MODULE;NO_INSTALL;${BOOST_ADDLIB_OPTION_NAMES}"
${ARGN}
)
set(THIS_LIB_SOURCES ${THIS_LIB_DEFAULT_ARGS})
- string(TOUPPER "${LIBNAME}_COMPILED_LIB" var)
- # message(STATUS "var: ${var}")
- set (${var} TRUE CACHE INTERNAL "")
- # message(STATUS "${var}: ${${var}}")
+ string(TOUPPER "${LIBNAME}_COMPILED_LIB" compiled_lib)
+ set (${compiled_lib} TRUE CACHE INTERNAL "")
if (NOT TEST_INSTALLED_TREE)
# A top-level target that refers to all of the variants of the
@@ -1067,6 +1070,14 @@
set(THIS_LIB_VARIANTS ${BOOST_DEFAULT_VARIANTS})
endif (THIS_LIB_EXTRA_VARIANTS)
+ if (THIS_LIB_FORCE_VARIANTS)
+ # string(TOUPPER "${LIBNAME}_FORCE_VARIANTS" force_variants)
+ # set(${force_variants} ${THIS_LIB_FORCE_VARIANTS} CACHE INTERNAL "")
+ set(BUILD_${THIS_LIB_FORCE_VARIANTS}_PREV ${BUILD_${THIS_LIB_FORCE_VARIANTS}} )
+ set(BUILD_${THIS_LIB_FORCE_VARIANTS} TRUE)
+ endif (THIS_LIB_FORCE_VARIANTS)
+
+
# Build each of the library variants
foreach(VARIANT_STR ${THIS_LIB_VARIANTS})
string(REPLACE ":" ";" VARIANT ${VARIANT_STR})
@@ -1074,6 +1085,12 @@
boost_library_variant(${LIBNAME} ${VARIANT})
endforeach(VARIANT_STR ${THIS_LIB_VARIANTS})
endif (NOT TEST_INSTALLED_TREE)
+
+ if (THIS_LIB_FORCE_VARIANTS)
+ set(BUILD_${THIS_LIB_FORCE_VARIANTS} ${BUILD_${THIS_LIB_FORCE_VARIANTS}_PREV} )
+ # message(STATUS "* ^^ BUILD_${THIS_LIB_FORCE_VARIANTS} ${BUILD_${THIS_LIB_FORCE_VARIANTS}}")
+ endif (THIS_LIB_FORCE_VARIANTS)
+
endmacro(boost_add_library)
# Creates a new executable from source files.
@@ -1205,6 +1222,7 @@
# with that feature), then we won't build this executable.
if (NOT BUILD_${FEATURE})
set(THIS_EXE_OKAY FALSE)
+ message(STATUS "* ${EXENAME} is NOT being built because BUILD_${FEATURE} is FALSE")
endif (NOT BUILD_${FEATURE})
endif (THIS_EXE_${FEATURE})
endforeach (FEATURE ${FEATURESET})
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