From 1ebf7d53867d0904fddd6839285dc7004a7d16b7 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 17 Oct 2009 01:10:45 +0000 Subject: [PATCH] rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release. [SVN r56941] --- CMake/BoostConfig.cmake | 222 ----- CMake/BoostCore.cmake | 1441 ------------------------------ CMake/BoostDocs.cmake | 534 ----------- CMake/BoostTesting.cmake | 453 ---------- CMake/BoostUtils.cmake | 227 ----- CMake/CompileTest/CMakeLists.txt | 12 - CMake/FindICU.cmake | 51 -- CMake/LinkTest/CMakeLists.txt | 26 - CMake/catalog.xml.in | 9 - 9 files changed, 2975 deletions(-) delete mode 100644 CMake/BoostConfig.cmake delete mode 100644 CMake/BoostCore.cmake delete mode 100644 CMake/BoostDocs.cmake delete mode 100644 CMake/BoostTesting.cmake delete mode 100644 CMake/BoostUtils.cmake delete mode 100644 CMake/CompileTest/CMakeLists.txt delete mode 100644 CMake/FindICU.cmake delete mode 100644 CMake/LinkTest/CMakeLists.txt delete mode 100644 CMake/catalog.xml.in diff --git a/CMake/BoostConfig.cmake b/CMake/BoostConfig.cmake deleted file mode 100644 index ada1888da..000000000 --- a/CMake/BoostConfig.cmake +++ /dev/null @@ -1,222 +0,0 @@ -########################################################################## -# Boost Configuration Support # -########################################################################## -# Copyright (C) 2007 Douglas Gregor # -# Copyright (C) 2007 Troy Straszheim # -# # -# Distributed under the Boost Software License, Version 1.0. # -# See accompanying file LICENSE_1_0.txt or copy at # -# http://www.boost.org/LICENSE_1_0.txt # -########################################################################## -# This module defines several variables that provide information about # -# the target compiler and platform. # -# # -# Variables defined: # -# # -# BOOST_TOOLSET: # -# The Boost toolset name, used by the library version mechanism to # -# encode the compiler and version into the name of the # -# library. This toolset name will correspond with Boost.Build # -# version 2's toolset name, including version number. # -# # -# MULTI_THREADED_COMPILE_FLAGS: # -# Compilation flags when building multi-threaded programs. # -# # -# MULTI_THREADED_LINK_FLAGS: # -# Linker flags when building multi-threaded programs. # -########################################################################## -include(CheckCXXSourceCompiles) - -# -# Python interpreter -# -include(FindPythonInterp) -include(FindPythonLibs) - -# Toolset detection. -if (NOT BOOST_TOOLSET) - set(BOOST_TOOLSET "unknown") - if (MSVC60) - set(BOOST_TOOLSET "vc6") - set(BOOST_COMPILER "msvc") - set(BOOST_COMPILER_VERSION "6.0") - elseif(MSVC70) - set(BOOST_TOOLSET "vc7") - set(BOOST_COMPILER "msvc") - set(BOOST_COMPILER_VERSION "7.0") - elseif(MSVC71) - set(BOOST_TOOLSET "vc71") - set(BOOST_COMPILER "msvc") - set(BOOST_COMPILER_VERSION "7.1") - elseif(MSVC80) - set(BOOST_TOOLSET "vc80") - set(BOOST_COMPILER "msvc") - set(BOOST_COMPILER_VERSION "8.0") - elseif(MSVC90) - set(BOOST_TOOLSET "vc90") - set(BOOST_COMPILER "msvc") - set(BOOST_COMPILER_VERSION "9.0") - elseif(MSVC) - set(BOOST_TOOLSET "vc") - set(BOOST_COMPILER "msvc") - set(BOOST_COMPILER_VERSION "unknown") - elseif(BORLAND) - set(BOOST_TOOLSET "bcb") - set(BOOST_COMPILER "msvc") - set(BOOST_COMPILER_VERSION "unknown") - elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - set(BOOST_COMPILER "gcc") - - # Execute GCC with the -dumpversion option, to give us a version string - execute_process( - COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion" - OUTPUT_VARIABLE GCC_VERSION_STRING) - - # Match only the major and minor versions of the version string - string(REGEX MATCH "[0-9]+.[0-9]+" GCC_MAJOR_MINOR_VERSION_STRING - "${GCC_VERSION_STRING}") - - # Match the full compiler version for the build name - string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" BOOST_COMPILER_VERSION - "${GCC_VERSION_STRING}") - - # Strip out the period between the major and minor versions - string(REGEX REPLACE "\\." "" BOOST_VERSIONING_GCC_VERSION - "${GCC_MAJOR_MINOR_VERSION_STRING}") - - # Set the GCC versioning toolset - set(BOOST_TOOLSET "gcc${BOOST_VERSIONING_GCC_VERSION}") - elseif(CMAKE_CXX_COMPILER MATCHES "/icpc$" OR CMAKE_CXX_COMPILER MATCHES "/icpc.exe$") - set(BOOST_TOOLSET "intel") - set(BOOST_COMPILER "intel") - set(CMAKE_COMPILER_IS_INTEL ON) - execute_process( - COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion" - OUTPUT_VARIABLE INTEL_VERSION_STRING - OUTPUT_STRIP_TRAILING_WHITESPACE) - set(BOOST_COMPILER_VERSION ${INTEL_VERSION_STRING}) - endif(MSVC60) -endif (NOT BOOST_TOOLSET) - -message(STATUS "Boost compiler: ${BOOST_COMPILER}") -message(STATUS "Boost toolset: ${BOOST_TOOLSET}") - -# create cache entry -set(BOOST_PLATFORM "unknown") - -# Multi-threading support -if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") - set(MULTI_THREADED_COMPILE_FLAGS "-pthreads") - set(MULTI_THREADED_LINK_LIBS rt) - set(BOOST_PLATFORM "sunos") -elseif(CMAKE_SYSTEM_NAME STREQUAL "BeOS") - # No threading options necessary for BeOS - set(BOOST_PLATFORM "beos") -elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSD") - set(MULTI_THREADED_COMPILE_FLAGS "-pthread") - set(MULTI_THREADED_LINK_LIBS pthread) - set(BOOST_PLATFORM "bsd") -elseif(CMAKE_SYSTEM_NAME STREQUAL "DragonFly") - # DragonFly is a FreeBSD bariant - set(MULTI_THREADED_COMPILE_FLAGS "-pthread") - set(BOOST_PLATFORM "dragonfly") -elseif(CMAKE_SYSTEM_NAME STREQUAL "IRIX") - # TODO: GCC on Irix doesn't support multi-threading? - set(BOOST_PLATFORM "irix") -elseif(CMAKE_SYSTEM_NAME STREQUAL "HP-UX") - # TODO: gcc on HP-UX does not support multi-threading? - set(BOOST_PLATFORM "hpux") -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # No threading options necessary for Mac OS X - set(BOOST_PLATFORM "macos") -elseif(UNIX) - # Assume -pthread and -lrt on all other variants - set(MULTI_THREADED_COMPILE_FLAGS "-pthread -D_REENTRANT") - set(MULTI_THREADED_LINK_FLAGS "") - set(MULTI_THREADED_LINK_LIBS pthread rt) - - if (MINGW) - set(BOOST_PLATFORM "mingw") - elseif(CYGWIN) - set(BOOST_PLATFORM "cygwin") - elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(BOOST_PLATFORM "linux") - else() - set(BOOST_PLATFORM "unix") - endif() -elseif(WIN32) - set(BOOST_PLATFORM "windows") -else() - set(BOOST_PLATFORM "unknown") -endif() - -# create cache entry -set(BOOST_PLATFORM ${BOOST_PLATFORM} CACHE STRING "Boost platform name") - -message(STATUS "Boost platform: ${BOOST_PLATFORM}") - -# Setup DEBUG_COMPILE_FLAGS, RELEASE_COMPILE_FLAGS, DEBUG_LINK_FLAGS and -# and RELEASE_LINK_FLAGS based on the CMake equivalents -if(CMAKE_CXX_FLAGS_DEBUG) - if(MSVC) - # Eliminate the /MDd flag; we'll add it back when we need it - string(REPLACE "/MDd" "" CMAKE_CXX_FLAGS_DEBUG - "${CMAKE_CXX_FLAGS_DEBUG}") - endif(MSVC) - set(DEBUG_COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "Compilation flags for debug libraries") -endif(CMAKE_CXX_FLAGS_DEBUG) -if(CMAKE_CXX_FLAGS_RELEASE) - if(MSVC) - # Eliminate the /MD flag; we'll add it back when we need it - string(REPLACE "/MD" "" CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE}") - endif(MSVC) - set(RELEASE_COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "Compilation flags for release libraries") -endif(CMAKE_CXX_FLAGS_RELEASE) -if(CMAKE_SHARED_LINKER_FLAGS_DEBUG) - set(DEBUG_LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING "Linker flags for debug libraries") -endif(CMAKE_SHARED_LINKER_FLAGS_DEBUG) -if(CMAKE_SHARED_LINKER_FLAGS_RELEASE) - 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" 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) - set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are Release or Debug" FORCE) - endif (NOT CMAKE_BUILD_TYPE) -endif(CMAKE_CONFIGURATION_TYPES) - -# Clear out the built-in C++ compiler and link flags for each of the -# configurations. -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") - -# Set the build name -set(BUILDNAME "${BOOST_COMPILER}-${BOOST_COMPILER_VERSION}-${BOOST_PLATFORM}") diff --git a/CMake/BoostCore.cmake b/CMake/BoostCore.cmake deleted file mode 100644 index d1116f713..000000000 --- a/CMake/BoostCore.cmake +++ /dev/null @@ -1,1441 +0,0 @@ -########################################################################## -# Core Functionality for Boost # -########################################################################## -# Copyright (C) 2007-2009 Douglas Gregor # -# Copyright (C) 2007-2009 Troy Straszheim # -# # -# Distributed under the Boost Software License, Version 1.0. # -# See accompanying file LICENSE_1_0.txt or copy at # -# http://www.boost.org/LICENSE_1_0.txt # -########################################################################## -# Important developer macros in this file: # -# # -# boost_library_project: Defines a Boost library project (e.g., # -# Boost.Python). # -# # -# boost_add_library: Builds library binaries for Boost libraries # -# with compiled sources (e.g., boost_filesystem). # -# # -# boost_add_executable: Builds executables. # -########################################################################## - -add_custom_target(modularize) - -# Defines a Boost library project (e.g., for Boost.Python). Use as: -# -# boost_library_project(libname -# [SRCDIRS srcdir1 srcdir2 ...] -# [TESTDIRS testdir1 testdir2 ...] -# [DEPENDS lib1 lib2 ...] -# [DESCRIPTION description] -# [AUTHORS author1 author2 ...] -# [MAINTAINERS maint1 maint2 ...] -# [MODULARIZED]) -# -# where libname is the name of the library (e.g., Python, or -# Filesystem), srcdir1, srcdir2, etc, are subdirectories containing -# library sources (for Boost libraries that build actual library -# binaries), and testdir1, testdir2, etc, are subdirectories -# containing regression tests. DEPENDS lists the names of the other -# Boost libraries that this library depends on. If the dependencies -# are not satisfied (e.g., because the library isn't present or its -# build is turned off), this library won't be built. -# -# DESCRIPTION provides a brief description of the library, which can -# be used to summarize the behavior of the library for a user. AUTHORS -# lists the authors of the library, while MAINTAINERS lists the active -# maintainers. If MAINTAINERS is left empty, it is assumed that the -# authors are still maintaining the library. Both authors and maintainers -# should have their name followed by their current e-mail address in -# angle brackets, with -at- instead of the at sign, e.g., -# Douglas Gregor -# -# For libraries that build actual library binaries, this macro adds a -# option BUILD_BOOST_LIBNAME (which defaults to ON). When the option -# is ON, this macro will include the source subdirectories, and -# therefore, will build and install the library binary. -# -# For libraries that have regression tests, and when testing is -# enabled globally by the BUILD_REGRESSION_TESTS option, this macro also -# defines the TEST_BOOST_LIBNAME option (defaults to ON). When ON, the -# generated makefiles/project files will contain regression tests for -# this library. -# -# Example: -# boost_library_project( -# Thread -# SRCDIRS src -# TESTDIRS test -# ) -macro(boost_library_project LIBNAME) - parse_arguments(THIS_PROJECT - "SRCDIRS;TESTDIRS;HEADERS;DOCDIRS;DESCRIPTION;AUTHORS;MAINTAINERS" - "MODULARIZED" - ${ARGN} - ) - - # Set THIS_PROJECT_DEPENDS_ALL to the set of all of its - # dependencies, its dependencies' dependencies, etc., transitively. - string(TOUPPER "BOOST_${LIBNAME}_DEPENDS" THIS_PROJECT_DEPENDS) - set(THIS_PROJECT_DEPENDS_ALL ${${THIS_PROJECT_DEPENDS}}) - set(ADDED_DEPS TRUE) - while (ADDED_DEPS) - set(ADDED_DEPS FALSE) - foreach(DEP ${THIS_PROJECT_DEPENDS_ALL}) - string(TOUPPER "BOOST_${DEP}_DEPENDS" DEP_DEPENDS) - foreach(DEPDEP ${${DEP_DEPENDS}}) - list(FIND THIS_PROJECT_DEPENDS_ALL ${DEPDEP} DEPDEP_INDEX) - if (DEPDEP_INDEX EQUAL -1) - list(APPEND THIS_PROJECT_DEPENDS_ALL ${DEPDEP}) - set(ADDED_DEPS TRUE) - endif() - endforeach() - endforeach() - endwhile() - - set(THIS_PROJECT_OKAY ON) - - if(FALSE) - # This really isn't the check we want to do, especially when we - # hit circular dependencies. For now, just enable all libraries to - # be built all the time, until we can implement proper subsetting - # behavior at the CMake level. - set(THIS_PROJECT_FAILED_DEPS "") - foreach(DEP ${THIS_PROJECT_DEPENDS_ALL}) - string(TOUPPER "BUILD_BOOST_${DEP}" BOOST_LIB_DEP) - if (NOT ${BOOST_LIB_DEP}) - set(THIS_PROJECT_OKAY OFF) - set(THIS_PROJECT_FAILED_DEPS "${THIS_PROJECT_FAILED_DEPS} ${DEP}\n") - endif (NOT ${BOOST_LIB_DEP}) - endforeach(DEP) - endif(FALSE) - - if (THIS_PROJECT_SRCDIRS) - # This Boost library has source directories, so provide an option - # BUILD_BOOST_LIBNAME that allows one to turn on/off building of - # the library. - if (NOT THIS_PROJECT_OKAY) - if (${BOOST_BUILD_LIB_OPTION}) - # The user explicitly turned on this library in a prior - # iteration, but it can no longer be built because one of the - # dependencies was turned off. Force this option off and - # complain about it. - set(${BOOST_BUILD_LIB_OPTION} OFF - CACHE BOOL "Build Boost.${LIBNAME} (prefer make targets, not this, to build individual libs)" FORCE) - message(SEND_ERROR - "Cannot build Boost.${LIBNAME} due to missing library dependencies:\n${THIS_PROJECT_FAILED_DEPS}") - endif (${BOOST_BUILD_LIB_OPTION}) - endif (NOT THIS_PROJECT_OKAY) - endif (THIS_PROJECT_SRCDIRS) - - if(THIS_PROJECT_OKAY) - string(TOLOWER "${LIBNAME}" libname) - string(TOUPPER "${LIBNAME}" ULIBNAME) - project(${LIBNAME}) - - if (THIS_PROJECT_MODULARIZED OR THIS_PROJECT_SRCDIRS) - # We only build a component group for modularized libraries or libraries - # that have compiled parts. - if (COMMAND cpack_add_component_group) - # Compute a reasonable description for this library. - if (THIS_PROJECT_DESCRIPTION) - set(THIS_PROJECT_DESCRIPTION "Boost.${LIBNAME}\n\n${THIS_PROJECT_DESCRIPTION}") - - if (THIS_PROJECT_AUTHORS) - list(LENGTH THIS_PROJECT_AUTHORS THIS_PROJECT_NUM_AUTHORS) - if (THIS_PROJECT_NUM_AUTHORS EQUAL 1) - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n\nAuthor: ") - else() - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n\nAuthors: ") - endif() - set(THIS_PROJECT_FIRST_AUTHOR TRUE) - foreach(AUTHOR ${THIS_PROJECT_AUTHORS}) - string(REGEX REPLACE " *-at- *" "@" AUTHOR ${AUTHOR}) - if (THIS_PROJECT_FIRST_AUTHOR) - set(THIS_PROJECT_FIRST_AUTHOR FALSE) - else() - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n ") - endif() - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}${AUTHOR}") - endforeach(AUTHOR) - endif (THIS_PROJECT_AUTHORS) - - if (THIS_PROJECT_MAINTAINERS) - list(LENGTH THIS_PROJECT_MAINTAINERS THIS_PROJECT_NUM_MAINTAINERS) - if (THIS_PROJECT_NUM_MAINTAINERS EQUAL 1) - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\nMaintainer: ") - else() - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\nMaintainers: ") - endif() - set(THIS_PROJECT_FIRST_MAINTAINER TRUE) - foreach(MAINTAINER ${THIS_PROJECT_MAINTAINERS}) - string(REGEX REPLACE " *-at- *" "@" MAINTAINER ${MAINTAINER}) - if (THIS_PROJECT_FIRST_MAINTAINER) - set(THIS_PROJECT_FIRST_MAINTAINER FALSE) - else() - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n ") - endif() - set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}${MAINTAINER}") - endforeach(MAINTAINER) - endif (THIS_PROJECT_MAINTAINERS) - endif (THIS_PROJECT_DESCRIPTION) - - # Create a component group for this library - fix_cpack_component_name(CPACK_COMPONENT_GROUP_NAME ${libname}) - cpack_add_component_group(${CPACK_COMPONENT_GROUP_NAME} - DISPLAY_NAME "${LIBNAME}" - DESCRIPTION ${THIS_PROJECT_DESCRIPTION}) - endif () - endif () - - if (THIS_PROJECT_MODULARIZED) - # Add this module's include directory - include_directories("${Boost_SOURCE_DIR}/libs/${libname}/include") - - # - # Horrible hackery. Make install of headers from modularized directories - # OPTIONAL, which only works on cmake >= 2.7 - # - if (${CMAKE_MAJOR_VERSION} GREATER 1 AND ${CMAKE_MINOR_VERSION} GREATER 6) - set(_INSTALL_OPTIONAL "OPTIONAL") - endif() - - # Install this module's headers - install(DIRECTORY include/boost - DESTINATION ${BOOST_HEADER_DIR} - ${_INSTALL_OPTIONAL} - COMPONENT ${libname}_headers - PATTERN "CVS" EXCLUDE - PATTERN ".svn" EXCLUDE) - - if (COMMAND cpack_add_component) - # Determine the header dependencies - set(THIS_PROJECT_HEADER_DEPENDS) - foreach(DEP ${${THIS_PROJECT_DEPENDS}}) - string(TOLOWER ${DEP} dep) - if (${dep} STREQUAL "serialization") - # TODO: Ugly, ugly hack until the serialization library is modularized - elseif (${dep} STREQUAL "thread") - else() - list(APPEND THIS_PROJECT_HEADER_DEPENDS ${dep}_headers) - endif() - endforeach(DEP) - - # Tell CPack about the headers component - fix_cpack_component_name(CPACK_COMPONENT_GROUP_NAME ${libname}) - cpack_add_component(${libname}_headers - DISPLAY_NAME "Header files" - GROUP ${CPACK_COMPONENT_GROUP_NAME} - DEPENDS ${THIS_PROJECT_HEADER_DEPENDS}) - endif () - endif () - -#-- This is here to debug the modularize code - set(modularize_debug FALSE) - if (modularize_debug) - set(modularize_output ${Boost_BINARY_DIR}) - set(modularize_libs_dir "modularize") - else (modularize_debug) - set(modularize_output ${Boost_SOURCE_DIR}) - set(modularize_libs_dir "libs") - endif(modularize_debug) - # Modularization code - if(THIS_PROJECT_HEADERS) - set(${LIBNAME}-modularize-commands) - foreach(item ${THIS_PROJECT_HEADERS}) - if(EXISTS "${Boost_SOURCE_DIR}/boost/${item}") - if(IS_DIRECTORY "${Boost_SOURCE_DIR}/boost/${item}") - list(APPEND ${LIBNAME}-modularize-commands - COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${Boost_SOURCE_DIR}/boost/${item}" - "${modularize_output}/${modularize_libs_dir}/${libname}/include/boost/${item}" - ) - if (NOT modularize_debug) - list(APPEND ${LIBNAME}-modularize-commands - COMMAND "${CMAKE_COMMAND}" -E remove_directory "${Boost_SOURCE_DIR}/boost/${item}" - ) - endif (NOT modularize_debug) - else(IS_DIRECTORY "${Boost_SOURCE_DIR}/boost/${item}") - list(APPEND ${LIBNAME}-modularize-commands - COMMAND "${CMAKE_COMMAND}" -E copy - "${Boost_SOURCE_DIR}/boost/${item}" - "${modularize_output}/${modularize_libs_dir}/${libname}/include/boost/${item}" - ) - if (NOT modularize_debug) - list(APPEND ${LIBNAME}-modularize-commands - COMMAND "${CMAKE_COMMAND}" -E remove "${Boost_SOURCE_DIR}/boost/${item}" - ) - endif (NOT modularize_debug) - - endif(IS_DIRECTORY "${Boost_SOURCE_DIR}/boost/${item}") - elseif(EXISTS "${Boost_SOURCE_DIR}/${modularize_libs_dir}/${libname}/include/boost/${item}") - # Okay; already modularized - else() - message(SEND_ERROR - "Header or directory boost/${item} does not exist. The HEADERS argument in ${Boost_SOURCE_DIR}/${modularize_libs_dir}/${libname}/CMakeLists.txt should be updated.") - endif() - endforeach(item) - - if (${LIBNAME}-modularize-commands) - set(${LIBNAME}-modularize-commands - # COMMAND "${CMAKE_COMMAND}" -E remove_directory "${modularize_output}/libs/${libname}/include" - COMMAND "${CMAKE_COMMAND}" -E make_directory - "${modularize_output}/${modularize_libs_dir}/${libname}/include/boost" - ${${LIBNAME}-modularize-commands} - ) - if (NOT modularize_debug) - set(${LIBNAME}-modularize-commands - COMMAND "${CMAKE_COMMAND}" -E remove_directory "${modularize_output}/${modularize_libs_dir}/${libname}/include" - ${${LIBNAME}-modularize-commands} - ) - endif (NOT modularize_debug) - add_custom_target(${LIBNAME}-modularize - ${${LIBNAME}-modularize-commands} - COMMENT "Modularizing ${LIBNAME} headers to project-local dir from monolithic boost dir" - ) - - if(THIS_PROJECT_MODULARIZED) - add_dependencies(modularize ${LIBNAME}-modularize) - endif(THIS_PROJECT_MODULARIZED) - endif() - endif(THIS_PROJECT_HEADERS) - - # For each of the modular libraries on which this project depends, - # add the include path for that library. - set(THIS_PROJECT_HAS_HEADER_DEPENDS FALSE) - foreach(DEP ${THIS_PROJECT_DEPENDS_ALL}) - include_directories("${modularize_output}/${modularize_libs_dir}/${DEP}/include") - endforeach(DEP) - - # TODO: is this still necessary? - if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/tests) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/tests) - endif(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/tests) - if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/tests/${PROJECT_NAME}) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/tests/${PROJECT_NAME}) - endif(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/tests/${PROJECT_NAME}) - - # Include each of the source directories - if(THIS_PROJECT_SRCDIRS) - foreach(SUBDIR ${THIS_PROJECT_SRCDIRS}) - add_subdirectory(${SUBDIR}) - endforeach(SUBDIR ${THIS_PROJECT_SRCDIRS}) - endif() - - if(BUILD_REGRESSION_TESTS AND THIS_PROJECT_TESTDIRS) - # Testing is enabled globally and this project has some - # tests. Check whether we should include these tests. - if (BOOST_TEST_LIBRARIES) - set(SAVED_TESTDIRS ${THIS_PROJECT_TESTDIRS}) - set(THIS_PROJECT_TESTDIRS) - foreach (TESTLIB ${BOOST_TEST_LIBRARIES}) - if (${TESTLIB} STREQUAL ${libname}) - # We are allowed to test this library; restore the set of - # test directories for this library. - set(THIS_PROJECT_TESTDIRS ${SAVED_TESTDIRS}) - endif() - endforeach () - endif() - - # Create a target -test, which will run all of - # this library's tests. - if (THIS_PROJECT_TESTDIRS) - add_custom_target(${PROJECT_NAME}-test - COMMAND ${CMAKE_CTEST_COMMAND} -R "^${PROJECT_NAME}-*" - MESSAGE "Running tests for Boost.${PROJECT_NAME}...") - endif () - - # Include the test directories. - foreach(SUBDIR ${THIS_PROJECT_TESTDIRS}) - add_subdirectory(${SUBDIR}) - endforeach() - endif() - - if (BUILD_DOCUMENTATION AND THIS_PROJECT_DOCDIRS) - foreach(SUBDIR ${THIS_PROJECT_DOCDIRS}) - add_subdirectory(${SUBDIR}) - endforeach(SUBDIR) - endif () - endif() -endmacro(boost_library_project) - -macro(boost_tool_project TOOLNAME) - parse_arguments(THIS_PROJECT - "DESCRIPTION;AUTHORS;MAINTAINERS" - "" - ${ARGN} - ) - - set(THIS_PROJECT_IS_TOOL TRUE) - - string(TOUPPER ${TOOLNAME} UTOOLNAME) - set(THIS_PROJECT_OKAY ON) - set(THIS_PROJECT_FAILED_DEPS "") - foreach(DEP ${BOOST_${UTOOLNAME}_DEPENDS}) - string(TOUPPER "BUILD_BOOST_${DEP}" BOOST_LIB_DEP) - if (NOT ${BOOST_LIB_DEP}) - set(THIS_PROJECT_OKAY OFF) - set(THIS_PROJECT_FAILED_DEPS "${THIS_PROJECT_FAILED_DEPS} ${DEP}\n") - endif (NOT ${BOOST_LIB_DEP}) - endforeach(DEP) - - option(BUILD_${UTOOLNAME} "Build ${TOOLNAME}" ON) - - if (NOT THIS_PROJECT_OKAY) - if (BUILD_${UTOOLNAME}) - # The user explicitly turned on this tool in a prior - # iteration, but it can no longer be built because one of the - # dependencies was turned off. Force this option off and - # complain about it. - set(BUILD_${UTOOLNAME} OFF CACHE BOOL "Build ${TOOLNAME}" FORCE) - message(SEND_ERROR "Cannot build ${TOOLNAME} due to missing library dependencies:\n${THIS_PROJECT_FAILED_DEPS}") - endif () - endif (NOT THIS_PROJECT_OKAY) - - if(BUILD_${UTOOLNAME} AND THIS_PROJECT_OKAY) - string(TOLOWER "${TOOLNAME}" toolname) - project(${TOOLNAME}) - - # Add this module's include directory - include_directories("${Boost_SOURCE_DIR}/libs/${toolname}/include") - - # For each of the modular libraries on which this project depends, - # add the include path for that library. - foreach(DEP ${BOOST_${UTOOLNAME}_DEPENDS}) - string(TOUPPER ${DEP} UDEP) - include_directories("${Boost_SOURCE_DIR}/libs/${DEP}/include") - endforeach(DEP) - endif() -endmacro(boost_tool_project) - -#TODO: Finish this documentation -# Defines dependencies of a boost project and testing targets. Use as: -# -# boost_module(libname -# DEPENDS srcdir1 srcdir2 ... -# TEST_DEPENDS testdir1 testdir2 ... -# -# Example: -# boost_library_project( -# Thread -# SRCDIRS src -# TESTDIRS test -# ) -macro(boost_module LIBNAME) - parse_arguments(THIS_MODULE - "DEPENDS" - "" - ${ARGN} - ) - - # Export BOOST_${LIBNAME}_DEPENDS - string(TOUPPER "BOOST_${LIBNAME}_DEPENDS" THIS_MODULE_LIBNAME_DEPENDS) - set(${THIS_MODULE_LIBNAME_DEPENDS} ${THIS_MODULE_DEPENDS}) - # - #message(STATUS "----------------------------------------------------------------") - #message(STATUS "LIBNAME: ${LIBNAME}") - #message(STATUS "THIS_MODULE_DEPENDS: ${THIS_MODULE_DEPENDS}") - #message(STATUS "THIS_MODULE_LIBNAME_DEPENDS: ${THIS_MODULE_LIBNAME_DEPENDS}") - #message(STATUS "${THIS_MODULE_LIBNAME_DEPENDS}: ${${THIS_MODULE_LIBNAME_DEPENDS}}") - #message(STATUS "THIS_MODULE_TEST_DEPENDS: ${THIS_MODULE_TEST_DEPENDS}") - #message(STATUS "THIS_MODULE_LIBNAME_TEST_DEPENDS: ${THIS_MODULE_LIBNAME_TEST_DEPENDS}") - #message(STATUS "${THIS_MODULE_LIBNAME_TEST_DEPENDS}: ${${THIS_MODULE_LIBNAME_TEST_DEPENDS}}") -endmacro(boost_module) - -# This macro is an internal utility macro that builds the name of a -# particular variant of a library -# -# boost_library_variant_target_name(feature1 feature2 ...) -# -# where feature1, feature2, etc. are the names of features to be -# included in this variant, e.g., MULTI_THREADED, DEBUG. -# -# This macro sets three macros: -# -# VARIANT_TARGET_NAME: The suffix that should be appended to the -# name of the library target to name this variant of the -# library. For example, this might be "-mt-static" for a static, -# multi-threaded variant. It should be used to name the CMake -# library target, e.g., boost_signals-mt-static. -# -# VARIANT_VERSIONED_NAME: The suffix that will be added to the name -# of the generated library, containing information about the -# particular version of the library and the toolset used to build -# this library. For example, this might be "-gcc41-mt-1_34" for the -# multi-threaded, release variant of the library in Boost 1.34.0 as -# compiled with GCC 4.1. If option BUILD_VERSIONED is OFF, this -# variable is set to the empty string. -# -# VARIANT_DISPLAY_NAME: The display name that describes this -# variant, e.g., "Debug, static, multi-threaded". -# -macro(boost_library_variant_target_name) - set(VARIANT_TARGET_NAME "") - - # The versioned name starts with the full Boost toolset - if(BUILD_VERSIONED) - set(VARIANT_VERSIONED_NAME "-${BOOST_TOOLSET}") - else(BUILD_VERSIONED) - set(VARIANT_VERSIONED_NAME "") - endif(BUILD_VERSIONED) - - # Add -mt for multi-threaded libraries - list_contains(VARIANT_IS_MT MULTI_THREADED ${ARGN}) - if (VARIANT_IS_MT) - set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-mt") - - # If we're creating versioned names, tack on "-mt" - set(VARIANT_VERSIONED_NAME "${VARIANT_VERSIONED_NAME}-mt") - endif (VARIANT_IS_MT) - - # Add -static for static libraries, -shared for shared libraries - list_contains(VARIANT_IS_STATIC STATIC ${ARGN}) - if (VARIANT_IS_STATIC) - set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-static") - set(VARIANT_DISPLAY_NAME "Static") - else (VARIANT_IS_STATIC) - set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-shared") - set(VARIANT_DISPLAY_NAME "Shared") - endif (VARIANT_IS_STATIC) - - # Add "multi-threaded" to the display name for multithreaded libraries. - if (VARIANT_IS_MT) - set(VARIANT_DISPLAY_NAME "${VARIANT_DISPLAY_NAME}, multi-threaded") - endif () - - # Compute the ABI tag, which depends on various kinds of options - set(VARIANT_ABI_TAG "") - - # Linking statically to the runtime library - list_contains(VARIANT_IS_STATIC_RUNTIME STATIC_RUNTIME ${ARGN}) - if (VARIANT_IS_STATIC_RUNTIME) - set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-staticrt") - set(VARIANT_ABI_TAG "${VARIANT_ABI_TAG}s") - set(VARIANT_DISPLAY_NAME "${VARIANT_DISPLAY_NAME}, static runtime") - endif (VARIANT_IS_STATIC_RUNTIME) - - # Using the debug version of the runtime library. - # With Visual C++, this comes automatically with debug - if (MSVC) - list_contains(VARIANT_IS_DEBUG DEBUG ${ARGN}) - if (VARIANT_IS_DEBUG) - set(VARIANT_ABI_TAG "${VARIANT_ABI_TAG}g") - endif (VARIANT_IS_DEBUG) - endif (MSVC) - - # Add -pydebug for debug builds of Python - list_contains(VARIANT_IS_PYDEBUG PYTHON_DEBUG ${ARGN}) - if (VARIANT_IS_PYDEBUG) - set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-pydebug") - set(VARIANT_ABI_TAG "${VARIANT_ABI_TAG}y") - set(VARIANT_DISPLAY_NAME "${VARIANT_DISPLAY_NAME}, Python debugging") - endif (VARIANT_IS_PYDEBUG) - - # TODO: STLport rather than default library - # TODO: STLport's deprecated iostreams - - # Add -debug for debug libraries - list_contains(VARIANT_IS_DEBUG DEBUG ${ARGN}) - if (VARIANT_IS_DEBUG) - # Only add the actual "-debug" if we're also building release libraries - if (BUILD_RELEASE) - set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-debug") - endif (BUILD_RELEASE) - set(VARIANT_ABI_TAG "${VARIANT_ABI_TAG}d") - - set(VARIANT_DISPLAY_NAME "${VARIANT_DISPLAY_NAME}, debug") - else() - set(VARIANT_DISPLAY_NAME "${VARIANT_DISPLAY_NAME}, release") - endif() - - # If there is an ABI tag, append it to the versioned name - if (VARIANT_ABI_TAG) - set(VARIANT_VERSIONED_NAME "${VARIANT_VERSIONED_NAME}-${VARIANT_ABI_TAG}") - endif (VARIANT_ABI_TAG) - - if(BUILD_VERSIONED) - # Append the Boost version number to the versioned name - if(BOOST_VERSION_SUBMINOR GREATER 0) - set(VARIANT_VERSIONED_NAME - "${VARIANT_VERSIONED_NAME}-${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}_${BOOST_VERSION_SUBMINOR}") - else(BOOST_VERSION_SUBMINOR GREATER 0) - set(VARIANT_VERSIONED_NAME - "${VARIANT_VERSIONED_NAME}-${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}") - endif(BOOST_VERSION_SUBMINOR GREATER 0) - endif(BUILD_VERSIONED) -endmacro(boost_library_variant_target_name) - -# This macro is an internal utility macro that updates compilation and -# linking flags based on interactions among the features in a variant. -# -# boost_feature_interactions(prefix -# feature1 feature2 ...) -# -# where "prefix" is the prefix of the compilation and linking flags -# that will be updated (e.g., ${prefix}_COMPILE_FLAGS). feature1, -# feature2, etc. are the names of the features used in this particular -# variant. If the features in this variant conflict, set -# ${prefix}_OKAY to FALSE. -macro(boost_feature_interactions PREFIX) - # Don't build or link against a shared library and a static run-time - list_contains(IS_SHARED SHARED ${ARGN}) - list_contains(IS_STATIC_RUNTIME STATIC_RUNTIME ${ARGN}) - if (IS_SHARED AND IS_STATIC_RUNTIME) - set(${PREFIX}_OKAY FALSE) - endif (IS_SHARED AND IS_STATIC_RUNTIME) - - # With Visual C++, the dynamic runtime is multi-threaded only - if (MSVC) - list_contains(IS_DYNAMIC_RUNTIME DYNAMIC_RUNTIME ${ARGN}) - list_contains(IS_SINGLE_THREADED SINGLE_THREADED ${ARGN}) - if (IS_DYNAMIC_RUNTIME AND IS_SINGLE_THREADED) - set(${PREFIX}_OKAY FALSE) - endif (IS_DYNAMIC_RUNTIME AND IS_SINGLE_THREADED) - endif (MSVC) - - # Visual C++-specific runtime library flags - if(MSVC) - list_contains(IS_STATIC_RUNTIME STATIC_RUNTIME ${ARGN}) - list_contains(IS_DEBUG DEBUG ${ARGN}) - if(IS_DEBUG) - if(IS_STATIC_RUNTIME) - set(${PREFIX}_COMPILE_FLAGS "/MTd ${${PREFIX}_COMPILE_FLAGS}") - else(IS_STATIC_RUNTIME) - set(${PREFIX}_COMPILE_FLAGS "/MDd ${${PREFIX}_COMPILE_FLAGS}") - endif(IS_STATIC_RUNTIME) - else(IS_DEBUG) - if(IS_STATIC_RUNTIME) - set(${PREFIX}_COMPILE_FLAGS "/MT ${${PREFIX}_COMPILE_FLAGS}") - else(IS_STATIC_RUNTIME) - set(${PREFIX}_COMPILE_FLAGS "/MD ${${PREFIX}_COMPILE_FLAGS}") - endif(IS_STATIC_RUNTIME) - endif(IS_DEBUG) - endif(MSVC) -endmacro(boost_feature_interactions) - -# This macro is an internal utility macro that builds a particular -# variant of a boost library. -# -# boost_library_variant(libname -# feature1 feature2 ...) -# -# where libname is the name of the Boost library (e.g., -# "boost_filesystem") and feature1, feature2, ... are the features -# that will be used in this variant. -# -# This macro will define a new library target based on libname and the -# specific variant name (see boost_library_variant_target_name), which -# depends on the utility target libname. The compilation and linking -# flags for this library are defined by THIS_LIB_COMPILE_FLAGS, -# THIS_LIB_LINK_FLAGS, THIS_LIB_LINK_LIBS, and all of the compile and -# linking flags implied by the features provided. -# -# If any of the features listed conflict with this library, no new -# targets will be built. For example, if the library provides the -# option NO_MULTI_THREADED, and one of the features provided is -# MULTI_THREADED, this macro will essentially be a no-op. -macro(boost_library_variant LIBNAME) - 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}) - # If the library itself stated that we cannot build this variant, - # don't. For example, we're trying to build a shared library - # variant, but the user specified NO_SHARED in the requirements of - # the library. - if (THIS_LIB_NO_${ARG}) - set(THIS_VARIANT_OKAY FALSE) - endif (THIS_LIB_NO_${ARG}) - - # If the user specified that we should not build any variants of - # this kind, don't. For example, if the BUILD_SHARED option is - # off, don't build shared libraries. - if(NOT BUILD_${ARG}) - set(THIS_VARIANT_OKAY FALSE) - endif(NOT BUILD_${ARG}) - - # Accumulate compile and link flags - set(THIS_VARIANT_COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS} ${THIS_LIB_${ARG}_COMPILE_FLAGS} ${${ARG}_COMPILE_FLAGS}") - set(THIS_VARIANT_LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS} ${THIS_LIB_${ARG}_LINK_FLAGS} ${${ARG}_LINK_FLAGS}") - set(THIS_VARIANT_LINK_LIBS ${THIS_VARIANT_LINK_LIBS} ${THIS_LIB_${ARG}_LINK_LIBS} ${${ARG}_LINK_LIBS}) - endforeach(ARG ${ARGN}) - - # Handle feature interactions - 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}") - - # We handle static vs. dynamic libraries differently - list_contains(THIS_LIB_IS_STATIC "STATIC" ${ARGN}) - if (THIS_LIB_IS_STATIC) - # On Windows, we need static and shared libraries to have - # different names, so we follow the Boost.Build version 2 style - # and prepend "lib" to the name. - if(WIN32 AND NOT CYGWIN) - set(LIBPREFIX "lib") - else(WIN32 AND NOT CYGWIN) - set(LIBPREFIX "") - endif(WIN32 AND NOT CYGWIN) - - # Add the library itself - add_library(${VARIANT_LIBNAME} STATIC ${THIS_LIB_SOURCES}) - - # Set properties on this library - set_target_properties(${VARIANT_LIBNAME} - PROPERTIES - OUTPUT_NAME "${LIBPREFIX}${LIBNAME}${VARIANT_VERSIONED_NAME}" - CLEAN_DIRECT_OUTPUT 1 - COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}" - LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}" - LABELS "${PROJECT_NAME}" - ) - elseif (THIS_LIB_MODULE) - # Add a module - add_library(${VARIANT_LIBNAME} MODULE ${THIS_LIB_SOURCES}) - - # Set properties on this library - set_target_properties(${VARIANT_LIBNAME} - PROPERTIES - OUTPUT_NAME ${LIBNAME} - CLEAN_DIRECT_OUTPUT 1 - COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}" - LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}" - LABELS "${PROJECT_NAME}" - PREFIX "" - # 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 - OUTPUT_NAME "${LIBNAME}${VARIANT_VERSIONED_NAME}" - CLEAN_DIRECT_OUTPUT 1 - COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}" - LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}" - LABELS "${PROJECT_NAME}" - # SOVERSION "${BOOST_VERSION}" - ) - endif (THIS_LIB_IS_STATIC) - - # The basic LIBNAME target depends on each of the variants - add_dependencies(${LIBNAME} ${VARIANT_LIBNAME}) - - export(TARGETS ${VARIANT_LIBNAME} FILE ${CMAKE_BINARY_DIR}/exports/${VARIANT_LIBNAME}.cmake) - - # Link against whatever libraries this library depends on - target_link_libraries(${VARIANT_LIBNAME} ${THIS_VARIANT_LINK_LIBS}) - foreach(dependency ${THIS_LIB_DEPENDS}) - target_link_libraries(${VARIANT_LIBNAME} "${dependency}${VARIANT_TARGET_NAME}") - endforeach(dependency) - - if(NOT THIS_LIB_NO_INSTALL) - # Setup installation properties - string(TOLOWER "${PROJECT_NAME}${VARIANT_TARGET_NAME}" LIB_COMPONENT) - string(REPLACE "-" "_" LIB_COMPONENT ${LIB_COMPONENT}) - - # Installation of this library variant - 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}) - - # 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 - TARGET "${DEP}${VARIANT_TARGET_NAME}" - PROPERTY BOOST_CPACK_COMPONENT) - - if (DEP_COMPONENT) - if (DEP_COMPONENT STREQUAL LIB_COMPONENT) - # Do nothing: we have library dependencies within one - # Boost library - else() - list(APPEND THIS_LIB_COMPONENT_DEPENDS ${DEP_COMPONENT}) - endif() - endif() - endforeach(DEP) - - if (COMMAND cpack_add_component) - fix_cpack_component_name(CPACK_COMPONENT_GROUP_NAME ${libname}) - cpack_add_component(${LIB_COMPONENT} - DISPLAY_NAME "${VARIANT_DISPLAY_NAME}" - GROUP ${CPACK_COMPONENT_GROUP_NAME} - DEPENDS ${THIS_LIB_COMPONENT_DEPENDS}) - endif () - endif(NOT THIS_LIB_NO_INSTALL) - endif () -endmacro(boost_library_variant) - -# Updates the set of default build variants to account for variations -# in the given feature. -# -# boost_add_default_variant(feature-val1 feature-val2 ...) -# -# Each new feature creates a new set of build variants using that -# feature. For example, writing: -# -# boost_add_default_variant(SINGLE_THREADED MULTI_THREADED) -# -# will create single- and multi-threaded variants of every default -# library variant already defined, doubling the number of variants -# that will be built. See the top-level CMakeLists.txt for the set of -# default variants. -# -# Variables affected: -# -# BOOST_DEFAULT_VARIANTS: -# This variable describes all of the variants that will be built -# by default, and will be updated with each invocation of -# boost_add_default_variant. The variable itself is a list, where -# each element in the list contains a colon-separated string -# naming a specific set of features for that variant, e.g., -# STATIC:DEBUG:SINGLE_THREADED. -# -# BOOST_FEATURES: -# This variable describes all of the feature sets that we know about, -# and will be extended each time ither boost_add_default_variant or -# boost_add_extra_variant is invoked. This macro will contain a list -# of feature sets, each containing the values for a given feature -# separated by colons, e.g., "DEBUG:RELEASE". -# -# BOOST_ADD_ARG_NAMES: -# This variable describes all of the feature-specific arguments -# that can be used for the boost_add_library macro, separated by -# semicolons. For example, given the use of -# boost_add_default_variant above, this variable will contain (at -# least) -# -# SINGLE_THREADED_COMPILE_FLAGS;SINGLE_THREADED_LINK_FLAGS; -# MULTI_THREADED_COMPILE_FLAGS;MULTI_THREADED_LINK_FLAGS -# -# When this variable is used in boost_add_library, it turns these -# names into feature-specific options. For example, -# MULTI_THREADED_COMPILE_FLAGS provides extra compile flags to be -# used only for multi-threaded variants of the library. -# -# BOOST_ADDLIB_OPTION_NAMES: -# Like BOOST_ADD_ARG_NAMES, this variable describes -# feature-specific options to boost_add_library that can be used to -# turn off building of the library when the variant would require -# certain features. For example, the NO_SINGLE_THREADED option -# turns off building of single-threaded variants for a library. -# -# BOOST_ADDEXE_OPTION_NAMES: -# Like BOOST_ADDLIB_OPTION_NAMES, except that that variable -# describes options to boost_add_executable that can be used to -# describe which features are needed to build the executable. -# For example, the MULTI_THREADED option requires that the -# executable be built against multi-threaded libraries and with -# multi-threaded options. -macro(boost_add_default_variant) - # Update BOOST_DEFAULT_VARIANTS - if (BOOST_DEFAULT_VARIANTS) - set(BOOST_DEFAULT_VARIANTS_ORIG ${BOOST_DEFAULT_VARIANTS}) - set(BOOST_DEFAULT_VARIANTS) - foreach(VARIANT ${BOOST_DEFAULT_VARIANTS_ORIG}) - foreach(FEATURE ${ARGN}) - list(APPEND BOOST_DEFAULT_VARIANTS "${VARIANT}:${FEATURE}") - endforeach(FEATURE ${ARGN}) - endforeach(VARIANT ${BOOST_DEFAULT_VARIANTS_ORIG}) - set(BOOST_DEFAULT_VARIANTS_ORIG) - else (BOOST_DEFAULT_VARIANTS) - set(BOOST_DEFAULT_VARIANTS ${ARGN}) - endif (BOOST_DEFAULT_VARIANTS) - - # Set Feature flag options used by the boost_library macro and the - # BOOST_FEATURES variable - set(BOOST_DEFVAR_FEATURES) - foreach(FEATURE ${ARGN}) - set(BOOST_ADD_ARG_NAMES - "${BOOST_ADD_ARG_NAMES};${FEATURE}_COMPILE_FLAGS;${FEATURE}_LINK_FLAGS;${FEATURE}_LINK_LIBS") - set(BOOST_ADDLIB_OPTION_NAMES "${BOOST_ADDLIB_OPTION_NAMES};NO_${FEATURE}") - set(BOOST_ADDEXE_OPTION_NAMES "${BOOST_ADDEXE_OPTION_NAMES};${FEATURE}") - if (BOOST_DEFVAR_FEATURES) - set(BOOST_DEFVAR_FEATURES "${BOOST_DEFVAR_FEATURES}:${FEATURE}") - else (BOOST_DEFVAR_FEATURES) - set(BOOST_DEFVAR_FEATURES "${FEATURE}") - endif (BOOST_DEFVAR_FEATURES) - endforeach(FEATURE ${ARGN}) - list(APPEND BOOST_FEATURES ${BOOST_DEFVAR_FEATURES}) -endmacro(boost_add_default_variant) - -# Updates the set of "extra" build variants, which may be used to -# generate extra, library-specific variants of libraries. -# -# boost_add_extra_variant(feature-val1 feature-val2 ...) -# -# Each extra viarant makes it possible for libraries to define extra -# variants. For example, writing: -# -# boost_add_extra_variant(PYTHON_NODEBUG PYTHON_DEBUG) -# -# creates a PYTHON_NODEBUG/PYTHON_DEBUG feature pair as an extra -# variant, used by the Boost.Python library, which generates separate -# variants of the Boost.Python library: one variant uses the Python -# debug libraries, the other does not. -# -# The difference between boost_add_default_variant and -# 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 libraries to specifically -# request extra variants using that feature. -# -# Variables affected: -# -# BOOST_FEATURES: -# See boost_add_default_variant. -# -# BOOST_ADD_ARG_NAMES: -# See boost_add_default_variant. -# -# BOOST_ADDLIB_OPTION_NAMES: -# See boost_add_default_variant. -# -# BOOST_ADDEXE_OPTION_NAMES: -# See boost_add_default_variant. -macro(boost_add_extra_variant) - set(BOOST_EXTVAR_FEATURES) - foreach(FEATURE ${ARGN}) - set(BOOST_ADD_ARG_NAMES - "${BOOST_ADD_ARG_NAMES};${FEATURE}_COMPILE_FLAGS;${FEATURE}_LINK_FLAGS;${FEATURE}_LINK_LIBS") - set(BOOST_ADDLIB_OPTION_NAMES "${BOOST_ADDLIB_OPTION_NAMES};NO_${FEATURE}") - set(BOOST_ADDEXE_OPTION_NAMES "${BOOST_ADDEXE_OPTION_NAMES};${FEATURE}") - if (BOOST_EXTVAR_FEATURES) - set(BOOST_EXTVAR_FEATURES "${BOOST_EXTVAR_FEATURES}:${FEATURE}") - else (BOOST_EXTVAR_FEATURES) - set(BOOST_EXTVAR_FEATURES "${FEATURE}") - endif (BOOST_EXTVAR_FEATURES) - endforeach(FEATURE ${ARGN}) - list(APPEND BOOST_FEATURES ${BOOST_EXTVAR_FEATURES}) -endmacro(boost_add_extra_variant) - -# Compute the variant that will be used to build this executable or -# module, taking into account both the requested features passed to -# boost_add_executable or boost_add_library and what options the user -# has set. -macro(boost_select_variant NAME PREFIX) - set(${PREFIX}_DEBUG_AND_RELEASE FALSE) - set(SELECT_VARIANT_OKAY TRUE) - set(${PREFIX}_VARIANT) - - foreach(FEATURESET_STR ${BOOST_FEATURES}) - string(REPLACE ":" ";" FEATURESET ${FEATURESET_STR}) - separate_arguments(FEATURESET) - set(${PREFIX}_REQUESTED_FROM_SET FALSE) - foreach (FEATURE ${FEATURESET}) - if (${PREFIX}_${FEATURE}) - # Make this feature part of the variant - list(APPEND ${PREFIX}_VARIANT ${FEATURE}) - set(${PREFIX}_REQUESTED_FROM_SET TRUE) - - # The caller has requested this particular feature be used - # when building the executable or module. If we can't satisfy - # that request (because the user has turned off the build - # variants with that feature), then we won't build this - # executable or module. - if (NOT BUILD_${FEATURE}) - set(SELECT_VARIANT_OKAY FALSE) - message(STATUS "* ${NAME} is NOT being built because BUILD_${FEATURE} is FALSE") - endif (NOT BUILD_${FEATURE}) - endif (${PREFIX}_${FEATURE}) - endforeach (FEATURE ${FEATURESET}) - - if (NOT ${PREFIX}_REQUESTED_FROM_SET) - # The caller did not specify which feature value to use from - # this set, so find the first feature value that actually works. - set(${PREFIX}_FOUND_FEATURE FALSE) - - # If this feature set decides between Release and Debug, we - # either query CMAKE_BUILD_TYPE to determine which to use (for - # makefile targets) or handle both variants separately (for IDE - # targets). We only build both variants separately for executable targets. - if (FEATURESET_STR STREQUAL "RELEASE:DEBUG") - if (CMAKE_CONFIGURATION_TYPES) - # IDE target: can we build both debug and release? - if (BUILD_DEBUG AND BUILD_RELEASE) - if (${PREFIX} STREQUAL "THIS_EXE") - # Remember that we're capable of building both configurations - set(${PREFIX}_DEBUG_AND_RELEASE TRUE) - - # Don't add RELEASE or DEBUG to the variant (yet) - set(${PREFIX}_FOUND_FEATURE TRUE) - endif () - endif () - else (CMAKE_CONFIGURATION_TYPES) - # Makefile target: CMAKE_BUILD_TYPE tells us which variant to build - if (CMAKE_BUILD_TYPE STREQUAL "Release") - # Okay, build the release variant - list(APPEND ${PREFIX}_VARIANT RELEASE) - set(${PREFIX}_FOUND_FEATURE TRUE) - elseif (CMAKE_BUILD_TYPE STREQUAL "Debug") - # Okay, build the debug variant - list(APPEND ${PREFIX}_VARIANT DEBUG) - set(${PREFIX}_FOUND_FEATURE TRUE) - endif (CMAKE_BUILD_TYPE STREQUAL "Release") - endif (CMAKE_CONFIGURATION_TYPES) - endif (FEATURESET_STR STREQUAL "RELEASE:DEBUG") - - # Search through all of the features in the set to find one that works - foreach (FEATURE ${FEATURESET}) - # We only care about the first feature value we find... - if (NOT ${PREFIX}_FOUND_FEATURE) - # Are we allowed to build this feature? - if (BUILD_${FEATURE}) - # Found it: we're done - list(APPEND ${PREFIX}_VARIANT ${FEATURE}) - set(${PREFIX}_FOUND_FEATURE TRUE) - endif (BUILD_${FEATURE}) - endif (NOT ${PREFIX}_FOUND_FEATURE) - endforeach (FEATURE ${FEATURESET}) - - if (NOT ${PREFIX}_FOUND_FEATURE) - # All of the features in this set were turned off. - # Just don't build anything. - set(SELECT_VARIANT_OKAY FALSE) - endif (NOT ${PREFIX}_FOUND_FEATURE) - endif (NOT ${PREFIX}_REQUESTED_FROM_SET) - endforeach(FEATURESET_STR ${BOOST_FEATURES}) - - # Propagate flags from each of the features - if (SELECT_VARIANT_OKAY) - foreach (FEATURE ${${PREFIX}_VARIANT}) - # Add all of the flags for this feature - set(${PREFIX}_COMPILE_FLAGS - "${${PREFIX}_COMPILE_FLAGS} ${${PREFIX}_${FEATURE}_COMPILE_FLAGS} ${${FEATURE}_COMPILE_FLAGS}") - set(${PREFIX}_LINK_FLAGS - "${${PREFIX}_LINK_FLAGS} ${${PREFIX}_${FEATURE}_LINK_FLAGS} ${${FEATURE}_LINK_FLAGS}") - if (${PREFIX} STREQUAL "THIS_EXE") - set(${PREFIX}_LINK_FLAGS - "${${PREFIX}_LINK_FLAGS} ${${FEATURE}_EXE_LINK_FLAGS}") - endif() - set(${PREFIX}_LINK_LIBS - ${${PREFIX}_LINK_LIBS} ${${PREFIX}_${FEATURE}_LINK_LIBS} ${${FEATURE}_LINK_LIBS}) - endforeach (FEATURE ${${PREFIX}_VARIANT}) - - # Handle feature interactions - boost_feature_interactions("${PREFIX}" ${${PREFIX}_VARIANT}) - else () - set(${PREFIX}_VARIANT) - endif () -endmacro(boost_select_variant) - -# Creates a new Boost library target that generates a compiled library -# (.a, .lib, .dll, .so, etc) from source files. This routine will -# actually build several different variants of the same library, with -# different compilation options, as determined by the set of "default" -# library variants. -# -# boost_add_library(libname -# source1 source2 ... -# [COMPILE_FLAGS compileflags] -# [feature_COMPILE_FLAGS compileflags] -# [LINK_FLAGS linkflags] -# [feature_LINK_FLAGS linkflags] -# [LINK_LIBS linklibs] -# [feature_LINK_LIBS linklibs] -# [DEPENDS libdepend1 libdepend2 ...] -# [MODULE] -# [NO_feature] -# [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 -# to build the library, e.g., cregex.cpp. -# -# This macro has a variety of options that affect its behavior. In -# several cases, we use the placeholder "feature" in the option name -# to indicate that there are actually several different kinds of -# options, each referring to a different build feature, e.g., shared -# libraries, multi-threaded, debug build, etc. For a complete listing -# of these features, please refer to the CMakeLists.txt file in the -# root of the Boost distribution, which defines the set of features -# that will be used to build Boost libraries by default. -# -# The options that affect this macro's behavior are: -# -# COMPILE_FLAGS: Provides additional compilation flags that will be -# used when building all variants of the library. For example, one -# might want to add "-DBOOST_SIGNALS_NO_LIB=1" through this option -# (which turns off auto-linking for the Signals library while -# building it). -# -# feature_COMPILE_FLAGS: Provides additional compilation flags that -# will be used only when building variants of the library that -# include the given feature. For example, -# MULTI_THREADED_COMPILE_FLAGS are additional flags that will be -# used when building a multi-threaded variant, while -# SHARED_COMPILE_FLAGS will be used when building a shared library -# (as opposed to a static library). -# -# LINK_FLAGS: Provides additional flags that will be passed to the -# linker when linking each variant of the library. This option -# should not be used to link in additional libraries; see LINK_LIBS -# and DEPENDS. -# -# feature_LINK_FLAGS: Provides additional flags that will be passed -# to the linker when building variants of the library that contain a -# specific feature, e.g., MULTI_THREADED_LINK_FLAGS. This option -# should not be used to link in additional libraries; see -# feature_LINK_LIBS. -# -# LINK_LIBS: Provides additional libraries against which each of the -# library variants will be linked. For example, one might provide -# "expat" as options to LINK_LIBS, to state that each of the library -# variants will link against the expat library binary. Use LINK_LIBS -# for libraries external to Boost; for Boost libraries, use DEPENDS. -# -# feature_LINK_LIBS: Provides additional libraries for specific -# variants of the library to link against. For example, -# MULTI_THREADED_LINK_LIBS provides extra libraries to link into -# multi-threaded variants of the library. -# -# DEPENDS: States that this Boost library depends on and links -# against another Boost library. The arguments to DEPENDS should be -# the unversioned name of the Boost library, such as -# "boost_filesystem". Like LINK_LIBS, this option states that all -# variants of the library being built will link against the stated -# libraries. Unlike LINK_LIBS, however, DEPENDS takes particular -# library variants into account, always linking the variant of one -# Boost library against the same variant of the other Boost -# library. For example, if the boost_mpi_python library DEPENDS on -# boost_python, multi-threaded variants of boost_mpi_python will -# link against multi-threaded variants of boost_python. -# -# MODULE: This option states that, when building a shared library, -# the shared library should be built as a module rather than a -# normal shared library. Modules have special meaning an behavior on -# some platforms, such as Mac OS X. -# -# NOT_feature: States that library variants containing a particular -# feature should not be built. For example, passing -# NOT_SINGLE_THREADED suppresses generation of single-threaded -# variants of this library. -# -# EXTRA_VARIANTS: Specifies that extra variants of this library -# should be built, based on the features listed. Each "variant" is a -# colon-separated list of features. For example, passing -# EXTRA_VARIANTS "PYTHON_NODEBUG:PYTHON_DEBUG" -# will result in the creation of an extra set of library variants, -# 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 -# barrier.cpp condition.cpp exceptions.cpp mutex.cpp once.cpp -# recursive_mutex.cpp thread.cpp tss_hooks.cpp tss_dll.cpp tss_pe.cpp -# tss.cpp xtime.cpp -# SHARED_COMPILE_FLAGS "-DBOOST_THREAD_BUILD_DLL=1" -# STATIC_COMPILE_FLAGS "-DBOOST_THREAD_BUILD_LIB=1" -# NOT_SINGLE_THREADED -# ) -macro(boost_add_library LIBNAME) - parse_arguments(THIS_LIB - "DEPENDS;COMPILE_FLAGS;LINK_FLAGS;LINK_LIBS;EXTRA_VARIANTS;FORCE_VARIANTS;${BOOST_ADD_ARG_NAMES}" - "MODULE;NO_INSTALL;${BOOST_ADDLIB_OPTION_NAMES}" - ${ARGN} - ) - set(THIS_LIB_SOURCES ${THIS_LIB_DEFAULT_ARGS}) - - if (NOT TEST_INSTALLED_TREE) - # A top-level target that refers to all of the variants of the - # library, collectively. - add_custom_target(${LIBNAME}) - - if (THIS_LIB_EXTRA_VARIANTS) - # Build the set of variants that we will generate for this library - set(THIS_LIB_VARIANTS) - foreach(VARIANT ${BOOST_DEFAULT_VARIANTS}) - foreach(EXTRA_VARIANT ${THIS_LIB_EXTRA_VARIANTS}) - string(REPLACE ":" ";" FEATURES "${EXTRA_VARIANT}") - separate_arguments(FEATURES) - foreach(FEATURE ${FEATURES}) - list(APPEND THIS_LIB_VARIANTS "${VARIANT}:${FEATURE}") - endforeach(FEATURE ${FEATURES}) - endforeach(EXTRA_VARIANT ${THIS_LIB_EXTRA_VARIANTS}) - endforeach(VARIANT ${BOOST_DEFAULT_VARIANTS}) - else (THIS_LIB_EXTRA_VARIANTS) - 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}) - separate_arguments(VARIANT) - 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) - -# Like boost_add_library, but builds a single library variant -# FIXME: I'm not sure if I like this or not. Document it if it survives. -macro(boost_add_single_library LIBNAME) - parse_arguments(THIS_LIB - "DEPENDS;COMPILE_FLAGS;LINK_FLAGS;LINK_LIBS;${BOOST_ADD_ARG_NAMES}" - "NO_INSTALL;MODULE;${BOOST_ADDEXE_OPTION_NAMES}" - ${ARGN} - ) - set(THIS_LIB_SOURCES ${THIS_LIB_DEFAULT_ARGS}) - - if (NOT TEST_INSTALLED_TREE) - boost_select_variant(${LIBNAME} THIS_LIB) - if (THIS_LIB_VARIANT) - add_custom_target(${LIBNAME}) - separate_arguments(THIS_LIB_VARIANT) - boost_library_variant(${LIBNAME} ${THIS_LIB_VARIANT}) - endif () - endif (NOT TEST_INSTALLED_TREE) -endmacro(boost_add_single_library) - -# Creates a new executable from source files. -# -# boost_add_executable(exename -# source1 source2 ... -# [COMPILE_FLAGS compileflags] -# [feature_COMPILE_FLAGS compileflags] -# [LINK_FLAGS linkflags] -# [feature_LINK_FLAGS linkflags] -# [LINK_LIBS linklibs] -# [feature_LINK_LIBS linklibs] -# [DEPENDS libdepend1 libdepend2 ...] -# [feature] -# [NO_INSTALL]) -# -# where exename is the name of the executable (e.g., "wave"). source1, -# source2, etc. are the source files used to build the executable, e.g., -# cpp.cpp. If no source files are provided, "exename.cpp" will be -# used. -# -# This macro has a variety of options that affect its behavior. In -# several cases, we use the placeholder "feature" in the option name -# to indicate that there are actually several different kinds of -# options, each referring to a different build feature, e.g., shared -# libraries, multi-threaded, debug build, etc. For a complete listing -# of these features, please refer to the CMakeLists.txt file in the -# root of the Boost distribution, which defines the set of features -# that will be used to build Boost libraries by default. -# -# The options that affect this macro's behavior are: -# -# COMPILE_FLAGS: Provides additional compilation flags that will be -# used when building the executable. -# -# feature_COMPILE_FLAGS: Provides additional compilation flags that -# will be used only when building the executable with the given -# feature (e.g., SHARED_COMPILE_FLAGS when we're linking against -# shared libraries). Note that the set of features used to build the -# executable depends both on the arguments given to -# boost_add_executable (see the "feature" argument description, -# below) and on the user's choice of variants to build. -# -# LINK_FLAGS: Provides additional flags that will be passed to the -# linker when linking the executable. This option should not be used -# to link in additional libraries; see LINK_LIBS and DEPENDS. -# -# feature_LINK_FLAGS: Provides additional flags that will be passed -# to the linker when linking the executable with the given feature -# (e.g., MULTI_THREADED_LINK_FLAGS when we're linking a -# multi-threaded executable). -# -# LINK_LIBS: Provides additional libraries against which the -# executable will be linked. For example, one might provide "expat" -# as options to LINK_LIBS, to state that the executable will link -# against the expat library binary. Use LINK_LIBS for libraries -# external to Boost; for Boost libraries, use DEPENDS. -# -# feature_LINK_LIBS: Provides additional libraries to link against -# when linking an executable built with the given feature. -# -# DEPENDS: States that this executable depends on and links against -# a Boostlibrary. The arguments to DEPENDS should be the unversioned -# name of the Boost library, such as "boost_filesystem". Like -# LINK_LIBS, this option states that the executable will link -# against the stated libraries. Unlike LINK_LIBS, however, DEPENDS -# takes particular library variants into account, always linking to -# the appropriate variant of a Boost library. For example, if the -# MULTI_THREADED feature was requested in the call to -# boost_add_executable, DEPENDS will ensure that we only link -# against multi-threaded libraries. -# -# feature: States that the executable should always be built using a -# given feature, e.g., SHARED linking (against its libraries) or -# MULTI_THREADED (for multi-threaded builds). If that feature has -# been turned off by the user, the executable will not build. -# -# NO_INSTALL: Don't install this executable with the rest of Boost. -# -# OUTPUT_NAME: If you want the executable to be generated somewhere -# other than the binary directory, pass the path (including -# directory and file name) via the OUTPUT_NAME parameter. -# -# Example: -# boost_add_executable(wave cpp.cpp -# DEPENDS boost_wave boost_program_options boost_filesystem -# boost_serialization -# ) -macro(boost_add_executable EXENAME) - # Note: ARGS is here to support the use of boost_add_executable in - # the testing code. - parse_arguments(THIS_EXE - "DEPENDS;COMPILE_FLAGS;LINK_FLAGS;LINK_LIBS;OUTPUT_NAME;ARGS;${BOOST_ADD_ARG_NAMES}" - "NO_INSTALL;${BOOST_ADDEXE_OPTION_NAMES}" - ${ARGN} - ) - - # Determine the list of sources - if (THIS_EXE_DEFAULT_ARGS) - set(THIS_EXE_SOURCES ${THIS_EXE_DEFAULT_ARGS}) - else (THIS_EXE_DEFAULT_ARGS) - set(THIS_EXE_SOURCES ${EXENAME}.cpp) - endif (THIS_EXE_DEFAULT_ARGS) - - # Whether we can build both debug and release versions of this - # executable within an IDE (based on the selected configuration - # type). - set(THIS_EXE_DEBUG_AND_RELEASE FALSE) - - # Compute the variant that will be used to build this executable, - # taking into account both the requested features passed to - # boost_add_executable and what options the user has set. - boost_select_variant(${EXENAME} THIS_EXE) - - set(THIS_EXE_OKAY FALSE) - if (THIS_EXE_VARIANT) - # It's okay to build this executable - set(THIS_EXE_OKAY TRUE) - - # Compute the name of the variant targets that we'll be linking - # against. We'll use this to link against the appropriate - # dependencies. For IDE targets where we can build both debug and - # release configurations, create DEBUG_ and RELEASE_ versions of - # the macros. - if (THIS_EXE_DEBUG_AND_RELEASE) - boost_library_variant_target_name(RELEASE ${THIS_EXE_VARIANT}) - set(RELEASE_VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}") - boost_library_variant_target_name(DEBUG ${THIS_EXE_VARIANT}) - set(DEBUG_VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}") - else (THIS_EXE_DEBUG_AND_RELEASE) - boost_library_variant_target_name(${THIS_EXE_VARIANT}) - endif (THIS_EXE_DEBUG_AND_RELEASE) - - # Compute the actual set of library dependencies, based on the - # variant name we computed above. The RELEASE and DEBUG versions - # only apply when THIS_EXE_DEBUG_AND_RELEASE. - set(THIS_EXE_ACTUAL_DEPENDS) - set(THIS_EXE_RELEASE_ACTUAL_DEPENDS) - set(THIS_EXE_DEBUG_ACTUAL_DEPENDS) - foreach(LIB ${THIS_EXE_DEPENDS}) - if (LIB MATCHES ".*-.*") - # The user tried to state exactly which variant to use. Just - # propagate the dependency and hope that s/he was - # right. Eventually, this should at least warn, because it is - # not the "proper" way to do things - list(APPEND THIS_EXE_ACTUAL_DEPENDS ${LIB}) - list(APPEND THIS_EXE_RELEASE_ACTUAL_DEPENDS ${LIB}) - list(APPEND THIS_EXE_DEBUG_ACTUAL_DEPENDS ${LIB}) - else (LIB MATCHES ".*-.*") - # The user has given the name of just the library target, - # e.g., "boost_filesystem". We add on the appropriate variant - # name(s). - list(APPEND THIS_EXE_ACTUAL_DEPENDS "${LIB}${VARIANT_TARGET_NAME}") - list(APPEND THIS_EXE_RELEASE_ACTUAL_DEPENDS "${LIB}${RELEASE_VARIANT_TARGET_NAME}") - list(APPEND THIS_EXE_DEBUG_ACTUAL_DEPENDS "${LIB}${DEBUG_VARIANT_TARGET_NAME}") - endif (LIB MATCHES ".*-.*") - endforeach(LIB ${THIS_EXE_DEPENDS}) - - # Build the executable - if (THIS_PROJECT_IS_TOOL) - set(THIS_EXE_NAME ${EXENAME}) - else() - set(THIS_EXE_NAME ${PROJECT_NAME}-${EXENAME}) - endif() - add_executable(${THIS_EXE_NAME} ${THIS_EXE_SOURCES}) - - # Set the various compilation and linking flags - set_target_properties(${THIS_EXE_NAME} - PROPERTIES - COMPILE_FLAGS "${THIS_EXE_COMPILE_FLAGS}" - LINK_FLAGS "${THIS_EXE_LINK_FLAGS}" - LABELS "${PROJECT_NAME}" - ) - - # For IDE generators where we can build both debug and release - # configurations, pass the configurations along separately. - if (THIS_EXE_DEBUG_AND_RELEASE) - set_target_properties(${THIS_EXE_NAME} - 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} ${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) - - # If the user gave an output name, use it. - if(THIS_EXE_OUTPUT_NAME) - set_target_properties(${THIS_EXE_NAME} - PROPERTIES - OUTPUT_NAME ${THIS_EXE_OUTPUT_NAME} - ) - endif() - - # Link against the various libraries - if (THIS_EXE_DEBUG_AND_RELEASE) - # Configuration-agnostic libraries - target_link_libraries(${THIS_EXE_NAME} ${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(${THIS_EXE_NAME} 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(${THIS_EXE_NAME} debug ${LIB}) - endforeach(LIB ${THIS_EXE_DEBUG_ACTUAL_DEPENDS} ${THIS_EXE_DEBUG_LINK_LIBS}) - else (THIS_EXE_DEBUG_AND_RELEASE) - target_link_libraries(${THIS_EXE_NAME} - ${THIS_EXE_ACTUAL_DEPENDS} - ${THIS_EXE_LINK_LIBS}) - endif (THIS_EXE_DEBUG_AND_RELEASE) - - # Install the executable, if not suppressed - if (NOT THIS_EXE_NO_INSTALL) - install(TARGETS ${THIS_EXE_NAME} DESTINATION bin) - endif (NOT THIS_EXE_NO_INSTALL) - endif () -endmacro(boost_add_executable) diff --git a/CMake/BoostDocs.cmake b/CMake/BoostDocs.cmake deleted file mode 100644 index 034108f3c..000000000 --- a/CMake/BoostDocs.cmake +++ /dev/null @@ -1,534 +0,0 @@ -########################################################################## -# Boost Documentation Generation # -########################################################################## -# Copyright (C) 2008 Douglas Gregor # -# # -# Distributed under the Boost Software License, Version 1.0. # -# See accompanying file LICENSE_1_0.txt or copy at # -# http://www.boost.org/LICENSE_1_0.txt # -########################################################################## -# Important developer macros in this file: # -# # -########################################################################## - -# Transforms the source XML file by applying the given XSL stylesheet. -# -# xsl_transform(output input [input2 input3 ...] -# STYLESHEET stylesheet -# [CATALOG catalog] -# [DIRECTORY mainfile] -# [PARAMETERS param1=value1 param2=value2 ...] -# [[MAKE_ALL_TARGET | MAKE_TARGET] target] -# [COMMENT comment]) -# -# This macro builds a custom command that transforms an XML file -# (input) via the given XSL stylesheet. The output will either be a -# single file (the default) or a directory (if the DIRECTION argument -# is specified). The STYLESBEET stylesheet must be a valid XSL -# stylesheet. Any extra input files will be used as additional -# dependencies for the target. For example, these extra input files -# might refer to other XML files that are included by the input file -# through XInclude. -# -# When the XSL transform output is going to a directory, the mainfile -# argument provides the name of a file that will be generated within -# the output directory. This file will be used for dependency tracking. -# -# XML catalogs can be used to remap parts of URIs within the -# stylesheet to other (typically local) entities. To provide an XML -# catalog file, specify the name of the XML catalog file via the -# CATALOG argument. It will be provided to the XSL transform. -# -# The PARAMETERS argument is followed by param=value pairs that set -# additional parameters to the XSL stylesheet. The parameter names -# that can be used correspond to the elements within the -# stylesheet. -# -# To associate a target name with the result of the XSL -# transformation, use the MAKE_TARGET or MAKE_ALL_TARGET option and -# provide the name of the target. The MAKE_ALL_TARGET option only -# differs from MAKE_TARGET in that MAKE_ALL_TARGET will make the -# resulting target a part of the default build. -# -# If a COMMENT argument is provided, it will be used as the comment -# CMake provides when running this XSL transformation. Otherwise, the -# comment will be "Generating "output" via XSL transformation...". -macro(xsl_transform OUTPUT INPUT) - parse_arguments(THIS_XSL - "STYLESHEET;CATALOG;MAKE_ALL_TARGET;MAKE_TARGET;PARAMETERS;DIRECTORY;COMMENT" - "" - ${ARGN} - ) - - # TODO: Is this the best way to handle catalogs? The alternative is - # that we could provide explicit remappings to the xsl_transform - # macro, and it could generate a temporary XML catalog file. - if (THIS_XSL_CATALOG) - set(THIS_XSL_CATALOG "XML_CATALOG_FILES=${THIS_XSL_CATALOG}") - endif () - - # Translate XSL parameters into a form that xsltproc can use. - set(THIS_XSL_EXTRA_FLAGS) - foreach(PARAM ${THIS_XSL_PARAMETERS}) - string(REGEX REPLACE "([^=]*)=([^;]*)" "\\1;\\2" - XSL_PARAM_LIST ${PARAM}) - list(GET XSL_PARAM_LIST 0 XSL_PARAM_NAME) - list(GET XSL_PARAM_LIST 1 XSL_PARAM_VALUE) - list(APPEND THIS_XSL_EXTRA_FLAGS - --stringparam ${XSL_PARAM_NAME} ${XSL_PARAM_VALUE}) - endforeach(PARAM) - - # If the user didn't provide a comment for this transformation, - # create a default one. - if(NOT THIS_XSL_COMMENT) - set(THIS_XSL_COMMENT "Generating ${OUTPUT} via XSL transformation...") - endif() - - # Figure out the actual output file that we tell CMake about - # (THIS_XSL_OUTPUT_FILE) and the output file or directory that we - # tell xsltproc about (THIS_XSL_OUTPUT). - if (THIS_XSL_DIRECTORY) - set(THIS_XSL_OUTPUT_FILE ${OUTPUT}/${THIS_XSL_DIRECTORY}) - set(THIS_XSL_OUTPUT ${OUTPUT}/) - else() - set(THIS_XSL_OUTPUT_FILE ${OUTPUT}) - set(THIS_XSL_OUTPUT ${OUTPUT}) - endif() - - if(NOT THIS_XSL_STYLESHEET) - message(SEND_ERROR - "xsl_transform macro invoked without a STYLESHEET argument") - else() - # Run the XSLT processor to do the XML transformation. - add_custom_command(OUTPUT ${THIS_XSL_OUTPUT_FILE} - COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS} - ${THIS_XSL_EXTRA_FLAGS} -o ${THIS_XSL_OUTPUT} - --path ${CMAKE_CURRENT_BINARY_DIR} - ${THIS_XSL_STYLESHEET} ${INPUT} - COMMENT ${THIS_XSL_COMMENT} - DEPENDS ${INPUT} ${THIS_XSL_DEFAULT_ARGS}) - set_source_files_properties(${THIS_XSL_OUTPUT_FILE} - PROPERTIES GENERATED TRUE) - - # Create a custom target to refer to the result of this - # transformation. - if (THIS_XSL_MAKE_ALL_TARGET) - add_custom_target(${THIS_XSL_MAKE_ALL_TARGET} ALL - DEPENDS ${THIS_XSL_OUTPUT_FILE}) - elseif(THIS_XSL_MAKE_TARGET) - add_custom_target(${THIS_XSL_MAKE_TARGET} - DEPENDS ${THIS_XSL_OUTPUT_FILE}) - set_target_properties(${THIS_XSL_MAKE_TARGET} - PROPERTIES - EXCLUDE_FROM_ALL ON) - endif() - endif() -endmacro(xsl_transform) - -# Use Doxygen to parse header files and produce BoostBook output. -# -# doxygen_to_boostbook(output header1 header2 ... -# [PARAMETERS param1=value1 param2=value2 ... ]) -# -# This macro sets up rules to transform a set of C/C++ header files -# into BoostBook reference documentation. The resulting BoostBook XML -# file will be named by the "output" parameter, and the set of headers -# is provided following the output file. The actual parsing of header -# files is provided by Doxygen, and is transformed into XML through -# various XSLT transformations. -# -# Doxygen has a variety of configuration parameters. One can supply -# extra Doxygen configuration parameters by providing NAME=VALUE pairs -# following the PARAMETERS argument. These parameters will be added to -# the Doxygen configuration file. -# -# This macro is intended to be used internally by -# boost_add_documentation. -macro(doxygen_to_boostbook OUTPUT) - parse_arguments(THIS_DOXY - "PARAMETERS" - "" - ${ARGN}) - - # Create a Doxygen configuration file template - # TODO: We would like to create this file at build time rather - # than at configuration time - get_filename_component(DOXYFILE_PATH ${OUTPUT} PATH) - get_filename_component(DOXYFILE_NAME ${OUTPUT} NAME_WE) - set(DOXYFILE ${DOXYFILE_PATH}/${DOXYFILE_NAME}.doxyfile) - execute_process( - COMMAND ${DOXYGEN} -s -g ${DOXYFILE} - OUTPUT_QUIET ERROR_QUIET) - - # Update the Doxygen configuration file for XML generation - file(APPEND ${DOXYFILE} "OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}\n") - file(APPEND ${DOXYFILE} "GENERATE_LATEX = NO\n") - file(APPEND ${DOXYFILE} "GENERATE_HTML = NO\n") - file(APPEND ${DOXYFILE} "GENERATE_XML = YES\n") - foreach(PARAM ${THIS_DOXY_PARAMETERS}) - file(APPEND ${DOXYFILE} "${PARAM}\n") - endforeach(PARAM) - - set(THIS_DOXY_HEADER_PATH ${CMAKE_SOURCE_DIR}/libs/${libname}/include) - - set(THIS_DOXY_HEADER_LIST "") - set(THIS_DOXY_HEADERS) - foreach(HDR ${THIS_DOXY_DEFAULT_ARGS}) - list(APPEND THIS_DOXY_HEADERS ${THIS_DOXY_HEADER_PATH}/${HDR}) - set(THIS_DOXY_HEADER_LIST - "${THIS_DOXY_HEADER_LIST} ${THIS_DOXY_HEADER_PATH}/${HDR}") - endforeach(HDR) - file(APPEND ${DOXYFILE} "INPUT = ${THIS_DOXY_HEADER_LIST}\n") - - # Generate Doxygen XML - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml - COMMAND ${DOXYGEN} ${DOXYFILE} - COMMENT "Generating Doxygen XML output for Boost.${PROJECT_NAME}..." - DEPENDS ${THIS_DOXY_HEADERS}) - - # Collect Doxygen XML into a single XML file - set_source_files_properties( - ${CMAKE_CURRENT_BINARY_DIR}/xml/combine.xslt - PROPERTIES GENERATED TRUE) - xsl_transform( - ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml - ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml - STYLESHEET ${CMAKE_CURRENT_BINARY_DIR}/xml/combine.xslt - COMMENT "Collecting Doxygen XML output for Boost.${PROJECT_NAME}...") - - # Transform single Doxygen XML file into BoostBook XML - xsl_transform(${OUTPUT} - ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml - STYLESHEET ${BOOSTBOOK_XSL_DIR}/doxygen/doxygen2boostbook.xsl - COMMENT "Transforming Doxygen XML into BoostBook XML for Boost.${PROJECT_NAME}...") -endmacro(doxygen_to_boostbook) - -# Adds documentation for the current library or tool project -# -# boost_add_documentation(source1 source2 source3 ... -# [HEADERS header1 header2 ...] -# [DOXYGEN_PARAMETERS param1=value1 param2=value2 ...]) -# - -# This macro describes the documentation for a library or tool, which -# will be built and installed as part of the normal build -# process. Documentation can be in a variety of formats, and the input -# format will determine how that documentation is transformed. The -# documentation's format is determined by its extension, and the -# following input formats are supported: -# -# QuickBook -# BoostBook (.XML extension): -macro(boost_add_documentation SOURCE) - parse_arguments(THIS_DOC - "HEADERS;DOXYGEN_PARAMETERS" - "" - ${ARGN}) - - # If SOURCE is not a full path, it's in the current source - # directory. - get_filename_component(THIS_DOC_SOURCE_PATH ${SOURCE} PATH) - if(THIS_DOC_SOURCE_PATH STREQUAL "") - set(THIS_DOC_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}") - else() - set(THIS_DOC_SOURCE_PATH ${SOURCE}) - endif() - - # If we are parsing C++ headers (with Doxygen) for reference - # documentation, do so now and produce the requested BoostBook XML - # file. - if (THIS_DOC_HEADERS) - set(DOC_HEADER_FILES) - set(DOC_BOOSTBOOK_FILE) - foreach(HEADER ${THIS_DOC_HEADERS}) - get_filename_component(HEADER_EXT ${HEADER} EXT) - string(TOUPPER ${HEADER_EXT} HEADER_EXT) - if (HEADER_EXT STREQUAL ".XML") - if (DOC_BOOSTBOOK_FILE) - # Generate this BoostBook file from the headers - doxygen_to_boostbook( - ${CMAKE_CURRENT_BINARY_DIR}/${DOC_BOOSTBOOK_FILE} - ${DOC_HEADER_FILES} - PARAMETERS ${THIS_DOC_DOXYGEN_PARAMETERS}) - list(APPEND THIS_DOC_DEFAULT_ARGS - ${CMAKE_CURRENT_BINARY_DIR}/${DOC_BOOSTBOOK_FILE}) - endif() - set(DOC_BOOSTBOOK_FILE ${HEADER}) - set(DOC_HEADER_FILES) - else() - if (NOT DOC_BOOSTBOOK_FILE) - message(SEND_ERROR - "HEADERS argument to boost_add_documentation must start with a BoostBook XML file name for output") - endif() - list(APPEND DOC_HEADER_FILES ${HEADER}) - endif() - endforeach() - - if (DOC_HEADER_FILES) - # Generate this BoostBook file from the headers - doxygen_to_boostbook( - ${CMAKE_CURRENT_BINARY_DIR}/${DOC_BOOSTBOOK_FILE} - ${DOC_HEADER_FILES} - PARAMETERS ${THIS_DOC_DOXYGEN_PARAMETERS}) - list(APPEND THIS_DOC_DEFAULT_ARGS - ${CMAKE_CURRENT_BINARY_DIR}/${DOC_BOOSTBOOK_FILE}) - - endif() - endif (THIS_DOC_HEADERS) - - # Figure out the source file extension, which will tell us how to - # build the documentation. - get_filename_component(THIS_DOC_EXT ${SOURCE} EXT) - string(TOUPPER ${THIS_DOC_EXT} THIS_DOC_EXT) - if (THIS_DOC_EXT STREQUAL ".QBK") - if (BUILD_QUICKBOOK) - # Transform Quickbook into BoostBook XML - get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) - set(BOOSTBOOK_FILE ${SOURCE_FILENAME}.xml) - add_custom_command(OUTPUT ${BOOSTBOOK_FILE} - COMMAND quickbook "--output-file=${BOOSTBOOK_FILE}" - ${THIS_DOC_SOURCE_PATH} - DEPENDS ${THIS_DOC_SOURCE_PATH} ${THIS_DOC_DEFAULT_ARGS} - COMMENT "Generating BoostBook documentation for Boost.${PROJECT_NAME}...") - - # Transform BoostBook into other formats - boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${BOOSTBOOK_FILE}) - else() - message(SEND_ERROR - "Quickbook is required to build Boost documentation.\nQuickbook can be built by enabling the BUILD_QUICKBOOK.") - endif() - elseif (THIS_DOC_EXT STREQUAL ".XML") - # Transform BoostBook XML into DocBook XML - get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) - set(DOCBOOK_FILE ${SOURCE_FILENAME}.docbook) - xsl_transform(${DOCBOOK_FILE} ${THIS_DOC_SOURCE_PATH} - ${THIS_DOC_DEFAULT_ARGS} - STYLESHEET ${BOOSTBOOK_XSL_DIR}/docbook.xsl - CATALOG ${CMAKE_BINARY_DIR}/catalog.xml - COMMENT "Generating DocBook documentation for Boost.${PROJECT_NAME}..." - MAKE_TARGET ${PROJECT_NAME}-docbook) - - # Transform DocBook into other formats - boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${DOCBOOK_FILE}) - elseif(THIS_DOC_EXT STREQUAL ".DOCBOOK") - # If requested, build HTML documentation - if (BUILD_DOCUMENTATION_HTML) - xsl_transform( - ${CMAKE_CURRENT_BINARY_DIR}/html - ${THIS_DOC_SOURCE_PATH} - STYLESHEET ${BOOSTBOOK_XSL_DIR}/html.xsl - CATALOG ${CMAKE_BINARY_DIR}/catalog.xml - DIRECTORY HTML.manifest - PARAMETERS admon.graphics.path=images - navig.graphics.path=images - boost.image.src=boost.png - COMMENT "Generating HTML documentaiton for Boost.${PROJECT_NAME}..." - MAKE_TARGET ${PROJECT_NAME}-html) - - add_custom_command(TARGET ${PROJECT_NAME}-html - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/src/boostbook.css ${CMAKE_CURRENT_BINARY_DIR}/html - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/boost.png ${CMAKE_CURRENT_BINARY_DIR}/html - ) - # Install generated documentation - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html - DESTINATION share/boost-${BOOST_VERSION} - COMPONENT ${ULIBNAME}_DOCS - PATTERN "*.manifest" EXCLUDE) - endif () - - # If requested, build Unix man pages - if (BUILD_DOCUMENTATION_MAN_PAGES) - xsl_transform( - ${CMAKE_CURRENT_BINARY_DIR}/man - ${THIS_DOC_SOURCE_PATH} - STYLESHEET ${BOOSTBOOK_XSL_DIR}/manpages.xsl - CATALOG ${CMAKE_BINARY_DIR}/catalog.xml - DIRECTORY man.manifest - COMMENT "Generating man pages for Boost.${PROJECT_NAME}..." - MAKE_TARGET ${PROJECT_NAME}-man) - - # Install man pages - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man - DESTINATION . - COMPONENT ${ULIBNAME}_DOCS - PATTERN "*.manifest" EXCLUDE) - endif () - else() - message(SEND_ERROR "Unknown documentation source kind ${SOURCE}.") - endif() -endmacro(boost_add_documentation) - - -########################################################################## -# Documentation tools configuration # -########################################################################## - -# Downloads the DocBook DTD into a place where DOCBOOK_DTD_DIR can -# find it. -macro(download_docbook_dtd) - if (NOT DOCBOOK_DTD_DIR) - set(DOCBOOK_DTD_FILENAME "docbook-xml-${WANT_DOCBOOK_DTD_VERSION}.zip") - set(DOCBOOK_DTD_URL - "http://www.oasis-open.org/docbook/xml/${WANT_DOCBOOK_DTD_VERSION}/${DOCBOOK_DTD_FILENAME}") - message(STATUS "Downloading DocBook DTD from ${DOCBOOK_DTD_URL}...") - file(DOWNLOAD - "${DOCBOOK_DTD_URL}" - "${CMAKE_BINARY_DIR}/${DOCBOOK_DTD_FILENAME}" - TIMEOUT 60 STATUS DOCBOOK_DTD_STATUS) - list(GET DOCBOOK_DTD_STATUS 0 DOCBOOK_DTD_ERROR) - if (DOCBOOK_DTD_ERROR EQUAL 0) - # Download successful! Extract the DTD ZIP file. - message(STATUS "Extracting DocBook DTD...") - execute_process( - COMMAND ${UNZIP} -d docbook-dtd-${WANT_DOCBOOK_DTD_VERSION} -q "${CMAKE_BINARY_DIR}/${DOCBOOK_DTD_FILENAME}" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - RESULT_VARIABLE UNZIP_DTD_RESULT) - if (UNZIP_DTD_RESULT EQUAL 0) - # Extraction successful. Cleanup the downloaded file. - file(REMOVE ${CMAKE_BINARY_DIR}/${DOCBOOK_DTD_FILENAME}) - set(DOCBOOK_DTD_DIR - ${CMAKE_BINARY_DIR}/docbook-dtd-${WANT_DOCBOOK_DTD_VERSION} - CACHE PATH "Path to the DocBook DTD" FORCE) - else() - # We failed: report the error to the user - message(SEND_ERROR "Extraction of DocBook DTD archive ${DOCBOOK_DTD_FILENAME} failed with error \"${UNZIP_DTD_RESULT}\". DocBook DTD and XSL autoconfiguration cannot continue.") - endif () - else() - list(GET DOCBOOK_DTD_STATUS 1 DOCBOOK_DTD_ERRORMSG) - message(SEND_ERROR "Unable to download DocBook DTD from ${DOCBOOK_DTD_URL}. Error was: \"${DOCBOOK_DTD_ERRORMSG}\"") - endif() - endif() -endmacro(download_docbook_dtd) - -# Downloads the DocBook XSL into a place where DOCBOOK_XSL_DIR can -# find it. -macro(download_docbook_xsl) - if (NOT DOCBOOK_XSL_DIR) - set(DOCBOOK_XSL_FILENAME "docbook-xsl-${WANT_DOCBOOK_XSL_VERSION}.zip") - set(DOCBOOK_XSL_URL - "${SOURCEFORGE_MIRROR}/sourceforge/docbook/${DOCBOOK_XSL_FILENAME}") - message(STATUS "Downloading DocBook XSL from ${DOCBOOK_XSL_URL}...") - file(DOWNLOAD - "${DOCBOOK_XSL_URL}" - "${CMAKE_BINARY_DIR}/${DOCBOOK_XSL_FILENAME}" - TIMEOUT 60 STATUS DOCBOOK_XSL_STATUS) - list(GET DOCBOOK_XSL_STATUS 0 DOCBOOK_XSL_ERROR) - if (DOCBOOK_XSL_ERROR EQUAL 0) - # Download successful! Extract the XSL ZIP file. - message(STATUS "Extracting DocBook XSL stylesheets...") - execute_process( - COMMAND ${UNZIP} -q "${CMAKE_BINARY_DIR}/${DOCBOOK_XSL_FILENAME}" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - RESULT_VARIABLE UNZIP_XSL_RESULT) - if (UNZIP_XSL_RESULT EQUAL 0) - # Extraction successful. Clean up the downloaded file. - file(REMOVE ${CMAKE_BINARY_DIR}/${DOCBOOK_XSL_FILENAME}) - set(DOCBOOK_XSL_DIR - ${CMAKE_BINARY_DIR}/docbook-xsl-${WANT_DOCBOOK_XSL_VERSION} - CACHE PATH "Path to the DocBook XSL stylesheets" FORCE) - else() - # We failed: report the error to the user - message(SEND_ERROR "Extraction of DocBook XSL archive ${DOCBOOK_XSL_FILENAME} failed with error \"${UNZIP_XSL_RESULT}\". DocBook XSL and XSL autoconfiguration cannot continue.") - endif () - else() - list(GET DOCBOOK_XSL_STATUS 1 DOCBOOK_XSL_ERRORMSG) - message(SEND_ERROR "Unable to download DocBook XSL from ${DOCBOOK_XSL_URL}. Error was: \"${DOCBOOK_XSL_ERRORMSG}\". You might want to try another SourceForge mirror site by changing the advanced configuration variable SOURCEFORGE_MIRROR.") - endif() - endif() -endmacro(download_docbook_xsl) - -# Preferred versions of DocBook stylesheets and utilities. We don't -# require these, but we know that they work. -set(WANT_DOCBOOK_DTD_VERSION 4.2) -set(WANT_DOCBOOK_XSL_VERSION 1.73.2) - -# Find xsltproc to transform XML documents via XSLT -find_program(XSLTPROC xsltproc DOC "xsltproc transforms XML via XSLT") -set(XSLTPROC_FLAGS "--xinclude" CACHE STRING - "Flags to pass to xsltproc to transform XML documents") - -# Find the DocBook DTD (version 4.2) -find_path(DOCBOOK_DTD_DIR docbookx.dtd - PATHS "${CMAKE_BINARY_DIR}/docbook-dtd-${WANT_DOCBOOK_DTD_VERSION}" - DOC "Path to the DocBook DTD") - -# Find the DocBook XSL stylesheets -find_path(DOCBOOK_XSL_DIR html/html.xsl - PATHS "${CMAKE_BINARY_DIR}/docbook-xsl-${WANT_DOCBOOK_XSL_VERSION}" - DOC "Path to the DocBook XSL stylesheets") - -# Find the BoostBook DTD (it should be in the distribution!) -find_path(BOOSTBOOK_DTD_DIR boostbook.dtd - PATHS ${CMAKE_SOURCE_DIR}/tools/boostbook/dtd - DOC "Path to the BoostBook DTD") -mark_as_advanced(BOOSTBOOK_DTD_DIR) - -# Find the BoostBook XSL stylesheets (they should be in the distribution!) -find_path(BOOSTBOOK_XSL_DIR docbook.xsl - PATHS ${CMAKE_SOURCE_DIR}/tools/boostbook/xsl - DOC "Path to the BoostBook XSL stylesheets") -mark_as_advanced(BOOSTBOOK_XSL_DIR) - -# Try to find Doxygen -find_package(Doxygen) - -if (XSLTPROC AND DOXYGEN) - if (DOCBOOK_DTD_DIR AND DOCBOOK_XSL_DIR) - # Documentation build options - option(BUILD_DOCUMENTATION "Whether to build library documentation" ON) - option(BUILD_DOCUMENTATION_HTML "Whether to build HTML documentation" ON) - option(BUILD_DOCUMENTATION_MAN_PAGES "Whether to build Unix man pages" ON) - - # Generate an XML catalog file. - configure_file(${CMAKE_SOURCE_DIR}/tools/build/CMake/catalog.xml.in - ${CMAKE_BINARY_DIR}/catalog.xml - @ONLY) - else() - # Look for "unzip", because we'll need it to download the DocBook - # DTD and XSL stylesheets as part of autoconfiguration. - find_program(UNZIP unzip DOC "Used to extract ZIP archives") - - if (UNZIP) - option(DOCBOOK_AUTOCONFIG - "Automatically download and configure DocBook DTD and XSL" OFF) - set(SOURCEFORGE_MIRROR "http://dl.sourceforge.net" - CACHE STRING "SourceForge mirror used to download DocBook XSL during autoconfiguration") - mark_as_advanced(SOURCEFORGE_MIRROR) - if (DOCBOOK_AUTOCONFIG) - message(STATUS "Initiating DocBook DTD and XSL autoconfiguration...") - download_docbook_dtd() - download_docbook_xsl() - endif (DOCBOOK_AUTOCONFIG) - endif() - endif() -endif() - -# Turn off BUILD_DOCUMENTATION if it isn't going to succeed. -if (BUILD_DOCUMENTATION) - set(BUILD_DOCUMENTATION_OKAY TRUE) - if (NOT XSLTPROC) - set(BUILD_DOCUMENTATION_OKAY FALSE) - message(STATUS "Docs build disabled due to missing xsltproc") - elseif (NOT DOXYGEN) - set(BUILD_DOCUMENTATION_OKAY FALSE) - message(STATUS "Docs build disabled due to missing doxygen") - elseif (NOT DOCBOOK_DTD_DIR) - set(BUILD_DOCUMENTATION_OKAY FALSE) - message(STATUS "Docs build disabled due to missing docbook dtd dir") - message(STATUS "You can set DOCBOOK_AUTOCONFIG to attempt this automatically.") - elseif (NOT DOCBOOK_XSL_DIR) - set(BUILD_DOCUMENTATION_OKAY FALSE) - message(STATUS "Docs build disabled due to missing docbook xsl dir") - message(STATUS "You can set DOCBOOK_AUTOCONFIG to attempt this automatically.") - else() - set(BUILD_DOCUMENTATION_OKAY TRUE) - endif() - - if (NOT BUILD_DOCUMENTATION_OKAY) - if (BUILD_DOCUMENTATION) - set(BUILD_DOCUMENTATION OFF CACHE BOOL - "Whether to build library documentation" FORCE) - endif() - endif() -endif() \ No newline at end of file diff --git a/CMake/BoostTesting.cmake b/CMake/BoostTesting.cmake deleted file mode 100644 index 50ea4a76c..000000000 --- a/CMake/BoostTesting.cmake +++ /dev/null @@ -1,453 +0,0 @@ -########################################################################## -# Regression Testing Support for Boost # -########################################################################## -# Copyright (C) 2007-8 Douglas Gregor # -# Copyright (C) 2007-8 Troy D. Straszheim # -# # -# Distributed under the Boost Software License, Version 1.0. # -# See accompanying file LICENSE_1_0.txt or copy at # -# http://www.boost.org/LICENSE_1_0.txt # -########################################################################## -# This file provides a set of CMake macros that support regression -# testing for Boost libraries. For each of the test macros below, the -# first argument, testname, states the name of the test that will be -# created. If no other arguments are provided, the source file -# testname.cpp will be used as the source file; otherwise, source -# files should be listed immediately after the name of the test. -# -# The macros for creating regression tests are: -# boost_test_run: Builds an executable and runs it as a test. The test -# succeeds if it builds and returns 0 when executed. -# -# boost_test_run_fail: Builds an executable and runs it as a test. The -# test succeeds if it builds but returns a non-zero -# exit code when executed. -# -# boost_test_compile: Tests that the given source file compiles without -# any errors. -# -# boost_test_compile_fail: Tests that the given source file produces -# errors when compiled. -# -# boost_additional_test_dependencies: Adds needed include directories for -# the tests. - -# User-controlled option that can be used to enable/disable regression -# testing. By default, we disable testing, because most users won't -# want or need to perform regression testing on Boost. The Boost build -# is significantly faster when we aren't also building regression -# tests. -option(BUILD_REGRESSION_TESTS "Enable regression testing" OFF) - -if (BUILD_REGRESSION_TESTS) - enable_testing() - mark_as_advanced(BUILD_TESTING) - - option(TEST_INSTALLED_TREE "Enable testing of an already-installed tree" OFF) - - set(BOOST_TEST_LIBRARIES "" - CACHE STRING "Semicolon-separated list of Boost libraries to test") - - if (TEST_INSTALLED_TREE) - include("${CMAKE_INSTALL_PREFIX}/lib/Boost${BOOST_VERSION}/boost-targets.cmake") - endif (TEST_INSTALLED_TREE) - - set(DART_TESTING_TIMEOUT=15 CACHE INTEGER "Timeout after this much madness") - -endif (BUILD_REGRESSION_TESTS) - -#------------------------------------------------------------------------------- -# This macro adds additional include directories based on the dependencies of -# the library being tested 'libname' and all of its dependencies. -# -# boost_additional_test_dependencies(libname -# BOOST_DEPENDS libdepend1 libdepend2 ...) -# -# libname is the name of the boost library being tested. (signals) -# -# There is mandatory argument to the macro: -# -# BOOST_DEPENDS: The list of the extra boost libraries that the test suite will -# depend on. You do NOT have to list those libraries already listed by the -# module.cmake file as these will be used. -# -# -# example usage: -# boost_additional_test_dependencies(signals BOOST_DEPENDS test optional) -# -macro(boost_additional_test_dependencies libname) - parse_arguments(BOOST_TEST - "BOOST_DEPENDS" - "" - ${ARGN} - ) - # Get the list of libraries that this test depends on - # Set THIS_PROJECT_DEPENDS_ALL to the set of all of its - # dependencies, its dependencies' dependencies, etc., transitively. - string(TOUPPER "BOOST_${libname}_DEPENDS" THIS_PROJECT_DEPENDS) - set(THIS_TEST_DEPENDS_ALL ${libname} ${${THIS_PROJECT_DEPENDS}} ) - set(ADDED_DEPS TRUE) - while (ADDED_DEPS) - set(ADDED_DEPS FALSE) - foreach(DEP ${THIS_TEST_DEPENDS_ALL}) - string(TOUPPER "BOOST_${DEP}_DEPENDS" DEP_DEPENDS) - foreach(DEPDEP ${${DEP_DEPENDS}}) - list(FIND THIS_TEST_DEPENDS_ALL ${DEPDEP} DEPDEP_INDEX) - if (DEPDEP_INDEX EQUAL -1) - list(APPEND THIS_TEST_DEPENDS_ALL ${DEPDEP}) - set(ADDED_DEPS TRUE) - endif() - endforeach() - endforeach() - endwhile() - - # Get the list of dependencies for the additional libraries arguments - foreach(additional_lib ${BOOST_TEST_BOOST_DEPENDS}) - list(FIND THIS_TEST_DEPENDS_ALL ${additional_lib} DEPDEP_INDEX) - if (DEPDEP_INDEX EQUAL -1) - list(APPEND THIS_TEST_DEPENDS_ALL ${additional_lib}) - set(ADDED_DEPS TRUE) - endif() - string(TOUPPER "BOOST_${additional_lib}_DEPENDS" THIS_PROJECT_DEPENDS) - set(ADDED_DEPS TRUE) - while (ADDED_DEPS) - set(ADDED_DEPS FALSE) - foreach(DEP ${THIS_TEST_DEPENDS_ALL}) - string(TOUPPER "BOOST_${DEP}_DEPENDS" DEP_DEPENDS) - foreach(DEPDEP ${${DEP_DEPENDS}}) - list(FIND THIS_TEST_DEPENDS_ALL ${DEPDEP} DEPDEP_INDEX) - if (DEPDEP_INDEX EQUAL -1) - list(APPEND THIS_TEST_DEPENDS_ALL ${DEPDEP}) - set(ADDED_DEPS TRUE) - endif() - endforeach() - endforeach() - endwhile() - endforeach() - - foreach (include ${THIS_TEST_DEPENDS_ALL}) - include_directories("${Boost_SOURCE_DIR}/libs/${include}/include") - endforeach (include ${includes}) - -endmacro(boost_additional_test_dependencies libname) -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# This macro is an internal utility macro that helps parse the -# arguments passed to the Boost testing commands. It will generally -# not be used by Boost developers. -# -# boost_test_parse_args(testname -# [source1 source2 ...] -# [ARGS arg1 arg2... ] -# [COMPILE_FLAGS compileflags] -# [LINK_FLAGS linkflags] -# [LINK_LIBS linklibs] -# [DEPENDS libdepend1 libdepend2 ...] -# [KNOWN_FAILURES string1 string2 ...] -# [COMPILE] [RUN] [FAIL]) -# -# testname is the name of the test. The remaining arguments passed to -# this macro will be parsed and categorized for the developer-level -# test macros to use. -# -# Variables affected: -# -# BOOST_TEST_OKAY: Will be set to TRUE if it is okay to build and -# run this test. -# -# BOOST_TEST_SOURCES: Will be populated with the set of source files -# that should be used to compile this test. If the user has provided -# source files, BOOST_TEST_SOURCES will contain those; otherwise, -# BOOST_TEST_SOURCES will only contain "testname.cpp". -# -# BOOST_TEST_TESTNAME: A (hopefully) globally unique target name -# for the test, constructed from PROJECT-testname-TAG -# -# BOOST_TEST_arg: Will be populated with the arguments provided for -# the arguemnt "arg", where "arg" can be any of the extra arguments -# specified above. -# -# -macro(boost_test_parse_args testname) - #message("boost_test_parse_args ${testname} ${ARGN}") - set(BOOST_TEST_OKAY TRUE) - set(BOOST_TEST_COMPILE_FLAGS "") - parse_arguments(BOOST_TEST - "BOOST_LIB;LINK_LIBS;LINK_FLAGS;DEPENDS;COMPILE_FLAGS;ARGS;EXTRA_OPTIONS;KNOWN_FAILURES" - "COMPILE;RUN;LINK;FAIL;RELEASE;DEBUG" - ${ARGN} - ) - - # Check each of the dependencies to see if we can still build this - # test. - foreach(ARG ${BOOST_TEST_DEPENDS}) - get_target_property(DEPEND_TYPE ${ARG} TYPE) - get_target_property(DEPEND_LOCATION ${ARG} LOCATION) - # If building static libraries is turned off, don't try to build - # the test - if (NOT BUILD_STATIC AND ${DEPEND_TYPE} STREQUAL "STATIC_LIBRARY") - set(BOOST_TEST_OKAY FALSE) - endif (NOT BUILD_STATIC AND ${DEPEND_TYPE} STREQUAL "STATIC_LIBRARY") - - # If building shared libraries is turned off, don't try to build - # the test - if (NOT BUILD_SHARED AND ${DEPEND_TYPE} STREQUAL "SHARED_LIBRARY") - set(BOOST_TEST_OKAY FALSE) - endif (NOT BUILD_SHARED AND ${DEPEND_TYPE} STREQUAL "SHARED_LIBRARY") - endforeach(ARG ${BOOST_TEST_DEPENDS}) - - # Setup the SOURCES variables. If no sources are specified, use the - # name of the test.cpp - if (BOOST_TEST_DEFAULT_ARGS) - set(BOOST_TEST_SOURCES ${BOOST_TEST_DEFAULT_ARGS}) - else (BOOST_TEST_DEFAULT_ARGS) - set(BOOST_TEST_SOURCES "${testname}.cpp") - endif (BOOST_TEST_DEFAULT_ARGS) - - set(BOOST_TEST_TESTNAME "${PROJECT_NAME}-${testname}") - #message("testname: ${BOOST_TEST_TESTNAME}") - # If testing is turned off, this test is not okay - if (NOT BUILD_REGRESSION_TESTS) - set(BOOST_TEST_OKAY FALSE) - endif(NOT BUILD_REGRESSION_TESTS) -endmacro(boost_test_parse_args) - -# This macro attaches a the "known-failure" label to the given test -# target if the build name matches any of the declared, known -# failures. -macro(boost_test_known_failures TEST) - foreach(PATTERN ${ARGN}) - if (${BUILDNAME} MATCHES ${PATTERN}) - set_tests_properties("${PROJECT_NAME}-${TEST}" - PROPERTIES LABELS "${PROJECT_NAME};known-failure") - endif() - endforeach() -endmacro(boost_test_known_failures) - - -# This macro creates a Boost regression test that will be executed. If -# the test can be built, executed, and exits with a return code of -# zero, it will be considered to have passed. -# -# boost_test_run(testname -# [source1 source2 ...] -# [ARGS arg1 arg2... ] -# [COMPILE_FLAGS compileflags] -# [LINK_FLAGS linkflags] -# [LINK_LIBS linklibs] -# [DEPENDS libdepend1 libdepend2 ...] -# [EXTRA_OPTIONS option1 option2 ...]) -# -# testname is the name of the test. source1, source2, etc. are the -# source files that will be built and linked into the test -# executable. If no source files are provided, the file "testname.cpp" -# will be used instead. -# -# There are several optional arguments to control how the regression -# test is built and executed: -# -# ARGS: Provides additional arguments that will be passed to the -# test executable when it is run. -# -# COMPILE_FLAGS: Provides additional compilation flags that will be -# used when building this test. For example, one might want to add -# "-DBOOST_SIGNALS_ASSERT=1" to turn on assertions within the library. -# -# LINK_FLAGS: Provides additional flags that will be passed to the -# linker when linking the test excecutable. This option should not -# be used to link in additional libraries; see LINK_LIBS and -# DEPENDS. -# -# LINK_LIBS: Provides additional libraries against which the test -# executable will be linked. For example, one might provide "expat" -# as options to LINK_LIBS, to state that this executable should be -# linked against the external "expat" library. Use LINK_LIBS for -# libraries external to Boost; for Boost libraries, use DEPENDS. -# -# DEPENDS: States that this test executable depends on and links -# against another Boost library. The argument to DEPENDS should be -# the name of a particular variant of a Boost library, e.g., -# boost_signals-static. -# -# EXTRA_OPTIONS: Provide extra options that will be passed on to -# boost_add_executable. -# -# Example: -# boost_test_run(signal_test DEPENDS boost_signals) -macro(boost_test_run testname) - boost_test_parse_args(${testname} ${ARGN} RUN) - if (BOOST_TEST_OKAY) - boost_add_executable(${testname} ${BOOST_TEST_SOURCES} - OUTPUT_NAME tests/${PROJECT_NAME}/${testname} - DEPENDS "${BOOST_TEST_DEPENDS}" - LINK_LIBS ${BOOST_TEST_LINK_LIBS} - LINK_FLAGS ${BOOST_TEST_LINK_FLAGS} - COMPILE_FLAGS ${BOOST_TEST_COMPILE_FLAGS} - NO_INSTALL - ${BOOST_TEST_EXTRA_OPTIONS}) - - if (THIS_EXE_OKAY) - get_target_property(THIS_TEST_OUTPUT_DIRECTORY ${testname} - RUNTIME_OUTPUT_DIRECTORY) - add_test (${BOOST_TEST_TESTNAME} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/tests/${PROJECT_NAME}/${testname} - ${BOOST_TEST_ARGS}) - - set_tests_properties(${BOOST_TEST_TESTNAME} - PROPERTIES - LABELS "${PROJECT_NAME}" - ) - boost_test_known_failures(${testname} ${BOOST_TEST_KNOWN_FAILURES}) - - # Make sure that the -test target that corresponds to this - # library or tool depends on this test executable. - add_dependencies(${PROJECT_NAME}-test ${THIS_EXE_NAME}) - - if (BOOST_TEST_FAIL) - set_tests_properties(${BOOST_TEST_TESTNAME} PROPERTIES WILL_FAIL ON) - endif () - endif(THIS_EXE_OKAY) - endif (BOOST_TEST_OKAY) -endmacro(boost_test_run) - -# -# This macro creates a boost regression test that will be run but is -# expected to fail (exit with nonzero return code). -# See boost_test_run() -# -macro(boost_test_run_fail testname) - boost_test_run(${testname} ${ARGN} FAIL) -endmacro(boost_test_run_fail) - -# This macro creates a Boost regression test that will be compiled, -# but not linked or executed. If the test can be compiled with no -# failures, the test passes. -# -# boost_test_compile(testname -# [source1] -# [COMPILE_FLAGS compileflags]) -# -# testname is the name of the test. source1 is the name of the source -# file that will be built. If no source file is provided, the file -# "testname.cpp" will be used instead. -# -# The COMPILE_FLAGS argument provides additional arguments that will -# be passed to the compiler when building this test. - -# Example: -# boost_test_compile(advance) -macro(boost_test_compile testname) - boost_test_parse_args(${testname} ${ARGN} COMPILE) - - set (test_pass "PASSED") - if (BOOST_TEST_FAIL) - set (test_pass "FAILED") - endif(BOOST_TEST_FAIL) - if (BOOST_TEST_OKAY) - - # Determine the include directories to pass along to the underlying - # project. - # works but not great - get_directory_property(BOOST_TEST_INCLUDE_DIRS INCLUDE_DIRECTORIES) - set(BOOST_TEST_INCLUDES "") - foreach(DIR ${BOOST_TEST_INCLUDE_DIRS}) - set(BOOST_TEST_INCLUDES "${BOOST_TEST_INCLUDES};${DIR}") - endforeach(DIR ${BOOST_TEST_INCLUDE_DIRS}) - - add_test(${BOOST_TEST_TESTNAME} - ${CMAKE_CTEST_COMMAND} - --build-and-test - ${Boost_SOURCE_DIR}/tools/build/CMake/CompileTest - ${Boost_BINARY_DIR}/tools/build/CMake/CompileTest - --build-generator ${CMAKE_GENERATOR} - --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-project CompileTest - --build-options - "-DSOURCE:STRING=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES}" - "-DINCLUDES:STRING=${BOOST_TEST_INCLUDES}" - "-DCOMPILE_FLAGS:STRING=${BOOST_TEST_COMPILE_FLAGS}" - ) - - set_tests_properties(${BOOST_TEST_TESTNAME} - PROPERTIES - LABELS "${PROJECT_NAME}" - ) - - boost_test_known_failures(${testname} ${BOOST_TEST_KNOWN_FAILURES}) - - if (BOOST_TEST_FAIL) - set_tests_properties(${BOOST_TEST_TESTNAME} PROPERTIES WILL_FAIL ON) - endif () - endif(BOOST_TEST_OKAY) -endmacro(boost_test_compile) - -# -# This macro creates a Boost regression test that is expected to -# *fail* to compile. See boost_test_compile() -# -macro(boost_test_compile_fail testname) - boost_test_compile(${testname} ${ARGN} FAIL) -endmacro(boost_test_compile_fail) - - - - -# -# boost_test_link: -# -# -# Each library "exports" itself to -# ${CMAKE_BINARY_DIR}/exports/.cmake -# -# The list of 'depends' for these libraries has to match one of those -# files, this way the export mechanism works. The generated -# cmakelists will include() those exported .cmake files, for each -# DEPENDS. -# -# -macro(boost_test_link testname) - boost_test_parse_args(${testname} ${ARGN} LINK) - if(BOOST_TEST_OKAY) - # Determine the include directories to pass along to the underlying - # project. - # works but not great - get_directory_property(BOOST_TEST_INCLUDE_DIRS INCLUDE_DIRECTORIES) - set(BOOST_TEST_INCLUDES "") - foreach(DIR ${BOOST_TEST_INCLUDE_DIRS}) - set(BOOST_TEST_INCLUDES "${BOOST_TEST_INCLUDES};${DIR}") - endforeach(DIR ${BOOST_TEST_INCLUDE_DIRS}) - - add_test(${BOOST_TEST_TESTNAME} - ${CMAKE_CTEST_COMMAND} - -VV - --build-and-test - ${Boost_SOURCE_DIR}/tools/build/CMake/LinkTest - ${Boost_BINARY_DIR}/tools/build/CMake/LinkTest - --build-generator ${CMAKE_GENERATOR} - --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-project LinkTest - --build-options - "-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}" - "-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}" - "-DBOOST_EXPORTS_DIR:FILEPATH=${CMAKE_BINARY_DIR}/exports" - "-DSOURCE:STRING=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES}" - "-DINCLUDES:STRING=${BOOST_TEST_INCLUDES}" - "-DCOMPILE_FLAGS:STRING=${BOOST_TEST_COMPILE_FLAGS}" - "-DLINK_LIBS:STRING=${BOOST_TEST_LINK_LIBS}" - "-DDEPENDS:STRING=${BOOST_TEST_DEPENDS}" - ) - - set_tests_properties(${BOOST_TEST_TESTNAME} - PROPERTIES - LABELS "${PROJECT_NAME}" - ) - - boost_test_known_failures(${testname} ${BOOST_TEST_KNOWN_FAILURES}) - - if (BOOST_TEST_FAIL) - set_tests_properties(${BOOST_TEST_TESTNAME} PROPERTIES WILL_FAIL ON) - endif () - endif(BOOST_TEST_OKAY) -endmacro(boost_test_link) - diff --git a/CMake/BoostUtils.cmake b/CMake/BoostUtils.cmake deleted file mode 100644 index c87064d8c..000000000 --- a/CMake/BoostUtils.cmake +++ /dev/null @@ -1,227 +0,0 @@ -########################################################################## -# Boost Utilities # -########################################################################## -# Copyright (C) 2007 Douglas Gregor # -# Copyright (C) 2007 Troy Straszheim # -# # -# Distributed under the Boost Software License, Version 1.0. # -# See accompanying file LICENSE_1_0.txt or copy at # -# http://www.boost.org/LICENSE_1_0.txt # -########################################################################## -# Macros in this module: # -# # -# list_contains: Determine whether a string value is in a list. # -# # -# car: Return the first element in a list # -# # -# cdr: Return all but the first element in a list # -# # -# parse_arguments: Parse keyword arguments for use in other macros. # -########################################################################## - -# This utility macro determines whether a particular string value -# occurs within a list of strings: -# -# list_contains(result string_to_find arg1 arg2 arg3 ... argn) -# -# This macro sets the variable named by result equal to TRUE if -# string_to_find is found anywhere in the following arguments. -macro(list_contains var value) - set(${var}) - foreach (value2 ${ARGN}) - if (${value} STREQUAL ${value2}) - set(${var} TRUE) - endif (${value} STREQUAL ${value2}) - endforeach (value2) -endmacro(list_contains) - -# This utility macro extracts the first argument from the list of -# arguments given, and places it into the variable named var. -# -# car(var arg1 arg2 ...) -macro(car var) - set(${var} ${ARGV1}) -endmacro(car) - -# This utility macro extracts all of the arguments given except the -# first, and places them into the variable named var. -# -# car(var arg1 arg2 ...) -macro(cdr var junk) - set(${var} ${ARGN}) -endmacro(cdr) - -# The PARSE_ARGUMENTS macro will take the arguments of another macro and -# define several variables. The first argument to PARSE_ARGUMENTS is a -# prefix to put on all variables it creates. The second argument is a -# list of names, and the third argument is a list of options. Both of -# these lists should be quoted. The rest of PARSE_ARGUMENTS are -# arguments from another macro to be parsed. -# -# PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...) -# -# For each item in options, PARSE_ARGUMENTS will create a variable with -# that name, prefixed with prefix_. So, for example, if prefix is -# MY_MACRO and options is OPTION1;OPTION2, then PARSE_ARGUMENTS will -# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These -# variables will be set to true if the option exists in the command line -# or false otherwise. -# -# For each item in arg_names, PARSE_ARGUMENTS will create a variable -# with that name, prefixed with prefix_. Each variable will be filled -# with the arguments that occur after the given arg_name is encountered -# up to the next arg_name or the end of the arguments. All options are -# removed from these lists. PARSE_ARGUMENTS also creates a -# prefix_DEFAULT_ARGS variable containing the list of all arguments up -# to the first arg_name encountered. -MACRO(PARSE_ARGUMENTS prefix arg_names option_names) - SET(DEFAULT_ARGS) - FOREACH(arg_name ${arg_names}) - SET(${prefix}_${arg_name}) - ENDFOREACH(arg_name) - FOREACH(option ${option_names}) - SET(${prefix}_${option} FALSE) - ENDFOREACH(option) - - SET(current_arg_name DEFAULT_ARGS) - SET(current_arg_list) - FOREACH(arg ${ARGN}) - LIST_CONTAINS(is_arg_name ${arg} ${arg_names}) - IF (is_arg_name) - SET(${prefix}_${current_arg_name} ${current_arg_list}) - SET(current_arg_name ${arg}) - SET(current_arg_list) - ELSE (is_arg_name) - LIST_CONTAINS(is_option ${arg} ${option_names}) - IF (is_option) - SET(${prefix}_${arg} TRUE) - ELSE (is_option) - SET(current_arg_list ${current_arg_list} ${arg}) - ENDIF (is_option) - ENDIF (is_arg_name) - ENDFOREACH(arg) - SET(${prefix}_${current_arg_name} ${current_arg_list}) -ENDMACRO(PARSE_ARGUMENTS) - -# Perform a reverse topological sort on the given LIST. -# -# topological_sort(my_list "MY_" "_EDGES") -# -# LIST is the name of a variable containing a list of elements to be -# sorted in reverse topological order. Each element in the list has a -# set of outgoing edges (for example, those other list elements that -# it depends on). In the resulting reverse topological ordering -# (written back into the variable named LIST), an element will come -# later in the list than any of the elements that can be reached by -# following its outgoing edges and the outgoing edges of any vertices -# they target, recursively. Thus, if the edges represent dependencies -# on build targets, for example, the reverse topological ordering is -# the order in which one would build those targets. -# -# For each element E in this list, the edges for E are contained in -# the variable named ${PREFIX}${E}${SUFFIX}, where E is the -# upper-cased version of the element in the list. If no such variable -# exists, then it is assumed that there are no edges. For example, if -# my_list contains a, b, and c, one could provide a dependency graph -# using the following variables: -# -# MY_A_EDGES b -# MY_B_EDGES -# MY_C_EDGES a b -# -# With the involcation of topological_sort shown above and these -# variables, the resulting reverse topological ordering will be b, a, -# c. -function(topological_sort LIST PREFIX SUFFIX) - # Clear the stack and output variable - set(VERTICES "${${LIST}}") - set(STACK) - set(${LIST}) - - # Loop over all of the vertices, starting the topological sort from - # each one. - foreach(VERTEX ${VERTICES}) - string(TOUPPER ${VERTEX} UPPER_VERTEX) - - # If we haven't already processed this vertex, start a depth-first - # search from where. - if (NOT FOUND_${UPPER_VERTEX}) - # Push this vertex onto the stack with all of its outgoing edges - string(REPLACE ";" " " NEW_ELEMENT - "${VERTEX};${${PREFIX}${UPPER_VERTEX}${SUFFIX}}") - list(APPEND STACK ${NEW_ELEMENT}) - - # We've now seen this vertex - set(FOUND_${UPPER_VERTEX} TRUE) - - # While the depth-first search stack is not empty - list(LENGTH STACK STACK_LENGTH) - while(STACK_LENGTH GREATER 0) - # Remove the vertex and its remaining out-edges from the top - # of the stack - list(GET STACK -1 OUT_EDGES) - list(REMOVE_AT STACK -1) - - # Get the source vertex and the list of out-edges - separate_arguments(OUT_EDGES) - list(GET OUT_EDGES 0 SOURCE) - list(REMOVE_AT OUT_EDGES 0) - - # While there are still out-edges remaining - list(LENGTH OUT_EDGES OUT_DEGREE) - while (OUT_DEGREE GREATER 0) - # Pull off the first outgoing edge - list(GET OUT_EDGES 0 TARGET) - list(REMOVE_AT OUT_EDGES 0) - - string(TOUPPER ${TARGET} UPPER_TARGET) - if (NOT FOUND_${UPPER_TARGET}) - # We have not seen the target before, so we will traverse - # its outgoing edges before coming back to our - # source. This is the key to the depth-first traversal. - - # We've now seen this vertex - set(FOUND_${UPPER_TARGET} TRUE) - - # Push the remaining edges for the current vertex onto the - # stack - string(REPLACE ";" " " NEW_ELEMENT - "${SOURCE};${OUT_EDGES}") - list(APPEND STACK ${NEW_ELEMENT}) - - # Setup the new source and outgoing edges - set(SOURCE ${TARGET}) - string(TOUPPER ${SOURCE} UPPER_SOURCE) - set(OUT_EDGES - ${${PREFIX}${UPPER_SOURCE}${SUFFIX}}) - endif(NOT FOUND_${UPPER_TARGET}) - - list(LENGTH OUT_EDGES OUT_DEGREE) - endwhile (OUT_DEGREE GREATER 0) - - # We have finished all of the outgoing edges for - # SOURCE; add it to the resulting list. - list(APPEND ${LIST} ${SOURCE}) - - # Check the length of the stack - list(LENGTH STACK STACK_LENGTH) - endwhile(STACK_LENGTH GREATER 0) - endif (NOT FOUND_${UPPER_VERTEX}) - endforeach(VERTEX) - - set(${LIST} ${${LIST}} PARENT_SCOPE) -endfunction(topological_sort) - -# Small little hack that tweaks a component name (as used for CPack) -# to make sure to avoid certain names that cause problems. Sets the -# variable named varname to the "sanitized" name. -# -# FIXME: This is a complete hack. We probably need to fix the CPack -# generators (NSIS in particular) to get rid of the need for this. -macro(fix_cpack_component_name varname name) - if (${name} STREQUAL "foreach") - set(${varname} "boost_foreach") - else() - set(${varname} ${name}) - endif() -endmacro() \ No newline at end of file diff --git a/CMake/CompileTest/CMakeLists.txt b/CMake/CompileTest/CMakeLists.txt deleted file mode 100644 index d5a590842..000000000 --- a/CMake/CompileTest/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# -cmake_minimum_required(VERSION 2.6) -project(CompileTest) -add_library(compile-test STATIC ${SOURCE}) -include_directories(${INCLUDES}) -set_source_files_properties(${SOURCE} - PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") \ No newline at end of file diff --git a/CMake/FindICU.cmake b/CMake/FindICU.cmake deleted file mode 100644 index 9dff9f398..000000000 --- a/CMake/FindICU.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# Finds the International Components for Unicode (ICU) Library -# -# ICU_FOUND - True if ICU found. -# ICU_I18N_FOUND - True if ICU's internationalization library found. -# ICU_INCLUDE_DIRS - Directory to include to get ICU headers -# Note: always include ICU headers as, e.g., -# unicode/utypes.h -# ICU_LIBRARIES - Libraries to link against for the common ICU -# ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation -# (note: in addition to ICU_LIBRARIES) - -# Look for the header file. -find_path( - ICU_INCLUDE_DIR - NAMES unicode/utypes.h - DOC "Include directory for the ICU library") -mark_as_advanced(ICU_INCLUDE_DIR) - -# Look for the library. -find_library( - ICU_LIBRARY - NAMES icuuc cygicuuc cygicuuc32 - DOC "Libraries to link against for the common parts of ICU") -mark_as_advanced(ICU_LIBRARY) - -# Copy the results to the output variables. -if(ICU_INCLUDE_DIR AND ICU_LIBRARY) - set(ICU_FOUND 1) - set(ICU_LIBRARIES ${ICU_LIBRARY}) - set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR}) - - # Look for the ICU internationalization libraries - find_library( - ICU_I18N_LIBRARY - NAMES icuin icui18n cygicuin cygicuin32 - DOC "Libraries to link against for ICU internationalization") - mark_as_advanced(ICU_I18N_LIBRARY) - if (ICU_I18N_LIBRARY) - set(ICU_I18N_FOUND 1) - set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY}) - else (ICU_I18N_LIBRARY) - set(ICU_I18N_FOUND 0) - set(ICU_I18N_LIBRARIES) - endif (ICU_I18N_LIBRARY) -else(ICU_INCLUDE_DIR AND ICU_LIBRARY) - set(ICU_FOUND 0) - set(ICU_I18N_FOUND 0) - set(ICU_LIBRARIES) - set(ICU_I18N_LIBRARIES) - set(ICU_INCLUDE_DIRS) -endif(ICU_INCLUDE_DIR AND ICU_LIBRARY) diff --git a/CMake/LinkTest/CMakeLists.txt b/CMake/LinkTest/CMakeLists.txt deleted file mode 100644 index 45327091b..000000000 --- a/CMake/LinkTest/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# -cmake_minimum_required(VERSION 2.6) - -file(GLOB BOOST_EXPORTS "${BOOST_EXPORTS_DIR}/*.cmake") - -foreach(import - ${DEPENDS}) - include(${BOOST_EXPORTS_DIR}/${import}.cmake) -endforeach() - -project(LinkTest) -include_directories (${INCLUDES}) -add_executable(link-test ${SOURCE}) -set_source_files_properties(${SOURCE} - PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") - -message("DEPENDS=====${DEPENDS}") - -target_link_libraries(link-test - ${LINK_LIBS} - ${DEPENDS}) diff --git a/CMake/catalog.xml.in b/CMake/catalog.xml.in deleted file mode 100644 index 75bc4f1d0..000000000 --- a/CMake/catalog.xml.in +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -