diff options
Diffstat (limited to 'Modules')
70 files changed, 1301 insertions, 697 deletions
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in index 602b065..7d89420 100644 --- a/Modules/AutogenInfo.cmake.in +++ b/Modules/AutogenInfo.cmake.in @@ -1,5 +1,6 @@ set(AM_SOURCES @_cpp_files@ ) set(AM_RCC_SOURCES @_rcc_files@ ) +set(AM_RCC_INPUTS @_qt_rcc_inputs@) set(AM_SKIP_MOC @_skip_moc@ ) set(AM_SKIP_UIC @_skip_uic@ ) set(AM_HEADERS @_moc_headers@ ) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 445c719..fee0a7c 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -655,8 +655,12 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite if(EXISTS "${resolved_resources}") #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'") execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}") - else() - # Otherwise try at least copy Contents/Info.plist to Resources/Info.plist, if it exists: + endif() + + # Some frameworks e.g. Qt put Info.plist in wrong place, so when it is + # missing in resources, copy it from other well known incorrect locations: + if(NOT EXISTS "${resolved_resources}/Info.plist") + # Check for Contents/Info.plist in framework root (older Qt SDK): string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Contents/Info.plist" resolved_info_plist "${resolved_item}") string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources/Info.plist" resolved_embedded_info_plist "${resolved_embedded_item}") if(EXISTS "${resolved_info_plist}") @@ -674,6 +678,16 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite if(NOT EXISTS "${resolved_embedded_versions}/Current") execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${resolved_embedded_version}" "${resolved_embedded_versions}/Current") endif() + # Restore symlinks in framework root pointing to current framework + # binary and resources: + string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1" resolved_embedded_root "${resolved_embedded_item}") + string(REGEX REPLACE "^.*/([^/]+)$" "\\1" resolved_embedded_item_basename "${resolved_embedded_item}") + if(NOT EXISTS "${resolved_embedded_root}/${resolved_embedded_item_basename}") + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/${resolved_embedded_item_basename}" "${resolved_embedded_root}/${resolved_embedded_item_basename}") + endif() + if(NOT EXISTS "${resolved_embedded_root}/Resources") + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Resources" "${resolved_embedded_root}/Resources") + endif() endif() endif() if(UNIX AND NOT APPLE) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 6b425c6..937aa8c 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -108,7 +108,7 @@ if(NOT CMAKE_C_COMPILER_ID_RUN) CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c) # Set old compiler and platform id variables. - if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_C_COMPILER_ID MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUCC 1) endif() if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") @@ -131,11 +131,11 @@ endif () # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) - if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)(clang|g?cc)(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_C_COMPILER_TARGET) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-) endif() @@ -150,7 +150,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) endif () - elseif("${CMAKE_C_COMPILER_ID}" MATCHES "TI") + elseif(CMAKE_C_COMPILER_ID MATCHES "TI") # TI compilers are named e.g. cl6x, cl470 or armcl.exe get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+)?cl([^.]+)?(\\.exe)?$") diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index a7b5760..0ea9ce1 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -48,7 +48,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang}) endif() - if (COMPILER_QNXNTO AND CMAKE_${lang}_COMPILER_ID STREQUAL GNU) + if (COMPILER_QNXNTO AND CMAKE_${lang}_COMPILER_ID STREQUAL "GNU") execute_process( COMMAND "${CMAKE_${lang}_COMPILER}" -V @@ -261,11 +261,20 @@ Id flags: ${testflags} else() set(id_deployment_target "") endif() + set(id_product_type "com.apple.product-type.tool") if(CMAKE_OSX_SYSROOT) set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";") + if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]") + set(id_product_type "com.apple.product-type.bundle.unit-test") + endif() else() set(id_sdkroot "") endif() + if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY) + set(id_code_sign_identity "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";") + else() + set(id_code_sign_identity "") + endif() if(NOT ${XCODE_VERSION} VERSION_LESS 3) set(v 3) set(ext xcodeproj) @@ -298,7 +307,7 @@ Id flags: ${testflags} # ... # /path/to/cc ...CompilerId${lang}/... # to extract the compiler front-end for the language. - if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/(\\./)?CompilerId${lang}[ \t\n\\\"]") + if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/(\\./)?(CompilerId${lang}.xctest/)?CompilerId${lang}[ \t\n\\\"]") set(_comp "${CMAKE_MATCH_2}") if(EXISTS "${_comp}") set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE) @@ -366,7 +375,13 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} # binary dir. file(GLOB files RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR} - ${CMAKE_${lang}_COMPILER_ID_DIR}/*) + + # normal case + ${CMAKE_${lang}_COMPILER_ID_DIR}/* + + # com.apple.package-type.bundle.unit-test + ${CMAKE_${lang}_COMPILER_ID_DIR}/*.xctest/* + ) list(REMOVE_ITEM files "${src}") set(COMPILER_${lang}_PRODUCED_FILES "") foreach(file ${files}) diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 96df6a2..a4bb86c 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -152,12 +152,12 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) endif() # Set old compiler and platform id variables. - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUG77 1) endif() - if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") + if(CMAKE_Fortran_PLATFORM_ID MATCHES "MinGW") set(CMAKE_COMPILER_IS_MINGW 1) - elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin") + elseif(CMAKE_Fortran_PLATFORM_ID MATCHES "Cygwin") set(CMAKE_COMPILER_IS_CYGWIN 1) endif() endif() @@ -175,7 +175,7 @@ endif () # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") get_filename_component(COMPILER_BASENAME "${CMAKE_Fortran_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)g?fortran(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake index b6ab7ef..8ac3364 100644 --- a/Modules/CMakeExpandImportedTargets.cmake +++ b/Modules/CMakeExpandImportedTargets.cmake @@ -20,8 +20,9 @@ # # :: # -# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" ) +# cmake_expand_imported_targets(expandedLibs +# LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} +# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" ) #============================================================================= diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 365d381..064e650 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -26,11 +26,18 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines if (${_lang} STREQUAL "c++") set(_compilerExecutable "${CMAKE_CXX_COMPILER}") set(_arg1 "${CMAKE_CXX_COMPILER_ARG1}") + + if (CMAKE_CXX_FLAGS MATCHES "(-stdlib=[^ ]+)") + set(_stdlib "${CMAKE_MATCH_1}") + endif () + if (CMAKE_CXX_FLAGS MATCHES "(-std=[^ ]+)") + set(_stdver "${CMAKE_MATCH_1}") + endif () else () set(_compilerExecutable "${CMAKE_C_COMPILER}") set(_arg1 "${CMAKE_C_COMPILER_ARG1}") endif () - execute_process(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy + execute_process(COMMAND ${_compilerExecutable} ${_arg1} ${_stdver} ${_stdlib} -v -E -x ${_lang} -dD dummy WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles ERROR_VARIABLE _gccOutput OUTPUT_VARIABLE _gccStdout ) @@ -90,7 +97,7 @@ set(ENV{LANG} C) # Now check for C, works for gcc and Intel compiler at least if (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS) - if ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel OR "${CMAKE_C_COMPILER_ID}" MATCHES Clang) + if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_C_COMPILER_ID MATCHES Clang) _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines) set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories") set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros") diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index e0ba131..50cb972 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -30,12 +30,12 @@ # License text for the above reference.) # if it's the MS C/CXX compiler, search for link -if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC" - OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC" - OR "${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "MSVC" - OR "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" - OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" - OR ("${CMAKE_GENERATOR}" MATCHES "Visual Studio" +if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC" + OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC" + OR CMAKE_Fortran_SIMULATE_ID STREQUAL "MSVC" + OR CMAKE_C_COMPILER_ID STREQUAL "MSVC" + OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" + OR (CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")) find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake index 9f97ee5..fc3058d 100644 --- a/Modules/CMakeFindPackageMode.cmake +++ b/Modules/CMakeFindPackageMode.cmake @@ -7,15 +7,24 @@ # This file is executed by cmake when invoked with --find-package. It # expects that the following variables are set using -D: # -# :: -# -# NAME = name of the package -# COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc. -# LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM -# MODE = EXIST : only check for existence of the given package -# COMPILE : print the flags needed for compiling an object file which uses the given package -# LINK : print the flags needed for linking when using the given package -# QUIET = if TRUE, don't print anything +# ``NAME`` +# name of the package +# ``COMPILER_ID`` +# the CMake compiler ID for which the result is, +# i.e. GNU/Intel/Clang/MSVC, etc. +# ``LANGUAGE`` +# language for which the result will be used, +# i.e. C/CXX/Fortan/ASM +# ``MODE`` +# ``EXIST`` +# only check for existence of the given package +# ``COMPILE`` +# print the flags needed for compiling an object file which uses +# the given package +# ``LINK`` +# print the flags needed for linking when using the given package +# ``QUIET`` +# if TRUE, don't print anything #============================================================================= # Copyright 2006-2011 Alexander Neundorf, <neundorf@kde.org> diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake index 0e6b5af..1d8b110 100644 --- a/Modules/CMakeForceCompiler.cmake +++ b/Modules/CMakeForceCompiler.cmake @@ -70,7 +70,7 @@ macro(CMAKE_FORCE_C_COMPILER compiler id) set(CMAKE_C_COMPILER_FORCED TRUE) # Set old compiler id variables. - if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_C_COMPILER_ID MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUCC 1) endif() endmacro() @@ -94,7 +94,7 @@ macro(CMAKE_FORCE_Fortran_COMPILER compiler id) set(CMAKE_Fortran_COMPILER_FORCED TRUE) # Set old compiler id variables. - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUG77 1) endif() endmacro() diff --git a/Modules/CMakeNinjaFindMake.cmake b/Modules/CMakeNinjaFindMake.cmake index c3ca767..2f35cf4 100644 --- a/Modules/CMakeNinjaFindMake.cmake +++ b/Modules/CMakeNinjaFindMake.cmake @@ -12,6 +12,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -find_program(CMAKE_MAKE_PROGRAM ninja +find_program(CMAKE_MAKE_PROGRAM + NAMES ninja-build ninja DOC "Program used to build from build.ninja files.") mark_as_advanced(CMAKE_MAKE_PROGRAM) diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index c6dc141..206ea7a 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -15,12 +15,13 @@ # # Create a config file for a project:: # -# configure_package_config_file(<input> <output> INSTALL_DESTINATION <path> -# [PATH_VARS <var1> <var2> ... <varN>] -# [NO_SET_AND_CHECK_MACRO] -# [NO_CHECK_REQUIRED_COMPONENTS_MACRO] -# [INSTALL_PREFIX <path>]) -# +# configure_package_config_file(<input> <output> +# INSTALL_DESTINATION <path> +# [PATH_VARS <var1> <var2> ... <varN>] +# [NO_SET_AND_CHECK_MACRO] +# [NO_CHECK_REQUIRED_COMPONENTS_MACRO] +# [INSTALL_PREFIX <path>] +# ) # # ``configure_package_config_file()`` should be used instead of the plain # :command:`configure_file()` command when creating the ``<Name>Config.cmake`` @@ -51,13 +52,13 @@ # Using ``configure_package_config_file`` helps. If used correctly, it makes # the resulting ``FooConfig.cmake`` file relocatable. Usage: # -# 1. write a ``FooConfig.cmake.in`` file as you are used to -# 2. insert a line containing only the string ``@PACKAGE_INIT@`` -# 3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use -# ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the -# ``@PACKAGE_INIT@`` line) -# 4. instead of using the normal :command:`configure_file()`, use -# ``configure_package_config_file()`` +# 1. write a ``FooConfig.cmake.in`` file as you are used to +# 2. insert a line containing only the string ``@PACKAGE_INIT@`` +# 3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use +# ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the +# ``@PACKAGE_INIT@`` line) +# 4. instead of using the normal :command:`configure_file()`, use +# ``configure_package_config_file()`` # # # @@ -116,9 +117,9 @@ # # Create a version file for a project:: # -# write_basic_package_version_file(<filename> -# [VERSION <major.minor.patch>] -# COMPATIBILITY <AnyNewerVersion|SameMajorVersion|ExactVersion> ) +# write_basic_package_version_file(<filename> +# [VERSION <major.minor.patch>] +# COMPATIBILITY <AnyNewerVersion|SameMajorVersion|ExactVersion> ) # # # Writes a file for use as ``<package>ConfigVersion.cmake`` file to @@ -172,13 +173,16 @@ # set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE ) # ... # include(CMakePackageConfigHelpers) -# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake -# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake -# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR) -# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake -# VERSION 1.2.3 -# COMPATIBILITY SameMajorVersion ) -# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# configure_package_config_file(FooConfig.cmake.in +# ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake +# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake +# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR) +# write_basic_package_version_file( +# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# VERSION 1.2.3 +# COMPATIBILITY SameMajorVersion ) +# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake +# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake # DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake ) # # ``FooConfig.cmake.in``: diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake index 4248176..8553f38 100644 --- a/Modules/CMakeParseArguments.cmake +++ b/Modules/CMakeParseArguments.cmake @@ -45,7 +45,8 @@ # set(options OPTIONAL FAST) # set(oneValueArgs DESTINATION RENAME) # set(multiValueArgs TARGETS CONFIGURATIONS) -# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) +# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" +# "${multiValueArgs}" ${ARGN} ) # ... # # diff --git a/Modules/CMakePrintHelpers.cmake b/Modules/CMakePrintHelpers.cmake index ad3b0d5..474fa41 100644 --- a/Modules/CMakePrintHelpers.cmake +++ b/Modules/CMakePrintHelpers.cmake @@ -15,11 +15,10 @@ # # This macro prints the values of the properties of the given targets, # source files, directories, tests or cache entries. Exactly one of the -# scope keywords must be used. Example: +# scope keywords must be used. Example:: # -# :: -# -# cmake_print_properties(TARGETS foo bar PROPERTIES LOCATION INTERFACE_INCLUDE_DIRS) +# cmake_print_properties(TARGETS foo bar PROPERTIES +# LOCATION INTERFACE_INCLUDE_DIRS) # # This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for # both targets foo and bar. @@ -29,17 +28,13 @@ # CMAKE_PRINT_VARIABLES(var1 var2 .. varN) # # This macro will print the name of each variable followed by its value. -# Example: -# -# :: -# -# cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION THIS_ONE_DOES_NOT_EXIST) +# Example:: # -# Gives: +# cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION DOES_NOT_EXIST) # -# :: +# Gives:: # -# -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; THIS_ONE_DOES_NOT_EXIST="" +# -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; DOES_NOT_EXIST="" #============================================================================= # Copyright 2013 Alexander Neundorf, <neundorf@kde.org> diff --git a/Modules/CPackBundle.cmake b/Modules/CPackBundle.cmake index d8293c0..d26a0b3 100644 --- a/Modules/CPackBundle.cmake +++ b/Modules/CPackBundle.cmake @@ -33,6 +33,31 @@ # Path to a startup script. This is a path to an executable or script that # will be run whenever an end-user double-clicks the generated bundle in the # OSX Finder. Optional. +# +# .. variable:: CPACK_BUNDLE_APPLE_CERT_APP +# +# The name of your Apple supplied code signing certificate for the application. +# The name usually takes the form "Developer ID Application: [Name]" or +# "3rd Party Mac Developer Application: [Name]". If this variable is not set +# the application will not be signed. +# +# .. variable:: CPACK_BUNDLE_APPLE_ENTITLEMENTS +# +# The name of the plist file that contains your apple entitlements for sandboxing +# your application. This file is required for submission to the Mac App Store. +# +# .. variable:: CPACK_BUNDLE_APPLE_CODESIGN_FILES +# +# A list of additional files that you wish to be signed. You do not need to +# list the main application folder, or the main executable. You should +# list any frameworks and plugins that are included in your app bundle. +# +# .. variable:: CPACK_COMMAND_CODESIGN +# +# Path to the codesign(1) command used to sign applications with an +# Apple cert. This variable can be used to override the automatically +# detected command (or specify its location if the auto-detection fails +# to find it.) #============================================================================= # Copyright 2006-2009 Kitware, Inc. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 4b8dc1e..6f2eeb3 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -96,7 +96,7 @@ # # If this is ``ON`` all components will be downloaded. # By default is ``OFF`` or used value -# from :variable:`CPACK_DOWNLOAD_ALL` if set +# from ``CPACK_DOWNLOAD_ALL`` if set # # Components # """""""""" diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake index 9d23ec0..4b2e0eb 100644 --- a/Modules/CPackNSIS.cmake +++ b/Modules/CPackNSIS.cmake @@ -114,8 +114,8 @@ # installation prefix. Like:: # # set(CPACK_NSIS_MENU_LINKS -# "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" -# "http://www.cmake.org" "CMake Web Site") +# "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" +# "CMake Help" "http://www.cmake.org" "CMake Web Site") # #============================================================================= diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 2864b21..66717ef 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -29,6 +29,7 @@ # However as a handy reminder here comes the list of specific variables: # # .. variable:: CPACK_RPM_PACKAGE_SUMMARY +# CPACK_RPM_<component>_PACKAGE_SUMMARY # # The RPM package summary. # @@ -100,11 +101,13 @@ # * Default : - # # .. variable:: CPACK_RPM_PACKAGE_DESCRIPTION +# CPACK_RPM_<component>_PACKAGE_DESCRIPTION # # RPM package description. # # * Mandatory : YES -# * Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package +# * Default : CPACK_COMPONENT_<compName>_DESCRIPTION (component based installers +# only) if set, CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package # description available" # # .. variable:: CPACK_RPM_COMPRESSION_TYPE @@ -135,6 +138,56 @@ # # rpm -qp --requires file.rpm # +# .. variable:: CPACK_RPM_PACKAGE_REQUIRES_PRE +# +# RPM spec requires(pre) field. +# +# * Mandatory : NO +# * Default : - +# +# May be used to set RPM preinstall dependencies (requires(pre)). Note that you must enclose +# the complete requires string between quotes, for example:: +# +# set(CPACK_RPM_PACKAGE_REQUIRES_PRE "shadow-utils, initscripts") +# +# .. variable:: CPACK_RPM_PACKAGE_REQUIRES_POST +# +# RPM spec requires(post) field. +# +# * Mandatory : NO +# * Default : - +# +# May be used to set RPM postinstall dependencies (requires(post)). Note that you must enclose +# the complete requires string between quotes, for example:: +# +# set(CPACK_RPM_PACKAGE_REQUIRES_POST "shadow-utils, initscripts") +# +# +# .. variable:: CPACK_RPM_PACKAGE_REQUIRES_POSTUN +# +# RPM spec requires(postun) field. +# +# * Mandatory : NO +# * Default : - +# +# May be used to set RPM postuninstall dependencies (requires(postun)). Note that you must enclose +# the complete requires string between quotes, for example:: +# +# set(CPACK_RPM_PACKAGE_REQUIRES_POSTUN "shadow-utils, initscripts") +# +# +# .. variable:: CPACK_RPM_PACKAGE_REQUIRES_PREUN +# +# RPM spec requires(preun) field. +# +# * Mandatory : NO +# * Default : - +# +# May be used to set RPM preuninstall dependencies (requires(preun)). Note that you must enclose +# the complete requires string between quotes, for example:: +# +# set(CPACK_RPM_PACKAGE_REQUIRES_PREUN "shadow-utils, initscripts") +# # .. variable:: CPACK_RPM_PACKAGE_SUGGESTS # # RPM spec suggest field. @@ -384,7 +437,7 @@ if(CPACK_RPM_PACKAGE_DEBUG) OUTPUT_VARIABLE _TMP_LSB_RELEASE_OUTPUT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REPLACE "\n" ", " + string(REGEX REPLACE "\n" ", " LSB_RELEASE_OUTPUT ${_TMP_LSB_RELEASE_OUTPUT}) else () @@ -397,7 +450,7 @@ endif() # to shut down warning about space in buildtree # some recent RPM version should support space in different places. # not checked [yet]. -if(CPACK_TOPLEVEL_DIRECTORY MATCHES " ") +if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.") endif() @@ -414,6 +467,7 @@ endif() # Are we packaging components ? if(CPACK_RPM_PACKAGE_COMPONENT) set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}") + string(TOUPPER ${CPACK_RPM_PACKAGE_COMPONENT} CPACK_RPM_PACKAGE_COMPONENT_UPPER) else() set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "") endif() @@ -430,12 +484,31 @@ set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACK # # CPACK_RPM_PACKAGE_SUMMARY (mandatory) + +# CPACK_RPM_PACKAGE_SUMMARY_ is used only locally so that it can be unset each time before use otherwise +# component packaging could leak variable content between components +unset(CPACK_RPM_PACKAGE_SUMMARY_) +if(CPACK_RPM_PACKAGE_SUMMARY) + set(CPACK_RPM_PACKAGE_SUMMARY_ ${CPACK_RPM_PACKAGE_SUMMARY}) + unset(CPACK_RPM_PACKAGE_SUMMARY) +endif() + +#Check for component summary first. +#If not set, it will use regular package summary logic. +if(CPACK_RPM_PACKAGE_COMPONENT) + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_SUMMARY) + set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_SUMMARY}) + endif() +endif() + if(NOT CPACK_RPM_PACKAGE_SUMMARY) - # if neither var is defined lets use the name as summary - if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) - string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY) - else() + if(CPACK_RPM_PACKAGE_SUMMARY_) + set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_RPM_PACKAGE_SUMMARY_}) + elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY) set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) + else() + # if neither var is defined lets use the name as summary + string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY) endif() endif() @@ -508,12 +581,33 @@ endif() # if it is defined # - set to a default value # -if (NOT CPACK_RPM_PACKAGE_DESCRIPTION) - if (CPACK_PACKAGE_DESCRIPTION_FILE) - file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION) - else () - set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available") - endif () + +# CPACK_RPM_PACKAGE_DESCRIPTION_ is used only locally so that it can be unset each time before use otherwise +# component packaging could leak variable content between components +unset(CPACK_RPM_PACKAGE_DESCRIPTION_) +if(CPACK_RPM_PACKAGE_DESCRIPTION) + set(CPACK_RPM_PACKAGE_DESCRIPTION_ ${CPACK_RPM_PACKAGE_DESCRIPTION}) + unset(CPACK_RPM_PACKAGE_DESCRIPTION) +endif() + +#Check for a component description first. +#If not set, it will use regular package description logic. +if(CPACK_RPM_PACKAGE_COMPONENT) + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_DESCRIPTION) + set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_DESCRIPTION}) + elseif(CPACK_COMPONENT_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_DESCRIPTION) + set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_COMPONENT_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_DESCRIPTION}) + endif() +endif() + +if(NOT CPACK_RPM_PACKAGE_DESCRIPTION) + if(CPACK_RPM_PACKAGE_DESCRIPTION_) + set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_RPM_PACKAGE_DESCRIPTION_}) + elseif(CPACK_PACKAGE_DESCRIPTION_FILE) + file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION) + else () + set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available") + endif () endif () # CPACK_RPM_COMPRESSION_TYPE @@ -556,7 +650,7 @@ endif() # There may be some COMPONENT specific variables as well # If component specific var is not provided we use the global one # for each component -foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV) +foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") endif() @@ -589,12 +683,17 @@ foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC # Transform NAME --> Name e.g. PROVIDES --> Provides # The Upper-case first letter and lowercase tail is the # appropriate value required in the final RPM spec file. - string(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH) - math(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1") - string(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL) + string(SUBSTRING ${_RPM_SPEC_HEADER} 1 -1 _PACKAGE_HEADER_TAIL) string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL) string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME) set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}") + # The following keywords require parentheses around the "pre" or "post" suffix in the final RPM spec file. + set(SCRIPTS_REQUIREMENTS_LIST REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN) + list(FIND SCRIPTS_REQUIREMENTS_LIST ${_RPM_SPEC_HEADER} IS_SCRIPTS_REQUIREMENT_FOUND) + if(NOT ${IS_SCRIPTS_REQUIREMENT_FOUND} EQUAL -1) + string(REPLACE "_" "(" _PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}") + set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME})") + endif() if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") endif() @@ -991,6 +1090,10 @@ Group: \@CPACK_RPM_PACKAGE_GROUP\@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_URL\@ \@TMP_RPM_REQUIRES\@ +\@TMP_RPM_REQUIRES_PRE\@ +\@TMP_RPM_REQUIRES_POST\@ +\@TMP_RPM_REQUIRES_PREUN\@ +\@TMP_RPM_REQUIRES_POSTUN\@ \@TMP_RPM_PROVIDES\@ \@TMP_RPM_OBSOLETES\@ \@TMP_RPM_CONFLICTS\@ @@ -1100,3 +1203,15 @@ else() message(FATAL_ERROR "RPM packaging through alien not done (yet)") endif() endif() + +# reset variables from temporary variables +if(CPACK_RPM_PACKAGE_SUMMARY_) + set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_RPM_PACKAGE_SUMMARY_}) +else() + unset(CPACK_RPM_PACKAGE_SUMMARY) +endif() +if(CPACK_RPM_PACKAGE_DESCRIPTION_) + set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_RPM_PACKAGE_DESCRIPTION_}) +else() + unset(CPACK_RPM_PACKAGE_DESCRIPTION) +endif() diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake index 880a688..de31d2c 100644 --- a/Modules/CheckStructHasMember.cmake +++ b/Modules/CheckStructHasMember.cmake @@ -69,8 +69,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT) ${_INCLUDE_FILES} int main() { - ${_STRUCT}* tmp; - tmp->${_MEMBER}; + (void)((${_STRUCT} *)0)->${_MEMBER}; return 0; } ") diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 44070b8..98fcd0b 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1 +1,2 @@ -include(Compiler/Clang-C) +include(Compiler/Clang) +__compiler_clang(C) diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index 05d3c0b..92119ba 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -21,16 +21,16 @@ set(CMAKE_C_STANDARD_DEFAULT 90) macro(cmake_record_c_compile_features) macro(_get_clang_features std_version list) - record_compiler_features(C "-std=${std_version}" ${list}) + record_compiler_features(C "${std_version}" ${list}) endmacro() if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) - _get_clang_features(c11 CMAKE_C11_COMPILE_FEATURES) + _get_clang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) - _get_clang_features(c99 CMAKE_C99_COMPILE_FEATURES) + _get_clang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_clang_features(c90 CMAKE_C90_COMPILE_FEATURES) + _get_clang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) endif() else() set(_result 0) diff --git a/Modules/Compiler/Clang-CXX-FeatureTests.cmake b/Modules/Compiler/Clang-CXX-FeatureTests.cmake index 4c532fb..df2e1a8 100644 --- a/Modules/Compiler/Clang-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Clang-CXX-FeatureTests.cmake @@ -2,61 +2,9 @@ # Reference: http://clang.llvm.org/cxx_status.html # http://clang.llvm.org/docs/LanguageExtensions.html -set(testable_features - cxx_alias_templates - cxx_alignas - cxx_attributes - cxx_auto_type - cxx_binary_literals - cxx_constexpr - cxx_contextual_conversions - cxx_decltype - cxx_decltype_incomplete_return_types - cxx_default_function_template_args - cxx_defaulted_functions - cxx_delegating_constructors - cxx_deleted_functions - cxx_explicit_conversions - cxx_generalized_initializers - cxx_inheriting_constructors - cxx_lambdas - cxx_local_type_template_args - cxx_noexcept - cxx_nonstatic_member_init - cxx_nullptr - cxx_range_for - cxx_raw_string_literals - cxx_reference_qualified_functions - cxx_relaxed_constexpr - cxx_return_type_deduction - cxx_rvalue_references - cxx_static_assert - cxx_strong_enums - cxx_thread_local - cxx_unicode_literals - cxx_unrestricted_unions - cxx_user_literals - cxx_variable_templates - cxx_variadic_templates -) - set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 304") -foreach(feature ${testable_features}) - set(_cmake_feature_test_${feature} "${_cmake_oldestSupported} && __has_feature(${feature})") -endforeach() - -unset(testable_features) - -set(_cmake_feature_test_cxx_aggregate_default_initializers "${_cmake_oldestSupported} && __has_feature(cxx_aggregate_nsdmi)") - -set(_cmake_feature_test_cxx_trailing_return_types "${_cmake_oldestSupported} && __has_feature(cxx_trailing_return)") -set(_cmake_feature_test_cxx_alignof "${_cmake_oldestSupported} && __has_feature(cxx_alignas)") -set(_cmake_feature_test_cxx_final "${_cmake_oldestSupported} && __has_feature(cxx_override_control)") -set(_cmake_feature_test_cxx_override "${_cmake_oldestSupported} && __has_feature(cxx_override_control)") -set(_cmake_feature_test_cxx_uniform_initialization "${_cmake_oldestSupported} && __has_feature(cxx_generalized_initializers)") -set(_cmake_feature_test_cxx_defaulted_move_initializers "${_cmake_oldestSupported} && __has_feature(cxx_defaulted_functions)") -set(_cmake_feature_test_cxx_lambda_init_captures "${_cmake_oldestSupported} && __has_feature(cxx_init_captures)") +include("${CMAKE_CURRENT_LIST_DIR}/Clang-CXX-TestableFeatures.cmake") set(Clang34_CXX14 "((__clang_major__ * 100) + __clang_minor__) >= 304 && __cplusplus > 201103L") # http://llvm.org/bugs/show_bug.cgi?id=19242 diff --git a/Modules/Compiler/Clang-CXX-TestableFeatures.cmake b/Modules/Compiler/Clang-CXX-TestableFeatures.cmake new file mode 100644 index 0000000..b39475c --- /dev/null +++ b/Modules/Compiler/Clang-CXX-TestableFeatures.cmake @@ -0,0 +1,54 @@ + +set(testable_features + cxx_alias_templates + cxx_alignas + cxx_attributes + cxx_auto_type + cxx_binary_literals + cxx_constexpr + cxx_contextual_conversions + cxx_decltype + cxx_decltype_incomplete_return_types + cxx_default_function_template_args + cxx_defaulted_functions + cxx_delegating_constructors + cxx_deleted_functions + cxx_explicit_conversions + cxx_generalized_initializers + cxx_inheriting_constructors + cxx_lambdas + cxx_local_type_template_args + cxx_noexcept + cxx_nonstatic_member_init + cxx_nullptr + cxx_range_for + cxx_raw_string_literals + cxx_reference_qualified_functions + cxx_relaxed_constexpr + cxx_return_type_deduction + cxx_rvalue_references + cxx_static_assert + cxx_strong_enums + cxx_thread_local + cxx_unicode_literals + cxx_unrestricted_unions + cxx_user_literals + cxx_variable_templates + cxx_variadic_templates +) + +foreach(feature ${testable_features}) + set(_cmake_feature_test_${feature} "${_cmake_oldestSupported} && __has_feature(${feature})") +endforeach() + +unset(testable_features) + +set(_cmake_feature_test_cxx_aggregate_default_initializers "${_cmake_oldestSupported} && __has_feature(cxx_aggregate_nsdmi)") + +set(_cmake_feature_test_cxx_trailing_return_types "${_cmake_oldestSupported} && __has_feature(cxx_trailing_return)") +set(_cmake_feature_test_cxx_alignof "${_cmake_oldestSupported} && __has_feature(cxx_alignas)") +set(_cmake_feature_test_cxx_final "${_cmake_oldestSupported} && __has_feature(cxx_override_control)") +set(_cmake_feature_test_cxx_override "${_cmake_oldestSupported} && __has_feature(cxx_override_control)") +set(_cmake_feature_test_cxx_uniform_initialization "${_cmake_oldestSupported} && __has_feature(cxx_generalized_initializers)") +set(_cmake_feature_test_cxx_defaulted_move_initializers "${_cmake_oldestSupported} && __has_feature(cxx_defaulted_functions)") +set(_cmake_feature_test_cxx_lambda_init_captures "${_cmake_oldestSupported} && __has_feature(cxx_init_captures)") diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 5dd7b4a..780a072 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -35,16 +35,16 @@ set(CMAKE_CXX_STANDARD_DEFAULT 98) macro(cmake_record_cxx_compile_features) macro(_get_clang_features std_version list) - record_compiler_features(CXX "-std=${std_version}" ${list}) + record_compiler_features(CXX "${std_version}" ${list}) endmacro() if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) - _get_clang_features(c++1y CMAKE_CXX14_COMPILE_FEATURES) + _get_clang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) if (_result EQUAL 0) - _get_clang_features(c++11 CMAKE_CXX11_COMPILE_FEATURES) + _get_clang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_clang_features(c++98 CMAKE_CXX98_COMPILE_FEATURES) + _get_clang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() else() set(_result 0) diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 35954be..c4a2ed6 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -17,16 +17,16 @@ set(CMAKE_C_STANDARD_DEFAULT 90) macro(cmake_record_c_compile_features) macro(_get_gcc_features std_version list) - record_compiler_features(C "-std=${std_version}" ${list}) + record_compiler_features(C "${std_version}" ${list}) endmacro() if (UNIX AND NOT APPLE AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - _get_gcc_features(c90 CMAKE_C90_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) - _get_gcc_features(c99 CMAKE_C99_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_gcc_features(c11 CMAKE_C11_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) endif() else() set(_result 0) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 14dc76a..422bacd 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -24,7 +24,10 @@ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3) set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") endif() -if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) +if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14") + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14") +elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y") set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y") endif() @@ -33,19 +36,19 @@ set(CMAKE_CXX_STANDARD_DEFAULT 98) macro(cmake_record_cxx_compile_features) macro(_get_gcc_features std_version list) - record_compiler_features(CXX "-std=${std_version}" ${list}) + record_compiler_features(CXX "${std_version}" ${list}) endmacro() set(_result 0) if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - _get_gcc_features(c++1y CMAKE_CXX14_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) if (_result EQUAL 0) - _get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_gcc_features(c++98 CMAKE_CXX98_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() else() set(_result 0) diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake index 313ccbd..dfd7927 100644 --- a/Modules/Compiler/GNU-Fortran.cmake +++ b/Modules/Compiler/GNU-Fortran.cmake @@ -8,10 +8,5 @@ set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form") set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os") set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3") -# We require updates to CMake C++ code to support preprocessing rules -# for Fortran. -set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE) -set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE) - # Fortran-specific feature flags. set(CMAKE_Fortran_MODDIR_FLAG -J) diff --git a/Modules/Compiler/HP-Fortran.cmake b/Modules/Compiler/HP-Fortran.cmake index cc56b46..ad821ab 100644 --- a/Modules/Compiler/HP-Fortran.cmake +++ b/Modules/Compiler/HP-Fortran.cmake @@ -1,3 +1,6 @@ set(CMAKE_Fortran_VERBOSE_FLAG "-v") set(CMAKE_Fortran_FORMAT_FIXED_FLAG "+source=fixed") set(CMAKE_Fortran_FORMAT_FREE_FLAG "+source=free") + +set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") +set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake index 84f6182..9ebac5a 100644 --- a/Modules/Compiler/Intel-Fortran.cmake +++ b/Modules/Compiler/Intel-Fortran.cmake @@ -7,3 +7,6 @@ set(CMAKE_Fortran_MODDIR_FLAG "-module ") set(CMAKE_Fortran_VERBOSE_FLAG "-v") set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free") + +set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake index 264c23e..2866254 100644 --- a/Modules/Compiler/PGI-Fortran.cmake +++ b/Modules/Compiler/PGI-Fortran.cmake @@ -7,9 +7,4 @@ set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform") set(CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT} -Mpreprocess -Kieee") set(CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT} -Mbounds") -# We require updates to CMake C++ code to support preprocessing rules -# for Fortran. -set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE) -set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE) - set(CMAKE_Fortran_MODDIR_FLAG "-module ") diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake index 18e75b9..c38d5a5 100644 --- a/Modules/Compiler/SunPro-Fortran.cmake +++ b/Modules/Compiler/SunPro-Fortran.cmake @@ -16,3 +16,6 @@ set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG") set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG") set(CMAKE_Fortran_MODDIR_FLAG "-moddir=") set(CMAKE_Fortran_MODPATH_FLAG "-M") + +set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake index f1c9158..ae9df4e 100644 --- a/Modules/Compiler/XL-Fortran.cmake +++ b/Modules/Compiler/XL-Fortran.cmake @@ -12,6 +12,6 @@ set(CMAKE_Fortran_DEFINE_FLAG "-WF,-D") # -qhalt=e = Halt on error messages (rather than just severe errors) set(CMAKE_Fortran_FLAGS_INIT "-qthreaded -qhalt=e") -# We require updates to CMake C++ code to support preprocessing rules for Fortran. +# xlf: 1501-214 (W) command option E reserved for future use - ignored set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE) set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE) diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index eabfc6b..aebae27 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -29,7 +29,7 @@ ); name = CompilerId@id_lang@; productName = CompilerId@id_lang@; - productType = "com.apple.product-type.tool"; + productType = "@id_product_type@"; }; 08FB7793FE84155DC02AAC07 = { isa = PBXProject; @@ -81,6 +81,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; ONLY_ACTIVE_ARCH = YES; + @id_code_sign_identity@ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; SYMROOT = .; @id_toolset@ diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index 9b31567..b1a2370 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -37,7 +37,8 @@ # # :: # -# FIXUP_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>]) +# FIXUP_QT4_EXECUTABLE(<executable> +# [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>]) # # Copies Qt plugins, writes a Qt configuration file (if needed) and # fixes up a Qt4 executable using BundleUtilities so it is standalone @@ -63,7 +64,8 @@ # # :: # -# INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var <plugins_dir> <component> <configurations>) +# INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var +# <plugins_dir> <component> <configurations>) # # Install (or copy) a resolved <plugin> to the default plugins directory # (or <plugins_dir>) relative to <executable> and store the result in @@ -77,7 +79,8 @@ # # :: # -# INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var <plugins_dir> <component>) +# INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var +# <plugins_dir> <component>) # # Install (or copy) an unresolved <plugin> to the default plugins # directory (or <plugins_dir>) relative to <executable> and store the @@ -86,7 +89,8 @@ # # :: # -# INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>]) +# INSTALL_QT4_EXECUTABLE(<executable> +# [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>]) # # Installs Qt plugins, writes a Qt configuration file (if needed) and # fixes up a Qt4 executable using BundleUtilities so it is standalone diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index d6a6b72..32f6d2c 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1,187 +1,334 @@ -#.rst: -# ExternalProject -# --------------- -# -# Create custom targets to build projects in external trees -# -# The ``ExternalProject_Add`` function creates a custom target to drive -# download, update/patch, configure, build, install and test steps of an -# external project: -# -# .. code-block:: cmake -# -# ExternalProject_Add(<name> # Name for custom target -# [DEPENDS projects...] # Targets on which the project depends -# [PREFIX dir] # Root dir for entire project -# [LIST_SEPARATOR sep] # Sep to be replaced by ; in cmd lines -# [TMP_DIR dir] # Directory to store temporary files -# [STAMP_DIR dir] # Directory to store step timestamps -# [EXCLUDE_FROM_ALL 1] # The "all" target does not depend on this -# #--Download step-------------- -# [DOWNLOAD_NAME fname] # File name to store (if not end of URL) -# [DOWNLOAD_DIR dir] # Directory to store downloaded files -# [DOWNLOAD_COMMAND cmd...] # Command to download source tree -# [DOWNLOAD_NO_PROGRESS 1] # Disable download progress reports -# [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository -# [CVS_MODULE mod] # Module to checkout from CVS repo -# [CVS_TAG tag] # Tag to checkout from CVS repo -# [SVN_REPOSITORY url] # URL of Subversion repo -# [SVN_REVISION -r<rev>] # Revision to checkout from Subversion repo -# [SVN_USERNAME john ] # Username for Subversion checkout and update -# [SVN_PASSWORD doe ] # Password for Subversion checkout and update -# [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate -# [GIT_REPOSITORY url] # URL of git repo -# [GIT_TAG tag] # Git branch name, commit id or tag -# [GIT_SUBMODULES modules...] # Git submodules that shall be updated, all if empty -# [HG_REPOSITORY url] # URL of mercurial repo -# [HG_TAG tag] # Mercurial branch name, commit id or tag -# [URL /.../src.tgz] # Full path or URL of source -# [URL_HASH ALGO=value] # Hash of file at URL -# [URL_MD5 md5] # Equivalent to URL_HASH MD5=md5 -# [TLS_VERIFY bool] # Should certificate for https be checked -# [TLS_CAINFO file] # Path to a certificate authority file -# [TIMEOUT seconds] # Time allowed for file download operations -# #--Update/Patch step---------- -# [UPDATE_COMMAND cmd...] # Source work-tree update command -# [PATCH_COMMAND cmd...] # Command to patch downloaded source -# #--Configure step------------- -# [SOURCE_DIR dir] # Source dir to be used for build -# [CONFIGURE_COMMAND cmd...] # Build tree configuration command -# [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable -# [CMAKE_GENERATOR gen] # Specify generator for native build -# [CMAKE_GENERATOR_PLATFORM p] # Generator-specific platform name -# [CMAKE_GENERATOR_TOOLSET t] # Generator-specific toolset name -# [CMAKE_ARGS args...] # Arguments to CMake command line -# [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on -# #--Build step----------------- -# [BINARY_DIR dir] # Specify build dir location -# [BUILD_COMMAND cmd...] # Command to drive the native build -# [BUILD_IN_SOURCE 1] # Use source dir for build dir -# [BUILD_ALWAYS 1] # No stamp file, build step always runs -# #--Install step--------------- -# [INSTALL_DIR dir] # Installation prefix -# [INSTALL_COMMAND cmd...] # Command to drive install after build -# #--Test step------------------ -# [TEST_BEFORE_INSTALL 1] # Add test step executed before install step -# [TEST_AFTER_INSTALL 1] # Add test step executed after install step -# [TEST_COMMAND cmd...] # Command to drive test -# #--Output logging------------- -# [LOG_DOWNLOAD 1] # Wrap download in script to log output -# [LOG_UPDATE 1] # Wrap update in script to log output -# [LOG_CONFIGURE 1] # Wrap configure in script to log output -# [LOG_BUILD 1] # Wrap build in script to log output -# [LOG_TEST 1] # Wrap test in script to log output -# [LOG_INSTALL 1] # Wrap install in script to log output -# #--Custom targets------------- -# [STEP_TARGETS st1 st2 ...] # Generate custom targets for these steps -# ) -# -# The ``*_DIR`` options specify directories for the project, with default -# directories computed as follows. If the ``PREFIX`` option is given to -# ``ExternalProject_Add()`` or the ``EP_PREFIX`` directory property is set, -# then an external project is built and installed under the specified prefix:: -# -# TMP_DIR = <prefix>/tmp -# STAMP_DIR = <prefix>/src/<name>-stamp -# DOWNLOAD_DIR = <prefix>/src -# SOURCE_DIR = <prefix>/src/<name> -# BINARY_DIR = <prefix>/src/<name>-build -# INSTALL_DIR = <prefix> -# -# Otherwise, if the ``EP_BASE`` directory property is set then components -# of an external project are stored under the specified base:: -# -# TMP_DIR = <base>/tmp/<name> -# STAMP_DIR = <base>/Stamp/<name> -# DOWNLOAD_DIR = <base>/Download/<name> -# SOURCE_DIR = <base>/Source/<name> -# BINARY_DIR = <base>/Build/<name> -# INSTALL_DIR = <base>/Install/<name> -# -# If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified then the -# default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are -# interpreted with respect to the build directory corresponding to the -# source directory in which ``ExternalProject_Add`` is invoked. -# -# If ``SOURCE_DIR`` is explicitly set to an existing directory the project -# will be built from it. Otherwise a download step must be specified -# using one of the ``DOWNLOAD_COMMAND``, ``CVS_*``, ``SVN_*``, or ``URL`` -# options. The ``URL`` option may refer locally to a directory or source -# tarball, or refer to a remote tarball (e.g. ``http://.../src.tgz``). -# -# The ``ExternalProject_Add_Step`` function adds a custom step to an -# external project: -# -# .. code-block:: cmake -# -# ExternalProject_Add_Step(<name> <step> # Names of project and custom step -# [COMMAND cmd...] # Command line invoked by this step -# [COMMENT "text..."] # Text printed when step executes -# [DEPENDEES steps...] # Steps on which this step depends -# [DEPENDERS steps...] # Steps that depend on this step -# [DEPENDS files...] # Files on which this step depends -# [ALWAYS 1] # No stamp file, step always runs -# [EXCLUDE_FROM_MAIN 1] # Main target does not depend on this step -# [WORKING_DIRECTORY dir] # Working directory for command -# [LOG 1] # Wrap step in script to log output -# ) -# -# The command line, comment, and working directory of every standard and -# custom step is processed to replace tokens ``<SOURCE_DIR>``, -# ``<BINARY_DIR>``, ``<INSTALL_DIR>``, and ``<TMP_DIR>`` with -# corresponding property values. -# -# Any builtin step that specifies a ``<step>_COMMAND cmd...`` or custom -# step that specifies a ``COMMAND cmd...`` may specify additional command -# lines using the form ``COMMAND cmd...``. At build time the commands -# will be executed in order and aborted if any one fails. For example:: -# -# ... BUILD_COMMAND make COMMAND echo done ... -# -# specifies to run ``make`` and then ``echo done`` during the build step. -# Whether the current working directory is preserved between commands is -# not defined. Behavior of shell operators like ``&&`` is not defined. -# -# The ``ExternalProject_Get_Property`` function retrieves external project -# target properties:: -# -# ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]]) -# -# It stores property values in variables of the same name. Property -# names correspond to the keyword argument names of -# ``ExternalProject_Add``. -# -# The ``ExternalProject_Add_StepTargets`` function generates custom -# targets for the steps listed:: -# -# ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]]) -# -# If ``STEP_TARGETS`` is set then ``ExternalProject_Add_StepTargets`` is -# automatically called at the end of matching calls to -# ``ExternalProject_Add_Step``. Pass ``STEP_TARGETS`` explicitly to -# individual ``ExternalProject_Add`` calls, or implicitly to all -# ``ExternalProject_Add`` calls by setting the directory property -# ``EP_STEP_TARGETS``. -# -# If ``STEP_TARGETS`` is not set, clients may still manually call -# ``ExternalProject_Add_StepTargets`` after calling -# ``ExternalProject_Add`` or ``ExternalProject_Add_Step``. -# -# This functionality is provided to make it easy to drive the steps -# independently of each other by specifying targets on build command -# lines. For example, you may be submitting to a sub-project based -# dashboard, where you want to drive the configure portion of the build, -# then submit to the dashboard, followed by the build portion, followed -# by tests. If you invoke a custom target that depends on a step -# halfway through the step dependency chain, then all the previous steps -# will also run to ensure everything is up to date. -# -# For example, to drive configure, build and test steps independently -# for each ``ExternalProject_Add`` call in your project, write the following -# line prior to any ``ExternalProject_Add`` calls in your ``CMakeLists.txt`` -# file:: -# -# set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) +#[=======================================================================[.rst: +ExternalProject +--------------- + +Create custom targets to build projects in external trees + +.. command:: ExternalProject_Add + + The ``ExternalProject_Add`` function creates a custom target to drive + download, update/patch, configure, build, install and test steps of an + external project:: + + ExternalProject_Add(<name> [<option>...]) + + General options are: + + ``DEPENDS <projects>...`` + Targets on which the project depends + ``PREFIX <dir>`` + Root dir for entire project + ``LIST_SEPARATOR <sep>`` + Sep to be replaced by ; in cmd lines + ``TMP_DIR <dir>`` + Directory to store temporary files + ``STAMP_DIR <dir>`` + Directory to store step timestamps + ``EXCLUDE_FROM_ALL 1`` + The "all" target does not depend on this + + Download step options are: + + ``DOWNLOAD_NAME <fname>`` + File name to store (if not end of URL) + ``DOWNLOAD_DIR <dir>`` + Directory to store downloaded files + ``DOWNLOAD_COMMAND <cmd>...`` + Command to download source tree + ``DOWNLOAD_NO_PROGRESS 1`` + Disable download progress reports + ``CVS_REPOSITORY <cvsroot>`` + CVSROOT of CVS repository + ``CVS_MODULE <mod>`` + Module to checkout from CVS repo + ``CVS_TAG <tag>`` + Tag to checkout from CVS repo + ``SVN_REPOSITORY <url>`` + URL of Subversion repo + ``SVN_REVISION -r<rev>`` + Revision to checkout from Subversion repo + ``SVN_USERNAME <username>`` + Username for Subversion checkout and update + ``SVN_PASSWORD <password>`` + Password for Subversion checkout and update + ``SVN_TRUST_CERT 1`` + Trust the Subversion server site certificate + ``GIT_REPOSITORY <url>`` + URL of git repo + ``GIT_TAG <tag>`` + Git branch name, commit id or tag + ``GIT_SUBMODULES <module>...`` + Git submodules that shall be updated, all if empty + ``HG_REPOSITORY <url>`` + URL of mercurial repo + ``HG_TAG <tag>`` + Mercurial branch name, commit id or tag + ``URL /.../src.tgz`` + Full path or URL of source + ``URL_HASH ALGO=value`` + Hash of file at URL + ``URL_MD5 md5`` + Equivalent to URL_HASH MD5=md5 + ``TLS_VERIFY <bool>`` + Should certificate for https be checked + ``TLS_CAINFO <file>`` + Path to a certificate authority file + ``TIMEOUT <seconds>`` + Time allowed for file download operations + + Update/Patch step options are: + + ``UPDATE_COMMAND <cmd>...`` + Source work-tree update command + ``UPDATE_DISCONNECTED 1`` + Never update automatically from the remote repository + ``PATCH_COMMAND <cmd>...`` + Command to patch downloaded source + + Configure step options are: + + ``SOURCE_DIR <dir>`` + Source dir to be used for build + ``CONFIGURE_COMMAND <cmd>...`` + Build tree configuration command + ``CMAKE_COMMAND /.../cmake`` + Specify alternative cmake executable + ``CMAKE_GENERATOR <gen>`` + Specify generator for native build + ``CMAKE_GENERATOR_PLATFORM <platform>`` + Generator-specific platform name + ``CMAKE_GENERATOR_TOOLSET <toolset>`` + Generator-specific toolset name + ``CMAKE_ARGS <arg>...`` + Arguments to CMake command line. + These arguments are passed to CMake command line, and can contain + arguments other than cache values, see also + :manual:`CMake Options <cmake(1)>`. Arguments in the form + ``-Dvar:string=on`` are always passed to the command line, and + therefore cannot be changed by the user. + ``CMAKE_CACHE_ARGS <arg>...`` + Initial cache arguments, of the form ``-Dvar:string=on``. + These arguments are written in a pre-load a script that populates + CMake cache, see also :manual:`cmake -C <cmake(1)>`. This allows to + overcome command line length limits. + These arguments are :command:`set` using the ``FORCE`` argument, + and therefore cannot be changed by the user. + ``CMAKE_CACHE_DEFAULT_ARGS <arg>...`` + Initial default cache arguments, of the form ``-Dvar:string=on``. + These arguments are written in a pre-load a script that populates + CMake cache, see also :manual:`cmake -C <cmake(1)>`. This allows to + overcome command line length limits. + These arguments can be used as default value that will be set if no + previous value is found in the cache, and that the user can change + later. + + Build step options are: + + ``BINARY_DIR <dir>`` + Specify build dir location + ``BUILD_COMMAND <cmd>...`` + Command to drive the native build + ``BUILD_IN_SOURCE 1`` + Use source dir for build dir + ``BUILD_ALWAYS 1`` + No stamp file, build step always runs + + Install step options are: + + ``INSTALL_DIR <dir>`` + Installation prefix + ``INSTALL_COMMAND <cmd>...`` + Command to drive install after build + + Test step options are: + + ``TEST_BEFORE_INSTALL 1`` + Add test step executed before install step + ``TEST_AFTER_INSTALL 1`` + Add test step executed after install step + ``TEST_COMMAND <cmd>...`` + Command to drive test + + Output logging options are: + + ``LOG_DOWNLOAD 1`` + Wrap download in script to log output + ``LOG_UPDATE 1`` + Wrap update in script to log output + ``LOG_CONFIGURE 1`` + Wrap configure in script to log output + ``LOG_BUILD 1`` + Wrap build in script to log output + ``LOG_TEST 1`` + Wrap test in script to log output + ``LOG_INSTALL 1`` + Wrap install in script to log output + + Other options are: + + ``STEP_TARGETS <step-target>...`` + Generate custom targets for these steps + ``INDEPENDENT_STEP_TARGETS <step-target>...`` + Generate custom targets for these steps that do not depend on other + external projects even if a dependency is set + + The ``*_DIR`` options specify directories for the project, with default + directories computed as follows. If the ``PREFIX`` option is given to + ``ExternalProject_Add()`` or the ``EP_PREFIX`` directory property is set, + then an external project is built and installed under the specified prefix:: + + TMP_DIR = <prefix>/tmp + STAMP_DIR = <prefix>/src/<name>-stamp + DOWNLOAD_DIR = <prefix>/src + SOURCE_DIR = <prefix>/src/<name> + BINARY_DIR = <prefix>/src/<name>-build + INSTALL_DIR = <prefix> + + Otherwise, if the ``EP_BASE`` directory property is set then components + of an external project are stored under the specified base:: + + TMP_DIR = <base>/tmp/<name> + STAMP_DIR = <base>/Stamp/<name> + DOWNLOAD_DIR = <base>/Download/<name> + SOURCE_DIR = <base>/Source/<name> + BINARY_DIR = <base>/Build/<name> + INSTALL_DIR = <base>/Install/<name> + + If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified then the + default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are + interpreted with respect to the build directory corresponding to the + source directory in which ``ExternalProject_Add`` is invoked. + + If ``SOURCE_DIR`` is explicitly set to an existing directory the project + will be built from it. Otherwise a download step must be specified + using one of the ``DOWNLOAD_COMMAND``, ``CVS_*``, ``SVN_*``, or ``URL`` + options. The ``URL`` option may refer locally to a directory or source + tarball, or refer to a remote tarball (e.g. ``http://.../src.tgz``). + + If ``UPDATE_DISCONNECTED`` is set, the update step is not executed + automatically when building the main target. The update step can still + be added as a step target and called manually. This is useful if you + want to allow to build the project when you are disconnected from the + network (you might still need the network for the download step). + This is disabled by default. + The directory property ``EP_UPDATE_DISCONNECTED`` can be used to change + the default value for all the external projects in the current + directory and its subdirectories. + +.. command:: ExternalProject_Add_Step + + The ``ExternalProject_Add_Step`` function adds a custom step to an + external project:: + + ExternalProject_Add_Step(<name> <step> [<option>...]) + + Options are: + + ``COMMAND <cmd>...`` + Command line invoked by this step + ``COMMENT "<text>..."`` + Text printed when step executes + ``DEPENDEES <step>...`` + Steps on which this step depends + ``DEPENDERS <step>...`` + Steps that depend on this step + ``DEPENDS <file>...`` + Files on which this step depends + ``ALWAYS 1`` + No stamp file, step always runs + ``EXCLUDE_FROM_MAIN 1`` + Main target does not depend on this step + ``WORKING_DIRECTORY <dir>`` + Working directory for command + ``LOG 1`` + Wrap step in script to log output + + The command line, comment, and working directory of every standard and + custom step is processed to replace tokens ``<SOURCE_DIR>``, + ``<BINARY_DIR>``, ``<INSTALL_DIR>``, and ``<TMP_DIR>`` with + corresponding property values. + +Any builtin step that specifies a ``<step>_COMMAND cmd...`` or custom +step that specifies a ``COMMAND cmd...`` may specify additional command +lines using the form ``COMMAND cmd...``. At build time the commands +will be executed in order and aborted if any one fails. For example:: + + ... BUILD_COMMAND make COMMAND echo done ... + +specifies to run ``make`` and then ``echo done`` during the build step. +Whether the current working directory is preserved between commands is +not defined. Behavior of shell operators like ``&&`` is not defined. + +.. command:: ExternalProject_Get_Property + + The ``ExternalProject_Get_Property`` function retrieves external project + target properties:: + + ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]]) + + It stores property values in variables of the same name. Property + names correspond to the keyword argument names of + ``ExternalProject_Add``. + +.. command:: ExternalProject_Add_StepTargets + + The ``ExternalProject_Add_StepTargets`` function generates custom + targets for the steps listed:: + + ExternalProject_Add_StepTargets(<name> [NO_DEPENDS] [step1 [step2 [...]]]) + +If ``NO_DEPENDS`` is set, the target will not depend on the +dependencies of the complete project. This is usually safe to use for +the download, update, and patch steps that do not require that all the +dependencies are updated and built. Using ``NO_DEPENDS`` for other +of the default steps might break parallel builds, so you should avoid, +it. For custom steps, you should consider whether or not the custom +commands requires that the dependencies are configured, built and +installed. + +If ``STEP_TARGETS`` or ``INDEPENDENT_STEP_TARGETS`` is set then +``ExternalProject_Add_StepTargets`` is automatically called at the end +of matching calls to ``ExternalProject_Add_Step``. Pass +``STEP_TARGETS`` or ``INDEPENDENT_STEP_TARGETS`` explicitly to +individual ``ExternalProject_Add`` calls, or implicitly to all +``ExternalProject_Add`` calls by setting the directory properties +``EP_STEP_TARGETS`` and ``EP_INDEPENDENT_STEP_TARGETS``. The +``INDEPENDENT`` version of the argument and of the property will call +``ExternalProject_Add_StepTargets`` with the ``NO_DEPENDS`` argument. + +If ``STEP_TARGETS`` and ``INDEPENDENT_STEP_TARGETS`` are not set, +clients may still manually call ``ExternalProject_Add_StepTargets`` +after calling ``ExternalProject_Add`` or ``ExternalProject_Add_Step``. + +This functionality is provided to make it easy to drive the steps +independently of each other by specifying targets on build command +lines. For example, you may be submitting to a sub-project based +dashboard, where you want to drive the configure portion of the build, +then submit to the dashboard, followed by the build portion, followed +by tests. If you invoke a custom target that depends on a step +halfway through the step dependency chain, then all the previous steps +will also run to ensure everything is up to date. + +For example, to drive configure, build and test steps independently +for each ``ExternalProject_Add`` call in your project, write the following +line prior to any ``ExternalProject_Add`` calls in your ``CMakeLists.txt`` +file:: + + set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) + +.. command:: ExternalProject_Add_StepDependencies + + The ``ExternalProject_Add_StepDependencies`` function add some + dependencies for some external project step:: + + ExternalProject_Add_StepDependencies(<name> <step> [target1 [target2 [...]]]) + + This function takes care to set both target and file level + dependencies, and will ensure that parallel builds will not break. + It should be used instead of :command:`add_dependencies()` when adding + a dependency for some of the step targets generated by + ``ExternalProject``. +#]=======================================================================] #============================================================================= # Copyright 2008-2013 Kitware, Inc. @@ -200,9 +347,9 @@ math(EXPR _ep_documentation_line_count "${CMAKE_CURRENT_LIST_LINE} - 16") file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines LIMIT_COUNT ${_ep_documentation_line_count} - REGEX "^# ( \\[[A-Z0-9_]+ [^]]*\\] +#.*$|[A-Za-z0-9_]+\\()") + REGEX "^\\.\\. command:: [A-Za-z0-9_]+|^ ``[A-Z0-9_]+ .*``$") foreach(line IN LISTS lines) - if("${line}" MATCHES "^# ([A-Za-z0-9_]+)\\(") + if("${line}" MATCHES "^\\.\\. command:: ([A-Za-z0-9_]+)") if(_ep_func) set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$") endif() @@ -210,8 +357,8 @@ foreach(line IN LISTS lines) #message("function [${_ep_func}]") set(_ep_keywords_${_ep_func} "^(") set(_ep_keyword_sep) - else() - string(REGEX REPLACE "^# \\[([A-Z0-9_]+) .*" "\\1" _ep_key "${line}") + elseif("${line}" MATCHES "^ ``([A-Z0-9_]+) .*``$") + set(_ep_key "${CMAKE_MATCH_1}") #message(" keyword [${_ep_key}]") set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}}${_ep_keyword_sep}${_ep_key}") @@ -290,10 +437,26 @@ define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED BRIEF_DOCS "List of ExternalProject steps that automatically get corresponding targets" FULL_DOCS + "These targets will be dependent on the main target dependencies" + "See documentation of the ExternalProject_Add_StepTargets() function in the " + "ExternalProject module." + ) + +define_property(DIRECTORY PROPERTY "EP_INDEPENDENT_STEP_TARGETS" INHERITED + BRIEF_DOCS + "List of ExternalProject steps that automatically get corresponding targets" + FULL_DOCS + "These targets will not be dependent on the main target dependencies" "See documentation of the ExternalProject_Add_StepTargets() function in the " "ExternalProject module." ) +define_property(DIRECTORY PROPERTY "EP_UPDATE_DISCONNECTED" INHERITED + BRIEF_DOCS "Never update automatically from the remote repo." + FULL_DOCS + "See documentation of the ExternalProject_Add() function in the " + "ExternalProject module." + ) function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_submodules src_name work_dir gitclone_infofile gitclone_stampfile) file(WRITE ${script_filename} @@ -628,6 +791,19 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p set(show_progress "SHOW_PROGRESS") endif() + if("${hash}" MATCHES "${_ep_hash_regex}") + string(CONCAT hash_check + "if(EXISTS \"${local}\")\n" + " file(\"${CMAKE_MATCH_1}\" \"${local}\" hash_value)\n" + " if(\"x\${hash_value}\" STREQUAL \"x${CMAKE_MATCH_2}\")\n" + " return()\n" + " endif()\n" + "endif()\n" + ) + else() + set(hash_check "") + endif() + # check for curl globals in the project if(DEFINED CMAKE_TLS_VERIFY) set(tls_verify "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})") @@ -651,7 +827,7 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p endif() file(WRITE ${script_filename} -"message(STATUS \"downloading... +"${hash_check}message(STATUS \"downloading... src='${remote}' dst='${local}' timeout='${timeout_msg}'\") @@ -897,17 +1073,20 @@ macro(_ep_replace_location_tags target_name) endmacro() -function(_ep_write_initial_cache target_name script_filename args) - # Write out values into an initial cache, that will be passed to CMake with -C +function(_ep_command_line_to_initial_cache var args force) set(script_initial_cache "") set(regex "^([^:]+):([^=]+)=(.*)$") set(setArg "") + set(forceArg "") + if(force) + set(forceArg "FORCE") + endif() foreach(line ${args}) if("${line}" MATCHES "^-D(.*)") set(line "${CMAKE_MATCH_1}") if(setArg) # This is required to build up lists in variables, or complete an entry - set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)") + set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})") set(script_initial_cache "${script_initial_cache}\n${setArg}") set(accumulator "") set(setArg "") @@ -927,9 +1106,15 @@ function(_ep_write_initial_cache target_name script_filename args) endforeach() # Catch the final line of the args if(setArg) - set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)") + set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})") set(script_initial_cache "${script_initial_cache}\n${setArg}") endif() + set(${var} ${script_initial_cache} PARENT_SCOPE) +endfunction() + + +function(_ep_write_initial_cache target_name script_filename script_initial_cache) + # Write out values into an initial cache, that will be passed to CMake with -C # Replace location tags. _ep_replace_location_tags(${target_name} script_initial_cache) # Write out the initial cache file to the location specified. @@ -1167,19 +1352,28 @@ endfunction() function(ExternalProject_Add_StepTargets name) set(steps ${ARGN}) - + if("${ARGV1}" STREQUAL "NO_DEPENDS") + set(no_deps 1) + list(REMOVE_AT steps 0) + endif() foreach(step ${steps}) + if(no_deps AND "${step}" MATCHES "^(configure|build|install|test)$") + message(AUTHOR_WARNING "Using NO_DEPENDS for \"${step}\" step might break parallel builds") + endif() _ep_get_step_stampfile(${name} ${step} stamp_file) add_custom_target(${name}-${step} DEPENDS ${stamp_file}) + set_property(TARGET ${name}-${step} PROPERTY _EP_IS_EXTERNAL_PROJECT_STEP 1) set_property(TARGET ${name}-${step} PROPERTY LABELS ${name}) set_property(TARGET ${name}-${step} PROPERTY FOLDER "ExternalProjectTargets/${name}") # Depend on other external projects (target-level). - get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS) - foreach(arg IN LISTS deps) - add_dependencies(${name}-${step} ${arg}) - endforeach() + if(NOT no_deps) + get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS) + foreach(arg IN LISTS deps) + add_dependencies(${name}-${step} ${arg}) + endforeach() + endif() endforeach() endfunction() @@ -1261,6 +1455,15 @@ function(ExternalProject_Add_Step name step) _ep_write_log_script(${name} ${step} command) endif() + if("${command}" STREQUAL "") + # Some generators (i.e. Xcode) will not generate a file level target + # if no command is set, and therefore the dependencies on this + # target will be broken. + # The empty command is replaced by an echo command here in order to + # avoid this issue. + set(command ${CMAKE_COMMAND} -E echo_append) + endif() + add_custom_command( OUTPUT ${stamp_file} COMMENT ${comment} @@ -1270,6 +1473,7 @@ function(ExternalProject_Add_Step name step) WORKING_DIRECTORY ${work_dir} VERBATIM ) + set_property(TARGET ${name} APPEND PROPERTY _EP_STEPS ${step}) # Add custom "step target"? get_property(step_targets TARGET ${name} PROPERTY _EP_STEP_TARGETS) @@ -1282,6 +1486,60 @@ function(ExternalProject_Add_Step name step) break() endif() endforeach() + + get_property(independent_step_targets TARGET ${name} PROPERTY _EP_INDEPENDENT_STEP_TARGETS) + if(NOT independent_step_targets) + get_property(independent_step_targets DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS) + endif() + foreach(st ${independent_step_targets}) + if("${st}" STREQUAL "${step}") + ExternalProject_Add_StepTargets(${name} NO_DEPENDS ${step}) + break() + endif() + endforeach() +endfunction() + + +function(ExternalProject_Add_StepDependencies name step) + set(dependencies ${ARGN}) + + # Sanity checks on "name" and "step". + if(NOT TARGET ${name}) + message(FATAL_ERROR "Cannot find target \"${name}\". Perhaps it has not yet been created using ExternalProject_Add.") + endif() + + get_property(is_ep TARGET ${name} PROPERTY _EP_IS_EXTERNAL_PROJECT) + if(NOT is_ep) + message(FATAL_ERROR "Target \"${name}\" was not generated by ExternalProject_Add.") + endif() + + get_property(steps TARGET ${name} PROPERTY _EP_STEPS) + list(FIND steps ${step} is_step) + if(NOT is_step) + message(FATAL_ERROR "External project \"${name}\" does not have a step \"${step}\".") + endif() + + if(TARGET ${name}-${step}) + get_property(is_ep_step TARGET ${name}-${step} PROPERTY _EP_IS_EXTERNAL_PROJECT_STEP) + if(NOT is_ep_step) + message(FATAL_ERROR "Target \"${name}\" was not generated by ExternalProject_Add_StepTargets.") + endif() + endif() + + # Always add file-level dependency, but add target-level dependency + # only if the target exists for that step. + _ep_get_step_stampfile(${name} ${step} stamp_file) + foreach(dep ${dependencies}) + add_custom_command(APPEND + OUTPUT ${stamp_file} + DEPENDS ${dep}) + if(TARGET ${name}-${step}) + foreach(dep ${dependencies}) + add_dependencies(${name}-${step} ${dep}) + endforeach() + endif() + endforeach() + endfunction() @@ -1599,6 +1857,12 @@ function(_ep_add_update_command name) get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY) get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY) get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY ) + get_property(update_disconnected_set TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED SET) + if(update_disconnected_set) + get_property(update_disconnected TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED) + else() + get_property(update_disconnected DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED) + endif() set(work_dir) set(comment) @@ -1688,10 +1952,26 @@ Update to Mercurial >= 2.1.1. COMMENT ${comment} COMMAND ${cmd} ALWAYS ${always} + EXCLUDE_FROM_MAIN ${update_disconnected} WORKING_DIRECTORY ${work_dir} DEPENDEES download ${log} ) + + if(always AND update_disconnected) + _ep_get_step_stampfile(${name} skip-update skip-update_stamp_file) + string(REPLACE "Performing" "Skipping" comment "${comment}") + ExternalProject_Add_Step(${name} skip-update + COMMENT ${comment} + ALWAYS 1 + EXCLUDE_FROM_MAIN 1 + WORKING_DIRECTORY ${work_dir} + DEPENDEES download + ${log} + ) + set_property(SOURCE ${skip-update_stamp_file} PROPERTY SYMBOLIC 1) + endif() + endfunction() @@ -1744,11 +2024,20 @@ function(_ep_add_configure_command name) get_property(cmake_args TARGET ${name} PROPERTY _EP_CMAKE_ARGS) list(APPEND cmd ${cmake_args}) - # If there are any CMAKE_CACHE_ARGS, write an initial cache and use it + # If there are any CMAKE_CACHE_ARGS or CMAKE_CACHE_DEFAULT_ARGS, + # write an initial cache and use it get_property(cmake_cache_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_ARGS) - if(cmake_cache_args) + get_property(cmake_cache_default_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_DEFAULT_ARGS) + + if(cmake_cache_args OR cmake_cache_default_args) set(_ep_cache_args_script "${tmp_dir}/${name}-cache.cmake") - _ep_write_initial_cache(${name} "${_ep_cache_args_script}" "${cmake_cache_args}") + if(cmake_cache_args) + _ep_command_line_to_initial_cache(script_initial_cache_force "${cmake_cache_args}" 1) + endif() + if(cmake_cache_default_args) + _ep_command_line_to_initial_cache(script_initial_cache_default "${cmake_cache_default_args}" 0) + endif() + _ep_write_initial_cache(${name} "${_ep_cache_args_script}" "${script_initial_cache_force}${script_initial_cache_default}") list(APPEND cmd "-C${_ep_cache_args_script}") endif() @@ -1804,10 +2093,22 @@ function(_ep_add_configure_command name) set(log "") endif() + get_property(update_disconnected_set TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED SET) + if(update_disconnected_set) + get_property(update_disconnected TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED) + else() + get_property(update_disconnected DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED) + endif() + if(update_disconnected) + set(update_dep skip-update) + else() + set(update_dep update) + endif() + ExternalProject_Add_Step(${name} configure COMMAND ${cmd} WORKING_DIRECTORY ${binary_dir} - DEPENDEES update patch + DEPENDEES ${update_dep} patch DEPENDS ${file_deps} ${log} ) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 12ea384..9016db8 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -17,7 +17,7 @@ # :: # # -- The following OPTIONAL packages have been found: -# LibXml2 (required version >= 2.4) , XML processing library. , <http://xmlsoft.org> +# LibXml2 (required version >= 2.4), XML processing lib, <http://xmlsoft.org> # * Enables HTML-import in MyWordProcessor # * Enables odt-export in MyWordProcessor # PNG , A PNG image library. , <http://www.libpng.org/pub/png/> @@ -55,21 +55,32 @@ # The WHAT option is the only mandatory option. Here you specify what # information will be printed: # -# :: -# -# ALL: print everything -# ENABLED_FEATURES: the list of all features which are enabled -# DISABLED_FEATURES: the list of all features which are disabled -# PACKAGES_FOUND: the list of all packages which have been found -# PACKAGES_NOT_FOUND: the list of all packages which have not been found -# OPTIONAL_PACKAGES_FOUND: only those packages which have been found which have the type OPTIONAL -# OPTIONAL_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type OPTIONAL -# RECOMMENDED_PACKAGES_FOUND: only those packages which have been found which have the type RECOMMENDED -# RECOMMENDED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RECOMMENDED -# REQUIRED_PACKAGES_FOUND: only those packages which have been found which have the type REQUIRED -# REQUIRED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type REQUIRED -# RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME -# RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME +# ``ALL`` +# print everything +# ``ENABLED_FEATURES`` +# the list of all features which are enabled +# ``DISABLED_FEATURES`` +# the list of all features which are disabled +# ``PACKAGES_FOUND`` +# the list of all packages which have been found +# ``PACKAGES_NOT_FOUND`` +# the list of all packages which have not been found +# ``OPTIONAL_PACKAGES_FOUND`` +# only those packages which have been found which have the type OPTIONAL +# ``OPTIONAL_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type OPTIONAL +# ``RECOMMENDED_PACKAGES_FOUND`` +# only those packages which have been found which have the type RECOMMENDED +# ``RECOMMENDED_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type RECOMMENDED +# ``REQUIRED_PACKAGES_FOUND`` +# only those packages which have been found which have the type REQUIRED +# ``REQUIRED_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type REQUIRED +# ``RUNTIME_PACKAGES_FOUND`` +# only those packages which have been found which have the type RUNTIME +# ``RUNTIME_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type RUNTIME # # With the exception of the ``ALL`` value, these values can be combined # in order to customize the output. For example: @@ -118,10 +129,11 @@ # # :: # -# SET_PACKAGE_PROPERTIES(<name> PROPERTIES [ URL <url> ] -# [ DESCRIPTION <description> ] -# [ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ] -# [ PURPOSE <purpose> ] +# SET_PACKAGE_PROPERTIES(<name> PROPERTIES +# [ URL <url> ] +# [ DESCRIPTION <description> ] +# [ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ] +# [ PURPOSE <purpose> ] # ) # # @@ -171,26 +183,30 @@ # :: # # find_package(LibXml2) -# set_package_properties(LibXml2 PROPERTIES DESCRIPTION "A XML processing library." -# URL "http://xmlsoft.org/") +# set_package_properties(LibXml2 PROPERTIES +# DESCRIPTION "A XML processing library." +# URL "http://xmlsoft.org/") # # # # :: # -# set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED -# PURPOSE "Enables HTML-import in MyWordProcessor") +# set_package_properties(LibXml2 PROPERTIES +# TYPE RECOMMENDED +# PURPOSE "Enables HTML-import in MyWordProcessor") # ... -# set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL -# PURPOSE "Enables odt-export in MyWordProcessor") +# set_package_properties(LibXml2 PROPERTIES +# TYPE OPTIONAL +# PURPOSE "Enables odt-export in MyWordProcessor") # # # # :: # # find_package(DBUS) -# set_package_properties(DBUS PROPERTIES TYPE RUNTIME -# PURPOSE "Necessary to disable the screensaver during a presentation" ) +# set_package_properties(DBUS PROPERTIES +# TYPE RUNTIME +# PURPOSE "Necessary to disable the screensaver during a presentation" ) # # # diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake index 07109b0..cb4f60a 100644 --- a/Modules/FindBacktrace.cmake +++ b/Modules/FindBacktrace.cmake @@ -5,18 +5,24 @@ # Find provider for backtrace(3). # # Checks if OS supports backtrace(3) via either libc or custom library. -# This module defines the following variables:: +# This module defines the following variables: # -# Backtrace_HEADER - The header file needed for backtrace(3). Cached. -# Could be forcibly set by user. -# Backtrace_INCLUDE_DIRS - The include directories needed to use backtrace(3) header. -# Backtrace_LIBRARIES - The libraries (linker flags) needed to use backtrace(3), if any. -# Backtrace_FOUND - Is set if and only if backtrace(3) support detected. +# ``Backtrace_HEADER`` +# The header file needed for backtrace(3). Cached. +# Could be forcibly set by user. +# ``Backtrace_INCLUDE_DIRS`` +# The include directories needed to use backtrace(3) header. +# ``Backtrace_LIBRARIES`` +# The libraries (linker flags) needed to use backtrace(3), if any. +# ``Backtrace_FOUND`` +# Is set if and only if backtrace(3) support detected. # -# The following cache variables are also available to set or use:: +# The following cache variables are also available to set or use: # -# Backtrace_LIBRARY - The external library providing backtrace, if any. -# Backtrace_INCLUDE_DIR - The directory holding the backtrace(3) header. +# ``Backtrace_LIBRARY`` +# The external library providing backtrace, if any. +# ``Backtrace_INCLUDE_DIR`` +# The directory holding the backtrace(3) header. # # Typical usage is to generate of header file using configure_file() with the # contents like the following:: diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 3642b3e..aad6575 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -321,7 +321,7 @@ macro(_Boost_FIND_LIBRARY var) # If Boost_LIBRARY_DIR is known then search only there. if(Boost_LIBRARY_DIR) - set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH) + set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) endif() endmacro() @@ -855,7 +855,7 @@ if(_Boost_CHANGE_LIBDIR AND NOT _Boost_LIBRARY_DIR_CHANGED) endif() if(Boost_LIBRARY_DIR) - set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH) + set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) else() set(_boost_LIBRARY_SEARCH_DIRS "") if(BOOST_LIBRARYDIR) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 2e2b21c..29bb875 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -278,13 +278,13 @@ # Only available for CUDA version 3.2+. # CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. # Only available for CUDA version 3.2+. -# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library. +# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. # Only available for CUDA version 4.0+. -# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives library (core). +# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). # Only available for CUDA version 5.5+. -# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives library (image processing). +# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). # Only available for CUDA version 5.5+. -# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives library (signal processing). +# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). # Only available for CUDA version 5.5+. # CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. # Only available for CUDA version 3.2+. @@ -703,18 +703,6 @@ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) else() set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) endif() -if(APPLE) - # We need to add the path to cudart to the linker using rpath, since the - # library name for the cuda libraries is prepended with @rpath. - if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH) - else() - get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH) - endif() - if(_cuda_path_to_cudart) - list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}") - endif() -endif() # 1.1 toolkit on linux doesn't appear to have a separate library on # some platforms. diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index c628ab0..f94bd09 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -50,6 +50,8 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) + find_library(CURSES_CURSES_LIBRARY NAMES curses ) find_library(CURSES_NCURSES_LIBRARY NAMES ncurses ) @@ -81,7 +83,6 @@ endif() # prefix as the library was found, if still not found, try curses.h with the # default search paths. if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) - include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) cmake_push_check_state() set(CMAKE_REQUIRED_QUIET ${Curses_FIND_QUIETLY}) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 16478cb..ac53c3f 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -17,6 +17,7 @@ # # # Additionally it provides the following macros: +# # GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) # # :: @@ -32,8 +33,9 @@ # :: # # Process the given pot file to mo files. -# If INSTALL_DESTINATION is given then automatically install rules will be created, -# the language subdirectory will be taken into account (by default use share/locale/). +# If INSTALL_DESTINATION is given then automatically install rules will +# be created, the language subdirectory will be taken into account +# (by default use share/locale/). # If ALL is specified, the pot file is processed when building the all traget. # It creates a custom target "potfile". # @@ -43,10 +45,14 @@ # :: # # Process the given po files to mo files for the given language. -# If INSTALL_DESTINATION is given then automatically install rules will be created, -# the language subdirectory will be taken into account (by default use share/locale/). +# If INSTALL_DESTINATION is given then automatically install rules will +# be created, the language subdirectory will be taken into account +# (by default use share/locale/). # If ALL is specified, the po files are processed when building the all traget. # It creates a custom target "pofiles". +# +# .. note:: +# If you wish to use the Gettext library (libintl), use :module:`FindIntl`. #============================================================================= # Copyright 2007-2009 Kitware, Inc. diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake index c418afd..34d763e 100644 --- a/Modules/FindHg.cmake +++ b/Modules/FindHg.cmake @@ -66,7 +66,11 @@ if(HG_EXECUTABLE) execute_process(COMMAND ${HG_EXECUTABLE} --version OUTPUT_VARIABLE hg_version ERROR_QUIET + RESULT_VARIABLE hg_result OUTPUT_STRIP_TRAILING_WHITESPACE) + if(hg_result MATCHES "is not a valid Win32 application") + set_property(CACHE HG_EXECUTABLE PROPERTY VALUE "HG_EXECUTABLE-NOTFOUND") + endif() if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)") set(HG_VERSION_STRING "${CMAKE_MATCH_1}") endif() diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake index 55528b8..76cecc1 100644 --- a/Modules/FindIce.cmake +++ b/Modules/FindIce.cmake @@ -43,7 +43,7 @@ # # Ice_HOME - the root of the Ice installation # -# The environment variable :envvar:`ICE_HOME` may also be used; the +# The environment variable ``ICE_HOME`` may also be used; the # Ice_HOME variable takes precedence. # # The following cache variables may also be set:: diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake new file mode 100644 index 0000000..cd2ec63 --- /dev/null +++ b/Modules/FindIntl.cmake @@ -0,0 +1,69 @@ +#.rst: +# FindIntl +# -------- +# +# Find the Gettext libintl headers and libraries. +# +# This module reports information about the Gettext libintl +# installation in several variables. General variables:: +# +# Intl_FOUND - true if the libintl headers and libraries were found +# Intl_INCLUDE_DIRS - the directory containing the libintl headers +# Intl_LIBRARIES - libintl libraries to be linked +# +# The following cache variables may also be set:: +# +# Intl_INCLUDE_DIR - the directory containing the libintl headers +# Intl_LIBRARY - the libintl library (if any) +# +# .. note:: +# On some platforms, such as Linux with GNU libc, the gettext +# functions are present in the C standard library and libintl +# is not required. ``Intl_LIBRARIES`` will be empty in this +# case. +# +# .. note:: +# If you wish to use the Gettext tools (``msgmerge``, +# ``msgfmt``, etc.), use :module:`FindGettext`. + + +# Written by Roger Leigh <rleigh@codelibre.net> + +#============================================================================= +# Copyright 2014 Roger Leigh <rleigh@codelibre.net> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Find include directory +find_path(Intl_INCLUDE_DIR + NAMES "libintl.h" + DOC "libintl include directory") +mark_as_advanced(Intl_INCLUDE_DIR) + +# Find all Intl libraries +find_library(Intl_LIBRARY "intl" + DOC "libintl libraries (if not in the C library)") +mark_as_advanced(Intl_LIBRARY) + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Intl + FOUND_VAR Intl_FOUND + REQUIRED_VARS Intl_INCLUDE_DIR + FAIL_MESSAGE "Failed to find Gettext libintl") + +if(Intl_FOUND) + set(Intl_INCLUDE_DIRS "${Intl_INCLUDE_DIR}") + if(Intl_LIBRARY) + set(Intl_LIBRARIES "${Intl_LIBRARY}") + else() + unset(Intl_LIBRARIES) + endif() +endif() diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index 0bd7eb0..79be34e 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -17,7 +17,7 @@ # Java_JAVAH_EXECUTABLE = the full path to the Java header generator # Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator # Java_JAR_EXECUTABLE = the full path to the Java archiver -# Java_VERSION_STRING = Version of the package found (java version), eg. 1.6.0_12 +# Java_VERSION_STRING = Version of java found, eg. 1.6.0_12 # Java_VERSION_MAJOR = The major version of the package found. # Java_VERSION_MINOR = The minor version of the package found. # Java_VERSION_PATCH = The patch version of the package found. diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index ea898a6..dda4530 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -8,29 +8,29 @@ # # This module defines the following variables: # -# :: -# -# KDE3_DEFINITIONS - compiler definitions required for compiling KDE software -# KDE3_INCLUDE_DIR - the KDE include directory -# KDE3_INCLUDE_DIRS - the KDE and the Qt include directory, for use with include_directories() -# KDE3_LIB_DIR - the directory where the KDE libraries are installed, for use with link_directories() -# QT_AND_KDECORE_LIBS - this contains both the Qt and the kdecore library -# KDE3_DCOPIDL_EXECUTABLE - the dcopidl executable -# KDE3_DCOPIDL2CPP_EXECUTABLE - the dcopidl2cpp executable -# KDE3_KCFGC_EXECUTABLE - the kconfig_compiler executable -# KDE3_FOUND - set to TRUE if all of the above has been found -# -# +# ``KDE3_DEFINITIONS`` +# compiler definitions required for compiling KDE software +# ``KDE3_INCLUDE_DIR`` +# the KDE include directory +# ``KDE3_INCLUDE_DIRS`` +# the KDE and the Qt include directory, for use with include_directories() +# ``KDE3_LIB_DIR`` +# the directory where the KDE libraries are installed, for use with link_directories() +# ``QT_AND_KDECORE_LIBS`` +# this contains both the Qt and the kdecore library +# ``KDE3_DCOPIDL_EXECUTABLE`` +# the dcopidl executable +# ``KDE3_DCOPIDL2CPP_EXECUTABLE`` +# the dcopidl2cpp executable +# ``KDE3_KCFGC_EXECUTABLE`` +# the kconfig_compiler executable +# ``KDE3_FOUND`` +# set to TRUE if all of the above has been found # # The following user adjustable options are provided: # -# :: -# -# KDE3_BUILD_TESTS - enable this to build KDE testcases -# -# -# -# +# ``KDE3_BUILD_TESTS`` +# enable this to build KDE testcases # # It also adds the following macros (from KDE3Macros.cmake) SRCS_VAR is # always the variable which contains the list of source files for your @@ -101,7 +101,8 @@ # # :: # -# Currently identical to add_executable(), may provide some advanced features in the future. +# Currently identical to add_executable(), may provide some advanced +# features in the future. # # # @@ -110,7 +111,8 @@ # :: # # Create a KDE plugin (KPart, kioslave, etc.) from the given source files. -# If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't. +# If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", +# otherwise it won't. # It creates and installs an appropriate libtool la-file. # # @@ -120,7 +122,8 @@ # :: # # Create a KDE application in the form of a module loadable via kdeinit. -# A library named kdeinit_<name> will be created and a small executable which links to it. +# A library named kdeinit_<name> will be created and a small executable +# which links to it. # # # diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake index bf2f821..2416341 100644 --- a/Modules/FindLibXslt.cmake +++ b/Modules/FindLibXslt.cmake @@ -17,10 +17,10 @@ # Additionally, the following two variables are set (but not required # for using xslt): # -# :: -# -# LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library -# LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found +# ``LIBXSLT_EXSLT_LIBRARIES`` +# Link to these if you need to link against the exslt library. +# ``LIBXSLT_XSLTPROC_EXECUTABLE`` +# Contains the full path to the xsltproc executable if found. #============================================================================= # Copyright 2006-2009 Kitware, Inc. diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 3be5e3c..ba4ea5b 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -160,7 +160,7 @@ set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95 # or if we know it matches the regular compiler. foreach (lang C CXX Fortran) foreach (id GNU Intel PGI XL) - if (NOT CMAKE_${lang}_COMPILER_ID OR "${CMAKE_${lang}_COMPILER_ID}" STREQUAL "${id}") + if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID STREQUAL id) list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES}) endif() unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake index 68adff7..5a800e4 100644 --- a/Modules/FindOpenSceneGraph.cmake +++ b/Modules/FindOpenSceneGraph.cmake @@ -40,13 +40,14 @@ # OSG and it's various components. CMAKE_PREFIX_PATH can also be used # for this (see find_library() CMake documentation). # -# :: -# -# <MODULE>_DIR (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file) -# OSG_DIR -# OSGDIR -# OSG_ROOT -# +# ``<MODULE>_DIR`` +# (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file) +# ``OSG_DIR`` +# .. +# ``OSGDIR`` +# .. +# ``OSG_ROOT`` +# .. # # # [CMake 2.8.10]: The CMake variable OSG_DIR can now be used as well to diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index fa04bf0..7cf3f22 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -10,19 +10,22 @@ # # It defines the following variables # -# :: -# -# PNG_INCLUDE_DIRS, where to find png.h, etc. -# PNG_LIBRARIES, the libraries to link against to use PNG. -# PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files. -# PNG_FOUND, If false, do not try to use PNG. -# PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8) +# ``PNG_INCLUDE_DIRS`` +# where to find png.h, etc. +# ``PNG_LIBRARIES`` +# the libraries to link against to use PNG. +# ``PNG_DEFINITIONS`` +# You should add_definitons(${PNG_DEFINITIONS}) before compiling code +# that includes png library files. +# ``PNG_FOUND`` +# If false, do not try to use PNG. +# ``PNG_VERSION_STRING`` +# the version of the PNG library found (since CMake 2.8.8) # # Also defined, but not for general use are # -# :: -# -# PNG_LIBRARY, where to find the PNG library. +# ``PNG_LIBRARY`` +# where to find the PNG library. # # For backward compatiblity the variable PNG_INCLUDE_DIR is also set. # It has the same value as PNG_INCLUDE_DIRS. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 23f3f05..2de1fb3 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -20,7 +20,8 @@ # # :: # -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> ) +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> +# (DEFAULT_MSG|"Custom failure message") <var1>...<varN> ) # # If the variables <var1> to <varN> are all valid, then # <UPPERCASED_NAME>_FOUND will be set to TRUE. If DEFAULT_MSG is given @@ -32,14 +33,13 @@ # # :: # -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>] -# [REQUIRED_VARS <var1>...<varN>] -# [VERSION_VAR <versionvar>] -# [HANDLE_COMPONENTS] -# [CONFIG_MODE] -# [FAIL_MESSAGE "Custom failure message"] ) -# -# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME +# [FOUND_VAR <resultVar>] +# [REQUIRED_VARS <var1>...<varN>] +# [VERSION_VAR <versionvar>] +# [HANDLE_COMPONENTS] +# [CONFIG_MODE] +# [FAIL_MESSAGE "Custom failure message"] ) # # In this mode, the name of the result-variable can be set either to # either <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND using the @@ -75,7 +75,8 @@ # # :: # -# find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) +# find_package_handle_standard_args(LibXml2 DEFAULT_MSG +# LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) # # # @@ -90,9 +91,10 @@ # # :: # -# find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND -# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS -# VERSION_VAR LibXslt_VERSION_STRING) +# find_package_handle_standard_args(LibXslt +# FOUND_VAR LibXslt_FOUND +# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS +# VERSION_VAR LibXslt_VERSION_STRING) # # In this case, LibXslt is considered to be found if the variable(s) # listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and @@ -317,7 +319,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) endif () unset(_VERSION_HEAD) else () - if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL VERSION) set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") set(VERSION_OK FALSE) else () @@ -327,7 +329,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) unset(_VERSION_DOTS) else() # minimum version specified: - if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + if (${_NAME}_FIND_VERSION VERSION_GREATER VERSION) set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") set(VERSION_OK FALSE) else () diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index d728324..bf58ede 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -490,9 +490,10 @@ endmacro() pkg_check_modules (XRENDER REQUIRED xrender) - Defines e.g.: - ``XRENDER_LIBRARIES=Xrender;X11`` and - ``XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp`` + Defines for example:: + + XRENDER_LIBRARIES=Xrender;X11`` + XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp #]========================================] macro(pkg_check_modules _prefix _module0) # check cached value diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 72ca6ed..f01bd41 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -2,127 +2,80 @@ # FindProtobuf # ------------ # -# -# # Locate and configure the Google Protocol Buffers library. # # The following variables can be set and are optional: # -# :: -# -# PROTOBUF_SRC_ROOT_FOLDER - When compiling with MSVC, if this cache variable is set -# the protobuf-default VS project build locations -# (vsprojects/Debug & vsprojects/Release) will be searched -# for libraries and binaries. -# -# -# -# :: -# -# PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for -# imported .proto files. (New in CMake 2.8.8) -# -# +# ``PROTOBUF_SRC_ROOT_FOLDER`` +# When compiling with MSVC, if this cache variable is set +# the protobuf-default VS project build locations +# (vsprojects/Debug & vsprojects/Release) will be searched +# for libraries and binaries. +# ``PROTOBUF_IMPORT_DIRS`` +# List of additional directories to be searched for +# imported .proto files. # # Defines the following variables: # -# :: -# -# PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files) -# PROTOBUF_INCLUDE_DIRS - Include directories for Google Protocol Buffers -# PROTOBUF_LIBRARIES - The protobuf libraries -# -# [New in CMake 2.8.5] -# -# :: -# -# PROTOBUF_PROTOC_LIBRARIES - The protoc libraries -# PROTOBUF_LITE_LIBRARIES - The protobuf-lite libraries -# -# +# ``PROTOBUF_FOUND`` +# Found the Google Protocol Buffers library +# (libprotobuf & header files) +# ``PROTOBUF_INCLUDE_DIRS`` +# Include directories for Google Protocol Buffers +# ``PROTOBUF_LIBRARIES`` +# The protobuf libraries +# ``PROTOBUF_PROTOC_LIBRARIES`` +# The protoc libraries +# ``PROTOBUF_LITE_LIBRARIES`` +# The protobuf-lite libraries # # The following cache variables are also available to set or use: # -# :: -# -# PROTOBUF_LIBRARY - The protobuf library -# PROTOBUF_PROTOC_LIBRARY - The protoc library -# PROTOBUF_INCLUDE_DIR - The include directory for protocol buffers -# PROTOBUF_PROTOC_EXECUTABLE - The protoc compiler -# -# [New in CMake 2.8.5] -# -# :: -# -# PROTOBUF_LIBRARY_DEBUG - The protobuf library (debug) -# PROTOBUF_PROTOC_LIBRARY_DEBUG - The protoc library (debug) -# PROTOBUF_LITE_LIBRARY - The protobuf lite library -# PROTOBUF_LITE_LIBRARY_DEBUG - The protobuf lite library (debug) -# -# -# -# :: -# -# ==================================================================== -# Example: -# -# -# -# :: -# -# find_package(Protobuf REQUIRED) -# include_directories(${PROTOBUF_INCLUDE_DIRS}) -# -# -# -# :: -# -# include_directories(${CMAKE_CURRENT_BINARY_DIR}) -# PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS foo.proto) -# add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS}) -# target_link_libraries(bar ${PROTOBUF_LIBRARIES}) -# -# -# -# NOTE: You may need to link against pthreads, depending -# -# :: -# -# on the platform. -# -# -# -# NOTE: The PROTOBUF_GENERATE_CPP macro & add_executable() or -# add_library() -# -# :: -# -# calls only work properly within the same directory. -# -# -# -# :: -# -# ==================================================================== -# -# -# -# PROTOBUF_GENERATE_CPP (public function) -# -# :: -# -# SRCS = Variable to define with autogenerated -# source files -# HDRS = Variable to define with autogenerated -# header files -# ARGN = proto files -# -# -# -# :: -# -# ==================================================================== - +# ``PROTOBUF_LIBRARY`` +# The protobuf library +# ``PROTOBUF_PROTOC_LIBRARY`` +# The protoc library +# ``PROTOBUF_INCLUDE_DIR`` +# The include directory for protocol buffers +# ``PROTOBUF_PROTOC_EXECUTABLE`` +# The protoc compiler +# ``PROTOBUF_LIBRARY_DEBUG`` +# The protobuf library (debug) +# ``PROTOBUF_PROTOC_LIBRARY_DEBUG`` +# The protoc library (debug) +# ``PROTOBUF_LITE_LIBRARY`` +# The protobuf lite library +# ``PROTOBUF_LITE_LIBRARY_DEBUG`` +# The protobuf lite library (debug) +# +# Example: +# +# .. code-block:: cmake +# +# find_package(Protobuf REQUIRED) +# include_directories(${PROTOBUF_INCLUDE_DIRS}) +# include_directories(${CMAKE_CURRENT_BINARY_DIR}) +# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto) +# add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS}) +# target_link_libraries(bar ${PROTOBUF_LIBRARIES}) +# +# .. note:: +# The PROTOBUF_GENERATE_CPP macro and add_executable() or +# add_library() calls only work properly within the same +# directory. +# +# .. command:: protobuf_generate_cpp +# +# Add custom commands to process ``.proto`` files:: +# +# protobuf_generate_cpp (<SRCS> <HDRS> [<ARGN>...]) +# +# ``SRCS`` +# Variable to define with autogenerated source files +# ``HDRS`` +# Variable to define with autogenerated header files +# ``ARGN`` +# ``.proto`` files #============================================================================= # Copyright 2009 Kitware, Inc. diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 06a8917..a79246a 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -23,7 +23,7 @@ # .. note:: # # When using :prop_tgt:`IMPORTED` targets, the qtmain.lib static library is -# automatically linked on Windows for :variable:`WIN32 <WIN32_EXECUTABLE>` +# automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>` # executables. To disable that globally, set the # ``QT4_NO_LINK_QTMAIN`` variable before finding Qt4. To disable that # for a particular executable, set the ``QT4_NO_LINK_QTMAIN`` target @@ -104,19 +104,23 @@ # macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... ) # Create the interface header and implementation files # for all listed interface xml files. -# The basename will be automatically determined from the name of the xml file. +# The basename will be automatically determined from the name +# of the xml file. # -# The source file properties described for QT4_ADD_DBUS_INTERFACE also apply here. +# The source file properties described for +# QT4_ADD_DBUS_INTERFACE also apply here. # # # :: # -# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname]) +# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname +# [basename] [classname]) # create a dbus adaptor (header and implementation file) from the xml file # describing the interface, and add it to the list of sources. The adaptor # forwards the calls to a parent class, defined in parentheader and named # parentclassname. The name of the generated files will be -# <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file. +# <basename>adaptor.{cpp,h} where basename defaults to the basename of the +# xml file. # If <classname> is provided, then it will be used as the classname of the # adaptor itself. # @@ -128,7 +132,8 @@ # If the optional argument interfacename is omitted, the name of the # interface file is constructed from the basename of the header with # the suffix .xml appended. -# Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help" +# Options may be given to qdbuscpp2xml, such as those found when +# executing "qdbuscpp2xml --help" # # # :: @@ -169,11 +174,12 @@ # a class uses the Q_OBJECT macro, moc has to run on it. If you don't # want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert # #include "foo.moc" -# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the -# scan all listed files at cmake-time for such included moc files and if it finds -# them cause a rule to be generated to run moc at build time on the +# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will +# scan all listed files at cmake-time for such included moc files and if it +# finds them cause a rule to be generated to run moc at build time on the # accompanying header file foo.h. -# If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro. +# If a source file has the SKIP_AUTOMOC property set it will be ignored by +# this macro. # If the <tgt> is specified, the INTERFACE_INCLUDE_DIRECTORIES and # INTERFACE_COMPILE_DEFINITIONS from the <tgt> are passed to moc. # @@ -181,16 +187,17 @@ # :: # # function QT4_USE_MODULES( target [link_type] modules...) -# This function is obsolete. Use target_link_libraries with IMPORTED targets instead. +# This function is obsolete. Use target_link_libraries with IMPORTED targets +# instead. # Make <target> use the <modules> from Qt. Using a Qt module means -# to link to the library, add the relevant include directories for the module, -# and add the relevant compiler defines for using the module. +# to link to the library, add the relevant include directories for the +# module, and add the relevant compiler defines for using the module. # Modules are roughly equivalent to components of Qt4, so usage would be # something like: # qt4_use_modules(myexe Core Gui Declarative) -# to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument can -# be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the same argument -# to the target_link_libraries call. +# to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument +# can be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the +# same argument to the target_link_libraries call. # # # IMPORTED Targets diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index aafdc09..b5ac703 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -14,19 +14,21 @@ # It also determines what the name of the library is. This code sets # the following variables: # -# :: +# ``RUBY_EXECUTABLE`` +# full path to the ruby binary +# ``RUBY_INCLUDE_DIRS`` +# include dirs to be used when using the ruby library +# ``RUBY_LIBRARY`` +# full path to the ruby library +# ``RUBY_VERSION`` +# the version of ruby which was found, e.g. "1.8.7" +# ``RUBY_FOUND`` +# set to true if ruby ws found successfully # -# RUBY_EXECUTABLE = full path to the ruby binary -# RUBY_INCLUDE_DIRS = include dirs to be used when using the ruby library -# RUBY_LIBRARY = full path to the ruby library -# RUBY_VERSION = the version of ruby which was found, e.g. "1.8.7" -# RUBY_FOUND = set to true if ruby ws found successfully +# Also: # -# -# -# :: -# -# RUBY_INCLUDE_PATH = same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it +# ``RUBY_INCLUDE_PATH`` +# same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it #============================================================================= # Copyright 2004-2009 Kitware, Inc. diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index fc2c043..49b5e40 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -11,7 +11,8 @@ # SDL_IMAGE_LIBRARIES, the name of the library to link against # SDL_IMAGE_INCLUDE_DIRS, where to find the headers # SDL_IMAGE_FOUND, if false, do not try to link against -# SDL_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image +# SDL_IMAGE_VERSION_STRING - human-readable string containing the +# version of SDL_image # # # diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index 176fee6..9e11796 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -11,7 +11,8 @@ # SDL_MIXER_LIBRARIES, the name of the library to link against # SDL_MIXER_INCLUDE_DIRS, where to find the headers # SDL_MIXER_FOUND, if false, do not try to link against -# SDL_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer +# SDL_MIXER_VERSION_STRING - human-readable string containing the +# version of SDL_mixer # # # diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 5fa40a5..494d358 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -21,7 +21,8 @@ # flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES. # This is available mostly for cases this module failed to anticipate for # and you must add additional flags. This is marked as ADVANCED. -# SDL_SOUND_VERSION_STRING, human-readable string containing the version of SDL_sound +# SDL_SOUND_VERSION_STRING, human-readable string containing the +# version of SDL_sound # # # diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index 2b7fd22..51e279d 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -21,7 +21,8 @@ # # :: # -# SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc) +# SQUISH_INSTALL_DIR The Squish installation directory +# (containing bin, lib, etc) # SQUISH_SERVER_EXECUTABLE The squishserver executable # SQUISH_CLIENT_EXECUTABLE The squishrunner executable # @@ -40,28 +41,34 @@ # # :: # -# squish_v4_add_test(cmakeTestName AUT targetName SUITE suiteName TEST squishTestName -# [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] ) +# squish_v4_add_test(cmakeTestName +# AUT targetName SUITE suiteName TEST squishTestName +# [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] ) # # # # The arguments have the following meaning: # -# :: -# -# cmakeTestName: this will be used as the first argument for add_test() -# AUT targetName: the name of the cmake target which will be used as AUT, i.e. the -# executable which will be tested. -# SUITE suiteName: this is either the full path to the squish suite, or just the -# last directory of the suite, i.e. the suite name. In this case -# the CMakeLists.txt which calls squish_add_test() must be located -# in the parent directory of the suite directory. -# TEST squishTestName: the name of the squish test, i.e. the name of the subdirectory -# of the test inside the suite directory. -# SETTINGSGROUP group: if specified, the given settings group will be used for executing the test. -# If not specified, the groupname will be "CTest_<username>" -# PRE_COMMAND command: if specified, the given command will be executed before starting the squish test. -# POST_COMMAND command: same as PRE_COMMAND, but after the squish test has been executed. +# ``cmakeTestName`` +# this will be used as the first argument for add_test() +# ``AUT targetName`` +# the name of the cmake target which will be used as AUT, i.e. the +# executable which will be tested. +# ``SUITE suiteName`` +# this is either the full path to the squish suite, or just the +# last directory of the suite, i.e. the suite name. In this case +# the CMakeLists.txt which calls squish_add_test() must be located +# in the parent directory of the suite directory. +# ``TEST squishTestName`` +# the name of the squish test, i.e. the name of the subdirectory +# of the test inside the suite directory. +# ``SETTINGSGROUP group`` +# if specified, the given settings group will be used for executing the test. +# If not specified, the groupname will be "CTest_<username>" +# ``PRE_COMMAND command`` +# if specified, the given command will be executed before starting the squish test. +# ``POST_COMMAND command`` +# same as PRE_COMMAND, but after the squish test has been executed. # # # @@ -70,7 +77,12 @@ # enable_testing() # find_package(Squish 4.0) # if (SQUISH_FOUND) -# squish_v4_add_test(myTestName AUT myApp SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite TEST someSquishTest SETTINGSGROUP myGroup ) +# squish_v4_add_test(myTestName +# AUT myApp +# SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite +# TEST someSquishTest +# SETTINGSGROUP myGroup +# ) # endif () # # diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt index b6232ed..721a262 100644 --- a/Modules/FortranCInterface/CMakeLists.txt +++ b/Modules/FortranCInterface/CMakeLists.txt @@ -71,7 +71,7 @@ endif() # Generate C symbol sources. set(symbol_sources) -if(NOT "${CMAKE_Fortran_COMPILER_ID}" MATCHES "^(PathScale|Cray)$") +if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(PathScale|Cray)$") # Provide mymodule_ and my_module_ init symbols because: # - PGI Fortran uses module init symbols # but not for: diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index 10956aa..c61e7e9 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -6,36 +6,47 @@ # # Provides install directory variables as defined for GNU software: # -# :: -# # http://www.gnu.org/prep/standards/html_node/Directory-Variables.html # # Inclusion of this module defines the following variables: # -# :: -# -# CMAKE_INSTALL_<dir> - destination for files of a given type -# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path +# ``CMAKE_INSTALL_<dir>`` +# destination for files of a given type +# ``CMAKE_INSTALL_FULL_<dir>`` +# corresponding absolute path # # where <dir> is one of: # -# :: -# -# BINDIR - user executables (bin) -# SBINDIR - system admin executables (sbin) -# LIBEXECDIR - program executables (libexec) -# SYSCONFDIR - read-only single-machine data (etc) -# SHAREDSTATEDIR - modifiable architecture-independent data (com) -# LOCALSTATEDIR - modifiable single-machine data (var) -# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian) -# INCLUDEDIR - C header files (include) -# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) -# DATAROOTDIR - read-only architecture-independent data root (share) -# DATADIR - read-only architecture-independent data (DATAROOTDIR) -# INFODIR - info documentation (DATAROOTDIR/info) -# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) -# MANDIR - man documentation (DATAROOTDIR/man) -# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) +# ``BINDIR`` +# user executables (bin) +# ``SBINDIR`` +# system admin executables (sbin) +# ``LIBEXECDIR`` +# program executables (libexec) +# ``SYSCONFDIR`` +# read-only single-machine data (etc) +# ``SHAREDSTATEDIR`` +# modifiable architecture-independent data (com) +# ``LOCALSTATEDIR`` +# modifiable single-machine data (var) +# ``LIBDIR`` +# object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian) +# ``INCLUDEDIR`` +# C header files (include) +# ``OLDINCLUDEDIR`` +# C header files for non-gcc (/usr/include) +# ``DATAROOTDIR`` +# read-only architecture-independent data root (share) +# ``DATADIR`` +# read-only architecture-independent data (DATAROOTDIR) +# ``INFODIR`` +# info documentation (DATAROOTDIR/info) +# ``LOCALEDIR`` +# locale-dependent data (DATAROOTDIR/locale) +# ``MANDIR`` +# man documentation (DATAROOTDIR/man) +# ``DOCDIR`` +# documentation root (DATAROOTDIR/doc/PROJECT_NAME) # # Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION # options of install() commands for the corresponding file type. If the diff --git a/Modules/Platform/Darwin-GNU-Fortran.cmake b/Modules/Platform/Darwin-GNU-Fortran.cmake index f4b509a..6724f9b 100644 --- a/Modules/Platform/Darwin-GNU-Fortran.cmake +++ b/Modules/Platform/Darwin-GNU-Fortran.cmake @@ -14,6 +14,8 @@ include(Platform/Darwin-GNU) __darwin_compiler_gnu(Fortran) +cmake_gnu_set_sysroot_flag(Fortran) +cmake_gnu_set_osx_deployment_target_flag(Fortran) set(CMAKE_Fortran_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") set(CMAKE_Fortran_OSX_CURRENT_VERSION_FLAG "-current_version ") diff --git a/Modules/Platform/HP-UX-HP-Fortran.cmake b/Modules/Platform/HP-UX-HP-Fortran.cmake index 30acab8..e5c5d10 100644 --- a/Modules/Platform/HP-UX-HP-Fortran.cmake +++ b/Modules/Platform/HP-UX-HP-Fortran.cmake @@ -1,2 +1,5 @@ include(Platform/HP-UX-HP) __hpux_compiler_hp(Fortran) + +set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake index 03e98cc..12b0f37 100644 --- a/Modules/Platform/IRIX.cmake +++ b/Modules/Platform/IRIX.cmake @@ -31,6 +31,14 @@ if(NOT CMAKE_COMPILER_IS_GNUCXX) ) endif() +if(NOT CMAKE_COMPILER_IS_GNUG77) + set (CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") + set (CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE + "<CMAKE_Fortran_COMPILER> <FLAGS> -S <SOURCE>" + "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>" + ) +endif() + # Initialize C link type selection flags. These flags are used when # building a shared library, shared module, or executable that links # to other libraries to select whether to use the static or shared diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index ac410de..88f9bf7 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -18,8 +18,8 @@ set(CMAKE_CREATE_CONSOLE_EXE "system nt" ) set(CMAKE_SHARED_LINKER_FLAGS_INIT "system nt_dll") set(CMAKE_MODULE_LINKER_FLAGS_INIT "system nt_dll") foreach(type SHARED MODULE EXE) - set(CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT "debug all opt map, symfile") - set(CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all opt map, symfile") + set(CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT "debug all opt map") + set(CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all opt map") endforeach() set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list diff --git a/Modules/Platform/eCos.cmake b/Modules/Platform/eCos.cmake index a203826..e1279ef 100644 --- a/Modules/Platform/eCos.cmake +++ b/Modules/Platform/eCos.cmake @@ -28,7 +28,7 @@ include(Platform/UnixPaths) # eCos can be built only with gcc get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE) -if(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC) +if(CMAKE_C_COMPILER AND NOT CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT _IN_TC) message(FATAL_ERROR "GNU gcc is required for eCos") endif() if(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC) diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 8c4daac..6516b0a 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -232,7 +232,7 @@ macro (QT4_ADD_RESOURCES outfiles ) # let's make a configured file and add it as a dependency so cmake is run # again when dependencies need to be recomputed. QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends) - configure_file("${infile}" "${out_depends}" COPY_ONLY) + configure_file("${infile}" "${out_depends}" COPYONLY) else() # The .qrc file does not exist (yet). Let's add a dependency and hope # that it will be generated later diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 127012f..3a6acd8 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -398,7 +398,7 @@ function(add_jar _TARGET_NAME) ${CMAKE_JAVA_LIBRARY_OUTPUT_PATH} ) - if (WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") + if (CMAKE_HOST_WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 31ab48d..bab1b21 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -272,6 +272,8 @@ macro(SWIG_ADD_MODULE name language) if(WIN32 AND NOT CYGWIN) set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd") endif() + elseif ("${swig_lowercase_language}" STREQUAL "r") + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") elseif ("${swig_lowercase_language}" STREQUAL "ruby") # In ruby you want: # require 'LIBRARY' diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake index 7d28e95..bf55eb9 100644 --- a/Modules/WriteBasicConfigVersionFile.cmake +++ b/Modules/WriteBasicConfigVersionFile.cmake @@ -6,7 +6,10 @@ # # :: # -# WRITE_BASIC_CONFIG_VERSION_FILE( filename [VERSION major.minor.patch] COMPATIBILITY (AnyNewerVersion|SameMajorVersion) ) +# WRITE_BASIC_CONFIG_VERSION_FILE( filename +# [VERSION major.minor.patch] +# COMPATIBILITY (AnyNewerVersion|SameMajorVersion) +# ) # # # |