Merge branch 'master' into osx-init-early

Resolve conflict in Source/cmGlobalGenerator.cxx by integrating
changes from both sides.
This commit is contained in:
Brad King 2014-04-29 09:36:55 -04:00
commit bbc358c3fc
1213 changed files with 21286 additions and 10881 deletions

View File

@ -21,7 +21,9 @@ if(CMAKE_BOOTSTRAP)
unset(CMAKE_BOOTSTRAP CACHE) unset(CMAKE_BOOTSTRAP CACHE)
endif() endif()
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin) if(NOT CMake_TEST_EXTERNAL_CMAKE)
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
endif()
if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Disallow architecture-specific try_run. It may not run on the host. # Disallow architecture-specific try_run. It may not run on the host.
@ -34,6 +36,13 @@ if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
endmacro() endmacro()
endif() endif()
# option to set the internal encoding of CMake to UTF-8
option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally (experimental)." OFF)
mark_as_advanced(CMAKE_ENCODING_UTF8)
if(CMAKE_ENCODING_UTF8)
set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
endif()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro # a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script # simply to improve readability of the main script
@ -102,9 +111,11 @@ endmacro()
set(CMAKE_BUILD_ON_VISUAL_STUDIO 0) if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
set(CMAKE_BUILD_ON_VISUAL_STUDIO 1) set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
endif()
endif() endif()
@ -114,29 +125,6 @@ endif()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
macro(CMAKE_SETUP_TESTING) macro(CMAKE_SETUP_TESTING)
if(BUILD_TESTING) if(BUILD_TESTING)
set(CMAKE_TEST_GENERATOR "" CACHE STRING
"Generator used when running tests")
set(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
"Generator used when running tests")
if(NOT CMAKE_TEST_GENERATOR)
set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
set(CMAKE_TEST_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}")
else()
set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
set(CMAKE_TEST_GENERATOR_TOOLSET "")
endif()
# Are we testing with the MSVC compiler?
set(CMAKE_TEST_MSVC 0)
if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
set(CMAKE_TEST_MSVC 1)
else()
if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
set(CMAKE_TEST_MSVC 1)
endif()
endif()
set(CMAKE_TEST_SYSTEM_LIBRARIES 0) set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
foreach(util CURL EXPAT XMLRPC ZLIB) foreach(util CURL EXPAT XMLRPC ZLIB)
if(CMAKE_USE_SYSTEM_${util}) if(CMAKE_USE_SYSTEM_${util})
@ -149,10 +137,20 @@ macro(CMAKE_SETUP_TESTING)
# the ctest from this cmake is used for testing # the ctest from this cmake is used for testing
# and not the ctest from the cmake building and testing # and not the ctest from the cmake building and testing
# cmake. # cmake.
if(CMake_TEST_EXTERNAL_CMAKE)
set(CMAKE_CTEST_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cpack")
foreach(exe cmake ctest cpack)
add_executable(${exe} IMPORTED)
set_property(TARGET ${exe} PROPERTY IMPORTED_LOCATION ${CMake_TEST_EXTERNAL_CMAKE}/${exe})
endforeach()
else()
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest") set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
endif() endif()
endif()
# configure some files for testing # configure some files for testing
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
@ -164,8 +162,6 @@ macro(CMAKE_SETUP_TESTING)
${CMake_BINARY_DIR}/Modules/.NoDartCoverage) ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY) ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
configure_file(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
if(BUILD_TESTING AND DART_ROOT) if(BUILD_TESTING AND DART_ROOT)
configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY) ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
@ -325,6 +321,12 @@ macro (CMAKE_BUILD_UTILITIES)
add_definitions(-DLIBARCHIVE_STATIC) add_definitions(-DLIBARCHIVE_STATIC)
set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle") set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL") set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
set(ENABLE_LZMA OFF CACHE INTERNAL "Enable the use of the system found LZMA library if found")
set(ENABLE_ZLIB ON CACHE INTERNAL "Enable the use of the system found ZLIB library if found")
set(ENABLE_BZip2 ON CACHE INTERNAL "Enable the use of the system found BZip2 library if found")
set(ENABLE_EXPAT OFF CACHE INTERNAL "Enable the use of the system found EXPAT library if found")
set(ENABLE_PCREPOSIX OFF CACHE INTERNAL "Enable the use of the system found PCREPOSIX library if found")
set(ENABLE_LibGCC OFF CACHE INTERNAL "Enable the use of the system found LibGCC library if found")
set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support") set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support") set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support") set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
@ -387,7 +389,8 @@ macro (CMAKE_BUILD_UTILITIES)
endmacro () endmacro ()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} execute_process(COMMAND ${CMAKE_CXX_COMPILER}
${CMAKE_CXX_COMPILER_ARG1} -dumpversion ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE _GXX_VERSION OUTPUT_VARIABLE _GXX_VERSION
@ -400,6 +403,7 @@ if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
"Please use GXX 4.2 or greater to build CMake on OpenBSD\n" "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}") "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
endif() endif()
endif()
endif() endif()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
@ -417,31 +421,33 @@ include (${CMAKE_ROOT}/Modules/Dart.cmake)
set_directory_properties(PROPERTIES set_directory_properties(PROPERTIES
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake") TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
# where to write the resulting executables and libraries if(NOT CMake_TEST_EXTERNAL_CMAKE)
set(BUILD_SHARED_LIBS OFF) # where to write the resulting executables and libraries
set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") set(BUILD_SHARED_LIBS OFF)
set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
"Where to put the libraries for CMake") "Where to put the libraries for CMake")
# The CMake executables usually do not need any rpath to run in the build or # The CMake executables usually do not need any rpath to run in the build or
# install tree. # install tree.
set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
# Load install destinations. # Load install destinations.
include(Source/CMakeInstallDestinations.cmake) include(Source/CMakeInstallDestinations.cmake)
if(BUILD_TESTING) if(BUILD_TESTING)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
endif()
# include special compile flags for some compilers
include(CompileFlags.cmake)
# no clue why we are testing for this here
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
endif() endif()
# include special compile flags for some compilers
include(CompileFlags.cmake)
# no clue why we are testing for this here
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
# CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests. # CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.
# #
# If not defined or "", this variable defaults to the server at # If not defined or "", this variable defaults to the server at
@ -459,23 +465,24 @@ if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash") set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
endif() endif()
# build the utilities (a macro defined in this file) if(NOT CMake_TEST_EXTERNAL_CMAKE)
CMAKE_BUILD_UTILITIES() # build the utilities (a macro defined in this file)
CMAKE_BUILD_UTILITIES()
# On NetBSD ncurses is required, since curses doesn't have the wsyncup() # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
# function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib, # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
# which isn't in the default linker search path. So without RPATH ccmake # which isn't in the default linker search path. So without RPATH ccmake
# doesn't run and the build doesn't succeed since ccmake is executed for # doesn't run and the build doesn't succeed since ccmake is executed for
# generating the documentation. # generating the documentation.
if(BUILD_CursesDialog) if(BUILD_CursesDialog)
get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH) get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
set(CURSES_NEED_RPATH FALSE) set(CURSES_NEED_RPATH FALSE)
if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
set(CURSES_NEED_RPATH TRUE) set(CURSES_NEED_RPATH TRUE)
endif() endif()
endif() endif()
if(BUILD_QtDialog) if(BUILD_QtDialog)
if(APPLE) if(APPLE)
set(CMAKE_BUNDLE_VERSION set(CMAKE_BUNDLE_VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
@ -495,33 +502,35 @@ if(BUILD_QtDialog)
if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
set(QT_NEED_RPATH TRUE) set(QT_NEED_RPATH TRUE)
endif() endif()
endif() endif()
# The same might be true on other systems for other libraries. # The same might be true on other systems for other libraries.
# Then only enable RPATH if we have are building at least with cmake 2.4, # Then only enable RPATH if we have are building at least with cmake 2.4,
# since this one has much better RPATH features than cmake 2.2. # since this one has much better RPATH features than cmake 2.2.
# The executables are then built with the RPATH for the libraries outside # The executables are then built with the RPATH for the libraries outside
# the build tree, which is both the build and the install RPATH. # the build tree, which is both the build and the install RPATH.
if (UNIX) if (UNIX)
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif() endif()
endif () endif ()
# add the uninstall support # add the uninstall support
configure_file( configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY) @ONLY)
add_custom_target(uninstall add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
include (CMakeCPack.cmake) include (CMakeCPack.cmake)
endif()
# setup some Testing support (a macro defined in this file) # setup some Testing support (a macro defined in this file)
CMAKE_SETUP_TESTING() CMAKE_SETUP_TESTING()
@ -530,7 +539,8 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf" "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
COPYONLY) COPYONLY)
if(NOT CMake_VERSION_IS_RELEASE) if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(NOT CMake_VERSION_IS_RELEASE)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2) NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts
@ -552,30 +562,35 @@ if(NOT CMake_VERSION_IS_RELEASE)
unset(C_FLAGS_LIST) unset(C_FLAGS_LIST)
unset(CXX_FLAGS_LIST) unset(CXX_FLAGS_LIST)
endif() endif()
endif()
# build the remaining subdirectories
add_subdirectory(Source)
add_subdirectory(Utilities)
endif() endif()
# build the remaining subdirectories
add_subdirectory(Source)
add_subdirectory(Utilities)
add_subdirectory(Tests) add_subdirectory(Tests)
if(BUILD_TESTING) if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests") CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
endif() endif()
CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat") CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
if(TARGET documentation) if(TARGET documentation)
CMAKE_SET_TARGET_FOLDER(documentation "Documentation") CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
endif()
endif() endif()
# add a test # add a test
add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
--system-information -G "${CMAKE_TEST_GENERATOR}" ) --system-information -G "${CMAKE_GENERATOR}" )
# Install license file as it requires. if(NOT CMake_TEST_EXTERNAL_CMAKE)
install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}) # Install license file as it requires.
install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
# Install script directories. # Install script directories.
install( install(
DIRECTORY Help Modules Templates DIRECTORY Help Modules Templates
DESTINATION ${CMAKE_DATA_DIR} DESTINATION ${CMAKE_DATA_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
@ -587,5 +602,6 @@ install(
WORLD_READ WORLD_EXECUTE WORLD_READ WORLD_EXECUTE
) )
# Install auxiliary files integrating with other tools. # Install auxiliary files integrating with other tools.
add_subdirectory(Auxiliary) add_subdirectory(Auxiliary)
endif()

View File

@ -18,8 +18,3 @@ set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE) set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_CDASH_VERSION "1.6") set(CTEST_CDASH_VERSION "1.6")
set(CTEST_CDASH_QUERY_VERSION TRUE) set(CTEST_CDASH_QUERY_VERSION TRUE)
# use old trigger stuff so that cmake 2.4 and below will not
# get errors on trigger
set (TRIGGER_SITE
"http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi")

View File

@ -19,6 +19,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"Utilities.cmbzip2." "Utilities.cmbzip2."
"Source.CTest.Curl" "Source.CTest.Curl"
"Source.CursesDialog.form" "Source.CursesDialog.form"
"Source.cm_sha2.*warning.*cast increases required alignment of target type"
"Utilities.cmcurl" "Utilities.cmcurl"
"Utilities.cmexpat." "Utilities.cmexpat."
"Utilities.cmlibarchive" "Utilities.cmlibarchive"
@ -39,12 +40,14 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*" "Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*"
"Warning: public.*_archive.*clashes with prior module.*" "Warning: public.*_archive.*clashes with prior module.*"
"Warning: LINN32: Last line.*is less.*" "Warning: LINN32: Last line.*is less.*"
"Warning: Olimit was exceeded on function.*"
"Warning: To override Olimit for all functions in file.*"
"warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*" "warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*"
"stl_deque.h:1051" "stl_deque.h:1051"
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)" "(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"(Lexer|Parser).*warning.*statement is unreachable" "(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)"
"PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c" "PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c"
"[Qq]t([Cc]ore|[Gg]ui).*warning.*conversion.*may alter its value" "[Qq]t([Cc]ore|[Gg]ui|[Ww]idgets).*warning.*conversion.*may alter its value"
"warning:.*is.*very unsafe.*consider using.*" "warning:.*is.*very unsafe.*consider using.*"
"warning:.*is.*misused, please use.*" "warning:.*is.*misused, please use.*"
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element" "CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
@ -52,6 +55,9 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"ld: warning: directory not found for option .-(F|L)" "ld: warning: directory not found for option .-(F|L)"
"warning.*This version of Mac OS X is unsupported" "warning.*This version of Mac OS X is unsupported"
"clang.*: warning: argument unused during compilation: .-g" "clang.*: warning: argument unused during compilation: .-g"
"note: in expansion of macro" # diagnostic context note
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto
# Ignore clang's summary warning, assuming prior text has matched some # Ignore clang's summary warning, assuming prior text has matched some
# other warning expression: # other warning expression:

View File

@ -1,3 +0,0 @@
# This file is provided for compatibility with CMake 2.2 and lower.
# Just include the custom file by its new name.
INCLUDE("CTestCustom.cmake")

View File

@ -19,7 +19,6 @@ endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 6") if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif() endif()
include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
set(_INTEL_WINDOWS 1) set(_INTEL_WINDOWS 1)
@ -35,25 +34,37 @@ else()
endif() endif()
#silence duplicate symbol warnings on AIX #silence duplicate symbol warnings on AIX
if(CMAKE_SYSTEM MATCHES "AIX.*") if(CMAKE_SYSTEM_NAME MATCHES "AIX")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
endif() endif()
endif() endif()
if(CMAKE_SYSTEM MATCHES "IRIX.*") if(CMAKE_SYSTEM_NAME MATCHES "IRIX")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
endif() endif()
endif() endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
endif() endif()
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP")
# HP aCC since version 3.80 supports the flag +hpxstd98 to get ANSI C++98
# template support. It is known that version 6.25 doesn't need that flag.
# Versions prior to 3.80 will not be able to build CMake. Current assumption:
# it is needed for every version from 3.80 to 4 to get it working.
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4 AND
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.80)
# use new C++ library and improved template support
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA +hpxstd98")
endif()
endif()
# use the ansi CXX compile flag for building cmake # use the ansi CXX compile flag for building cmake
if (CMAKE_ANSI_CXXFLAGS) if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
@ -68,3 +79,5 @@ endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc) if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*")
endif () endif ()
include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)

View File

@ -156,3 +156,7 @@ target is built before any target using this custom command.
Additionally, if the target is an executable or library a file-level Additionally, if the target is an executable or library a file-level
dependency is created to cause the custom command to re-run whenever dependency is created to cause the custom command to re-run whenever
the target is recompiled. the target is recompiled.
Arguments to ``DEPENDS`` may use "generator expressions" with the syntax
``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for
available expressions.

View File

@ -35,8 +35,11 @@ If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL` the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
target property for details. target property for details.
See the :manual:`cmake-buildsystem(7)` manual for more on defining Source arguments to ``add_executable`` may use "generator expressions" with
buildsystem properties. the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
-------------------------------------------------------------------------- --------------------------------------------------------------------------

View File

@ -39,8 +39,10 @@ If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL` the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
target property for details. target property for details.
See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem Source arguments to ``add_library`` may use "generator expressions" with
properties. the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
-------------------------------------------------------------------------- --------------------------------------------------------------------------

View File

@ -35,6 +35,7 @@ String operations.
string(FIND <string> <substring> <output variable> [REVERSE]) string(FIND <string> <substring> <output variable> [REVERSE])
string(TIMESTAMP <output variable> [<format string>] [UTC]) string(TIMESTAMP <output variable> [<format string>] [UTC])
string(MAKE_C_IDENTIFIER <input string> <output variable>) string(MAKE_C_IDENTIFIER <input string> <output variable>)
string(GENEX_STRIP <input string> <output variable>)
REGEX MATCH will match the regular expression once and store the match REGEX MATCH will match the regular expression once and store the match
in the output variable. in the output variable.
@ -154,3 +155,7 @@ If no explicit <format string> is given it will default to:
MAKE_C_IDENTIFIER will write a string which can be used as an MAKE_C_IDENTIFIER will write a string which can be used as an
identifier in C. identifier in C.
``GENEX_STRIP`` will strip any
:manual:`generator expressions <cmake-generator-expressions(7)>` from the
``input string`` and store the result in the ``output variable``.

View File

@ -0,0 +1,30 @@
target_compile_features
-----------------------
Add expected compiler features to a target.
::
target_compile_features(<target> <PRIVATE|PUBLIC|INTERFACE> <feature> [...])
Specify compiler features required when compiling a given target. If the
feature is not listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable,
then an error will be reported by CMake. If the use of the feature requires
an additional compiler flag, such as ``-std=c++11``, the flag will be added
automatically.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
specify the scope of the features. ``PRIVATE`` and ``PUBLIC`` items will
populate the :prop_tgt:`COMPILE_FEATURES` property of ``<target>``.
``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_FEATURES` property of ``<target>``. Repeated
calls for the same ``<target>`` append items.
The named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be
an ``IMPORTED`` target.
Arguments to ``target_compile_features`` may use "generator expressions"
with the syntax ``$<...>``.
See the :manual:`cmake-generator-expressions(7)` manual for available
expressions.

View File

@ -0,0 +1,28 @@
target_sources
--------------
Add sources to a target.
::
target_sources(<target>
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
Specify sources to use when compiling a given target. The
named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be an
:prop_tgt:`IMPORTED Target`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`SOURCES` property of
``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_SOURCES` property of ``<target>``. The
following arguments specify sources. Repeated calls for the same
``<target>`` append items in the order called.
Arguments to ``target_sources`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -580,7 +580,17 @@ and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
generator expressions can be used to describe separate usage requirements generator expressions can be used to describe separate usage requirements
based on the usage location. Relative paths are allowed within these based on the usage location. Relative paths are allowed within these
expressions, and are interpreted relative to the current source directory expressions, and are interpreted relative to the current source directory
or the installation prefix, as appropriate. or the installation prefix, as appropriate:
.. code-block:: cmake
add_library(ClimbingStats climbingstats.cpp)
target_include_directories(ClimbingStats INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated>
$<INSTALL_INTERFACE:/absolute/path>
$<INSTALL_INTERFACE:relative/path>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/$<CONFIG>/generated>
)
Two convenience APIs are provided relating to include directories usage Two convenience APIs are provided relating to include directories usage
requirements. The :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable requirements. The :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable

View File

@ -91,9 +91,11 @@ These commands may be used freely in CMake projects.
/command/source_group /command/source_group
/command/string /command/string
/command/target_compile_definitions /command/target_compile_definitions
/command/target_compile_features
/command/target_compile_options /command/target_compile_options
/command/target_include_directories /command/target_include_directories
/command/target_link_libraries /command/target_link_libraries
/command/target_sources
/command/try_compile /command/try_compile
/command/try_run /command/try_run
/command/unset /command/unset

View File

@ -55,7 +55,7 @@ used in a comparison with the iterator returned by ``end()``:
.. code-block:: c++ .. code-block:: c++
const std::set<cmStdString>& someSet = getSet(); const std::set<std::string>& someSet = getSet();
if (someSet.find("needle") == someSet.end()) // Wrong if (someSet.find("needle") == someSet.end()) // Wrong
{ {
// ... // ...
@ -66,8 +66,8 @@ The return value of ``find()`` must be assigned to an intermediate
.. code-block:: c++ .. code-block:: c++
const std::set<cmStdString>& someSet; const std::set<std::string>& someSet;
const std::set<cmStdString>::const_iterator i = someSet.find("needle"); const std::set<std::string>::const_iterator i = someSet.find("needle");
if (i != propSet.end()) // Ok if (i != propSet.end()) // Ok
{ {
// ... // ...
@ -110,7 +110,7 @@ conversion is not allowed:
.. code-block:: c++ .. code-block:: c++
std::set<cmStdString> theSet; std::set<const char*> theSet;
std::vector<std::string> theVector; std::vector<std::string> theVector;
theVector.insert(theVector.end(), theSet.begin(), theSet.end()); // Wrong theVector.insert(theVector.end(), theSet.begin(), theSet.end()); // Wrong
@ -118,9 +118,9 @@ A loop must be used instead:
.. code-block:: c++ .. code-block:: c++
std::set<cmStdString> theSet; std::set<const char*> theSet;
std::vector<std::string> theVector; std::vector<std::string> theVector;
for(std::set<cmStdString>::iterator li = theSet.begin(); for(std::set<const char*>::iterator li = theSet.begin();
li != theSet.end(); ++li) li != theSet.end(); ++li)
{ {
theVector.push_back(*li); theVector.push_back(*li);
@ -664,124 +664,11 @@ For example, a ``Modules/Findxxx.cmake`` module may contain:
<code> <code>
endmacro() endmacro()
Find Modules After the top documentation block, leave a *BLANK* line, and then add a
------------ copyright and licence notice block like this one (change only the year
range and name)
A "find module" is a ``Modules/Find<package>.cmake`` file to be loaded .. code-block:: cmake
by the :command:`find_package` command when invoked for ``<package>``.
We would like all ``FindXxx.cmake`` files to produce consistent variable
names. Please use the following consistent variable names for general use.
Xxx_INCLUDE_DIRS
The final set of include directories listed in one variable for use by client
code. This should not be a cache entry.
Xxx_LIBRARIES
The libraries to link against to use Xxx. These should include full paths.
This should not be a cache entry.
Xxx_DEFINITIONS
Definitions to use when compiling code that uses Xxx. This really shouldn't
include options such as (-DHAS_JPEG)that a client source-code file uses to
decide whether to #include <jpeg.h>
Xxx_EXECUTABLE
Where to find the Xxx tool.
Xxx_Yyy_EXECUTABLE
Where to find the Yyy tool that comes with Xxx.
Xxx_LIBRARY_DIRS
Optionally, the final set of library directories listed in one variable for
use by client code. This should not be a cache entry.
Xxx_ROOT_DIR
Where to find the base directory of Xxx.
Xxx_VERSION_Yy
Expect Version Yy if true. Make sure at most one of these is ever true.
Xxx_WRAP_Yy
If False, do not try to use the relevant CMake wrapping command.
Xxx_Yy_FOUND
If False, optional Yy part of Xxx sytem is not available.
Xxx_FOUND
Set to false, or undefined, if we haven't found, or don't want to use Xxx.
Xxx_NOT_FOUND_MESSAGE
Should be set by config-files in the case that it has set Xxx_FOUND to FALSE.
The contained message will be printed by the find_package() command and by
find_package_handle_standard_args() to inform the user about the problem.
Xxx_RUNTIME_LIBRARY_DIRS
Optionally, the runtime library search path for use when running an
executable linked to shared libraries. The list should be used by user code
to create the PATH on windows or LD_LIBRARY_PATH on unix. This should not be
a cache entry.
Xxx_VERSION_STRING
A human-readable string containing the version of the package found, if any.
Xxx_VERSION_MAJOR
The major version of the package found, if any.
Xxx_VERSION_MINOR
The minor version of the package found, if any.
Xxx_VERSION_PATCH
The patch version of the package found, if any.
You do not have to provide all of the above variables. You should provide
Xxx_FOUND under most circumstances. If Xxx is a library, then Xxx_LIBRARIES,
should also be defined, and Xxx_INCLUDE_DIRS should usually be defined (I
guess libm.a might be an exception)
The following names should not usually be used in CMakeLists.txt files, but
they may be usefully modified in users' CMake Caches to control stuff.
Xxx_LIBRARY
Name of Xxx Library. A User may set this and Xxx_INCLUDE_DIR to ignore to
force non-use of Xxx.
Xxx_Yy_LIBRARY
Name of Yy library that is part of the Xxx system. It may or may not be
required to use Xxx.
Xxx_INCLUDE_DIR
Where to find xxx.h, etc. (Xxx_INCLUDE_PATH was considered bad because a path
includes an actual filename.)
Xxx_Yy_INCLUDE_DIR
Where to find xxx_yy.h, etc.
For tidiness's sake, try to keep as many options as possible out of the cache,
leaving at least one option which can be used to disable use of the module, or
locate a not-found library (e.g. Xxx_ROOT_DIR). For the same reason, mark
most cache options as advanced.
If you need other commands to do special things then it should still begin
with ``Xxx_``. This gives a sort of namespace effect and keeps things tidy for the
user. You should put comments describing all the exported settings, plus
descriptions of any the users can use to control stuff.
You really should also provide backwards compatibility any old settings that
were actually in use. Make sure you comment them as deprecated, so that
no-one starts using them.
To add a module to the CMake documentation, follow the steps in the
`Module Documentation`_ section above. Test the documentation formatting
by running ``cmake --help-module FindXxx``, and also by enabling the
``SPHINX_HTML`` and ``SPHINX_MAN`` options to build the documentation.
Edit the comments until generated documentation looks satisfactory.
To have a .cmake file in this directory NOT show up in the modules
documentation, simply leave out the ``Help/module/<module-name>.rst`` file
and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
After the documentation, leave a *BLANK* line, and then add a
copyright and licence notice block like this one::
#============================================================================= #=============================================================================
# Copyright 2009-2011 Your Name # Copyright 2009-2011 Your Name
@ -796,81 +683,389 @@ copyright and licence notice block like this one::
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
The layout of the notice block is strictly enforced by the ``ModuleNotices`` Test the documentation formatting by running
test. Only the year range and name may be changed freely. ``cmake --help-module <module-name>``, and also by enabling the
``SPHINX_HTML`` and ``SPHINX_MAN`` options to build the documentation.
Edit the comments until generated documentation looks satisfactory. To
have a .cmake file in this directory NOT show up in the modules
documentation, simply leave out the ``Help/module/<module-name>.rst``
file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
A FindXxx.cmake module will typically be loaded by the command::
FIND_PACKAGE(Xxx [major[.minor[.patch[.tweak]]]] [EXACT] Find Modules
[QUIET] [[REQUIRED|COMPONENTS] [components...]]) ------------
If any version numbers are given to the command it will set the following A "find module" is a ``Modules/Find<package>.cmake`` file to be loaded
variables before loading the module: by the :command:`find_package` command when invoked for ``<package>``.
Xxx_FIND_VERSION The primary task of a find module is to determine whether a package
full requested version string exists on the system, set the ``<package>_FOUND`` variable to reflect
this and provide any variables, macros and imported targets required to
use the package.
Xxx_FIND_VERSION_MAJOR The traditional approach is to use variables for everything, including
major version if requested, else 0 libraries and executables: see the `Standard Variable Names`_ section
below. This is what most of the existing find modules provided by CMake
do.
Xxx_FIND_VERSION_MINOR The more modern approach is to behave as much like
minor version if requested, else 0 ``<package>Config.cmake`` files as possible, by providing imported
targets. As well as matching how ``*Config.cmake`` files work, the
libraries, include directories and compile definitions are all set just
by using the target in a :command:`target_link_libraries` call. The
disadvantage is that ``*Config.cmake`` files of projects that use
imported targets from find modules may require more work to make sure
those imported targets that are in the link interface are available.
Xxx_FIND_VERSION_PATCH In either case (or even when providing both variables and imported
patch version if requested, else 0 targets), find modules should provide backwards compatibility with old
versions that had the same name.
Xxx_FIND_VERSION_TWEAK A FindFoo.cmake module will typically be loaded by the command::
tweak version if requested, else 0
Xxx_FIND_VERSION_COUNT find_package(Foo [major[.minor[.patch[.tweak]]]]
number of version components, 0 to 4 [EXACT] [QUIET] [REQUIRED]
[[COMPONENTS] [components...]]
[OPTIONAL_COMPONENTS components...]
[NO_POLICY_SCOPE])
Xxx_FIND_VERSION_EXACT See the :command:`find_package` documentation for details on what
true if EXACT option was given variables are set for the find module. Most of these are dealt with by
using :module:`FindPackageHandleStandardArgs`.
If the find module supports versioning it should locate a version of Briefly, the module should only locate versions of the package
the package that is compatible with the version requested. If a compatible with the requested version, as described by the
compatible version of the package cannot be found the module should ``Foo_FIND_VERSION`` family of variables. If ``Foo_FIND_QUIETLY`` is
not report success. The version of the package found should be stored set to true, it should avoid printing messages, including anything
in "Xxx_VERSION..." version variables documented by the module. complaining about the package not being found. If ``Foo_FIND_REQUIRED``
is set to true, the module should issue a ``FATAL_ERROR`` if the package
cannot be found. If neither are set to true, it should print a
non-fatal message if it cannot find the package.
If the QUIET option is given to the command it will set the variable Packages that find multiple semi-independent parts (like bundles of
Xxx_FIND_QUIETLY to true before loading the FindXxx.cmake module. If libraries) should search for the components listed in
this variable is set the module should not complain about not being ``Foo_FIND_COMPONENTS`` if it is set , and only set ``Foo_FOUND`` to
able to find the package. If the true if for each searched-for component ``<c>`` that was not found,
REQUIRED option is given to the command it will set the variable ``Foo_FIND_REQUIRED_<c>`` is not set to true. The ``HANDLE_COMPONENTS``
Xxx_FIND_REQUIRED to true before loading the FindXxx.cmake module. If argument of ``find_package_handle_standard_args()`` can be used to
this variable is set the module should issue a FATAL_ERROR if the implement this.
package cannot be found.
If neither the QUIET nor REQUIRED options are given then the
FindXxx.cmake module should look for the package and complain without
error if the module is not found.
FIND_PACKAGE() will set the variable CMAKE_FIND_PACKAGE_NAME to If ``Foo_FIND_COMPONENTS`` is not set, which modules are searched for
contain the actual name of the package. and required is up to the find module, but should be documented.
A package can provide sub-components. For internal implementation, it is a generally accepted convention that
Those components can be listed after the COMPONENTS (or REQUIRED) or variables starting with underscore are for temporary use only.
OPTIONAL_COMPONENTS keywords. The set of all listed components will be
specified in a Xxx_FIND_COMPONENTS variable.
For each package-specific component, say Yyy, a variable Xxx_FIND_REQUIRED_Yyy
will be set to true if it listed after COMPONENTS and it will be set to false
if it was listed after OPTIONAL_COMPONENTS.
Using those variables a FindXxx.cmake module and also a XxxConfig.cmake
package configuration file can determine whether and which components have
been requested, and whether they were requested as required or as optional.
For each of the requested components a Xxx_Yyy_FOUND variable should be set
accordingly.
The per-package Xxx_FOUND variable should be only set to true if all requested
required components have been found. A missing optional component should not
keep the Xxx_FOUND variable from being set to true.
If the package provides Xxx_INCLUDE_DIRS and Xxx_LIBRARIES variables, the
include dirs and libraries for all components which were requested and which
have been found should be added to those two variables.
To get this behavior you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS() Like all modules, find modules should be properly documented. To add a
macro, as an example see FindJPEG.cmake. module to the CMake documentation, follow the steps in the `Module
Documentation`_ section above.
For internal implementation, it's a generally accepted convention that
variables starting with underscore are for temporary use only. (variable
starting with an underscore are not intended as a reserved prefix). Standard Variable Names
~~~~~~~~~~~~~~~~~~~~~~~
For a ``FindXxx.cmake`` module that takes the approach of setting
variables (either instead of or in addition to creating imported
targets), the following variable names should be used to keep things
consistent between find modules. Note that all variables start with
``Xxx_`` to make sure they do not interfere with other find modules; the
same consideration applies to macros, functions and imported targets.
``Xxx_INCLUDE_DIRS``
The final set of include directories listed in one variable for use by
client code. This should not be a cache entry.
``Xxx_LIBRARIES``
The libraries to link against to use Xxx. These should include full
paths. This should not be a cache entry.
``Xxx_DEFINITIONS``
Definitions to use when compiling code that uses Xxx. This really
shouldn't include options such as ``-DHAS_JPEG`` that a client
source-code file uses to decide whether to ``#include <jpeg.h>``
``Xxx_EXECUTABLE``
Where to find the Xxx tool.
``Xxx_Yyy_EXECUTABLE``
Where to find the Yyy tool that comes with Xxx.
``Xxx_LIBRARY_DIRS``
Optionally, the final set of library directories listed in one
variable for use by client code. This should not be a cache entry.
``Xxx_ROOT_DIR``
Where to find the base directory of Xxx.
``Xxx_VERSION_Yy``
Expect Version Yy if true. Make sure at most one of these is ever true.
``Xxx_WRAP_Yy``
If False, do not try to use the relevant CMake wrapping command.
``Xxx_Yy_FOUND``
If False, optional Yy part of Xxx sytem is not available.
``Xxx_FOUND``
Set to false, or undefined, if we haven't found, or don't want to use
Xxx.
``Xxx_NOT_FOUND_MESSAGE``
Should be set by config-files in the case that it has set
``Xxx_FOUND`` to FALSE. The contained message will be printed by the
:command:`find_package` command and by
``find_package_handle_standard_args()`` to inform the user about the
problem.
``Xxx_RUNTIME_LIBRARY_DIRS``
Optionally, the runtime library search path for use when running an
executable linked to shared libraries. The list should be used by
user code to create the ``PATH`` on windows or ``LD_LIBRARY_PATH`` on
UNIX. This should not be a cache entry.
``Xxx_VERSION``
The full version string of the package found, if any. Note that many
existing modules provide ``Xxx_VERSION_STRING`` instead.
``Xxx_VERSION_MAJOR``
The major version of the package found, if any.
``Xxx_VERSION_MINOR``
The minor version of the package found, if any.
``Xxx_VERSION_PATCH``
The patch version of the package found, if any.
The following names should not usually be used in CMakeLists.txt files, but
are typically cache variables for users to edit and control the
behaviour of find modules (like entering the path to a library manually)
``Xxx_LIBRARY``
The path of the Xxx library (as used with :command:`find_library`, for
example).
``Xxx_Yy_LIBRARY``
The path of the Yy library that is part of the Xxx system. It may or
may not be required to use Xxx.
``Xxx_INCLUDE_DIR``
Where to find headers for using the Xxx library.
``Xxx_Yy_INCLUDE_DIR``
Where to find headers for using the Yy library of the Xxx system.
To prevent users being overwhelmed with settings to configure, try to
keep as many options as possible out of the cache, leaving at least one
option which can be used to disable use of the module, or locate a
not-found library (e.g. ``Xxx_ROOT_DIR``). For the same reason, mark
most cache options as advanced.
While these are the standard variable names, you should provide
backwards compatibility for any old names that were actually in use.
Make sure you comment them as deprecated, so that no-one starts using
them.
A Sample Find Module
~~~~~~~~~~~~~~~~~~~~
We will describe how to create a simple find module for a library
``Foo``.
The first thing that is needed is documentation. CMake's documentation
system requires you to start the file with a documentation marker and
the name of the module. You should follow this with a simple statement
of what the module does.
.. code-block:: cmake
#.rst:
# FindFoo
# -------
#
# Finds the Foo library
#
More description may be required for some packages. If there are
caveats or other details users of the module should be aware of, you can
add further paragraphs below this. Then you need to document what
variables and imported targets are set by the module, such as
.. code-block:: cmake
# This will define the following variables::
#
# Foo_FOUND - True if the system has the Foo library
# Foo_VERSION - The version of the Foo library which was found
#
# and the following imported targets::
#
# Foo::Foo - The Foo library
If the package provides any macros, they should be listed here, but can
be documented where they are defined. See the `Module
Documentation`_ section above for more details.
After the documentation, leave a blank line, and then add a copyright and
licence notice block
.. code-block:: cmake
#=============================================================================
# Copyright 2009-2011 Your Name
#
# 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.)
If the module is new to CMake, you may want to provide a warning for
projects that do not require a high enough CMake version.
.. code-block:: cmake
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.0.0)
message(AUTHOR_WARNING "Your project should require at least CMake 3.0.0 to use FindFoo.cmake")
endif()
Now the actual libraries and so on have to be found. The code here will
obviously vary from module to module (dealing with that, after all, is the
point of find modules), but there tends to be a common pattern for libraries.
First, we try to use ``pkg-config`` to find the library. Note that we
cannot rely on this, as it may not be available, but it provides a good
starting point.
.. code-block:: cmake
find_package(PkgConfig)
pkg_check_modules(PC_Foo QUIET Foo)
This should define some variables starting ``PC_Foo_`` that contain the
information from the ``Foo.pc`` file.
Now we need to find the libraries and include files; we use the
information from ``pkg-config`` to provide hints to CMake about where to
look.
.. code-block:: cmake
find_path(Foo_INCLUDE_DIR
NAMES foo.h
PATHS ${PC_Foo_INCLUDE_DIRS}
# if you need to put #include <Foo/foo.h> in your code, add:
PATH_SUFFIXES Foo
)
find_library(Foo_LIBRARY
NAMES foo
PATHS ${PC_Foo_LIBRARY_DIRS}
)
If you have a good way of getting the version (from a header file, for
example), you can use that information to set ``Foo_VERSION`` (although
note that find modules have traditionally used ``Foo_VERSION_STRING``,
so you may want to set both). Otherwise, attempt to use the information
from ``pkg-config``
.. code-block:: cmake
set(Foo_VERSION ${PC_Foo_VERSION})
Now we can use :module:`FindPackageHandleStandardArgs` to do most of the
rest of the work for us
.. code-block:: cmake
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Foo
FOUND_VAR Foo_FOUND
REQUIRED_VARS
Foo_LIBRARY
Foo_INCLUDE_DIR
VERSION_VAR Foo_VERSION
)
This will check that the ``REQUIRED_VARS`` contain values (that do not
end in ``-NOTFOUND``) and set ``Foo_FOUND`` appropriately. It will also
cache those values. If ``Foo_VERSION`` is set, and a required version
was passed to :command:`find_package`, it will check the requested version
against the one in ``Foo_VERSION``. It will also print messages as
appropriate; note that if the package was found, it will print the
contents of the first required variable to indicate where it was found.
At this point, we have to provide a way for users of the find module to
link to the library or libraries that were found. There are two
approaches, as discussed in the `Find Modules`_ section above. The
traditional variable approach looks like
.. code-block:: cmake
if(Foo_FOUND)
set(Foo_LIBRARIES ${Foo_LIBRARY})
set(Foo_INCLUDE_DIRS ${Foo_INCLUDE_DIR})
set(Foo_DEFINITIONS ${PC_Foo_CFLAGS_OTHER})
endif()
If more than one library was found, all of them should be included in
these variables (see the `Standard Variable Names`_ section for more
information).
When providing imported targets, these should be namespaced (hence the
``Foo::`` prefix); CMake will recognize that values passed to
:command:`target_link_libraries` that contain ``::`` in their name are
supposed to be imported targets (rather than just library names), and
will produce appropriate diagnostic messages if that target does not
exist (see policy :policy:`CMP0028`).
.. code-block:: cmake
if(Foo_FOUND AND NOT TARGET Foo::Foo)
add_library(Foo::Foo UNKNOWN IMPORTED)
set_target_properties(Foo::Foo PROPERTIES
IMPORTED_LOCATION "${Foo_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_Foo_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${Foo_INCLUDE_DIR}"
)
endif()
One thing to note about this is that the ``INTERFACE_INCLUDE_DIRECTORIES`` and
similar properties should only contain information about the target itself, and
not any of its dependencies. Instead, those dependencies should also be
targets, and CMake should be told that they are dependencies of this target.
CMake will then combine all the necessary information automatically.
We should also provide some information about the package, such as where to
download it.
.. code-block:: cmake
include(FeatureSummary)
set_package_properties(Foo PROPERTIES
URL "http://www.foo.example.com/"
DESCRIPTION "A library for doing useful things"
)
Most of the cache variables should be hidden in the ``ccmake`` interface unless
the user explicitly asks to edit them.
.. code-block:: cmake
mark_as_advanced(
Foo_INCLUDE_DIR
Foo_LIBRARY
)
If this module replaces an older version, you should set compatibility variables
to cause the least disruption possible.
.. code-block:: cmake
# compatibility variables
set(Foo_VERSION_STRING ${Foo_VERSION})

View File

@ -188,3 +188,8 @@ property is non-empty::
Content of ``...`` converted to upper case. Content of ``...`` converted to upper case.
``$<MAKE_C_IDENTIFIER:...>`` ``$<MAKE_C_IDENTIFIER:...>``
Content of ``...`` converted to a C identifier. Content of ``...`` converted to a C identifier.
``$<TARGET_OBJECTS:objLib>``
List of objects resulting from build of ``objLib``. ``objLib`` must be an
object of type ``OBJECT_LIBRARY``. This expression may only be used in
the sources of :command:`add_library` and :command:`add_executable`
commands.

View File

@ -138,6 +138,7 @@ All Modules
/module/FindMPEG /module/FindMPEG
/module/FindMPI /module/FindMPI
/module/FindOpenAL /module/FindOpenAL
/module/FindOpenCL
/module/FindOpenGL /module/FindOpenGL
/module/FindOpenMP /module/FindOpenMP
/module/FindOpenSceneGraph /module/FindOpenSceneGraph

View File

@ -102,3 +102,5 @@ All Policies
/policy/CMP0048 /policy/CMP0048
/policy/CMP0049 /policy/CMP0049
/policy/CMP0050 /policy/CMP0050
/policy/CMP0051
/policy/CMP0052

View File

@ -98,10 +98,17 @@ Properties on Targets
/prop_tgt/COMPATIBLE_INTERFACE_STRING /prop_tgt/COMPATIBLE_INTERFACE_STRING
/prop_tgt/COMPILE_DEFINITIONS_CONFIG /prop_tgt/COMPILE_DEFINITIONS_CONFIG
/prop_tgt/COMPILE_DEFINITIONS /prop_tgt/COMPILE_DEFINITIONS
/prop_tgt/COMPILE_FEATURES
/prop_tgt/COMPILE_FLAGS /prop_tgt/COMPILE_FLAGS
/prop_tgt/COMPILE_OPTIONS /prop_tgt/COMPILE_OPTIONS
/prop_tgt/COMPILE_PDB_NAME
/prop_tgt/COMPILE_PDB_NAME_CONFIG
/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY
/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/CONFIG_OUTPUT_NAME /prop_tgt/CONFIG_OUTPUT_NAME
/prop_tgt/CONFIG_POSTFIX /prop_tgt/CONFIG_POSTFIX
/prop_tgt/CXX_STANDARD
/prop_tgt/CXX_EXTENSIONS
/prop_tgt/DEBUG_POSTFIX /prop_tgt/DEBUG_POSTFIX
/prop_tgt/DEFINE_SYMBOL /prop_tgt/DEFINE_SYMBOL
/prop_tgt/EchoString /prop_tgt/EchoString
@ -144,10 +151,12 @@ Properties on Targets
/prop_tgt/INSTALL_RPATH_USE_LINK_PATH /prop_tgt/INSTALL_RPATH_USE_LINK_PATH
/prop_tgt/INTERFACE_AUTOUIC_OPTIONS /prop_tgt/INTERFACE_AUTOUIC_OPTIONS
/prop_tgt/INTERFACE_COMPILE_DEFINITIONS /prop_tgt/INTERFACE_COMPILE_DEFINITIONS
/prop_tgt/INTERFACE_COMPILE_FEATURES
/prop_tgt/INTERFACE_COMPILE_OPTIONS /prop_tgt/INTERFACE_COMPILE_OPTIONS
/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES /prop_tgt/INTERFACE_INCLUDE_DIRECTORIES
/prop_tgt/INTERFACE_LINK_LIBRARIES /prop_tgt/INTERFACE_LINK_LIBRARIES
/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE /prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE
/prop_tgt/INTERFACE_SOURCES
/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES /prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG /prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_tgt/INTERPROCEDURAL_OPTIMIZATION /prop_tgt/INTERPROCEDURAL_OPTIMIZATION

View File

@ -201,6 +201,8 @@ Variables that Control the Build
/variable/CMAKE_AUTOUIC /variable/CMAKE_AUTOUIC
/variable/CMAKE_AUTOUIC_OPTIONS /variable/CMAKE_AUTOUIC_OPTIONS
/variable/CMAKE_BUILD_WITH_INSTALL_RPATH /variable/CMAKE_BUILD_WITH_INSTALL_RPATH
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_CONFIG_POSTFIX /variable/CMAKE_CONFIG_POSTFIX
/variable/CMAKE_DEBUG_POSTFIX /variable/CMAKE_DEBUG_POSTFIX
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG /variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
@ -255,6 +257,10 @@ Variables for Languages
:maxdepth: 1 :maxdepth: 1
/variable/CMAKE_COMPILER_IS_GNULANG /variable/CMAKE_COMPILER_IS_GNULANG
/variable/CMAKE_CXX_COMPILE_FEATURES
/variable/CMAKE_CXX_KNOWN_FEATURES
/variable/CMAKE_CXX_STANDARD
/variable/CMAKE_CXX_EXTENSIONS
/variable/CMAKE_Fortran_MODDIR_DEFAULT /variable/CMAKE_Fortran_MODDIR_DEFAULT
/variable/CMAKE_Fortran_MODDIR_FLAG /variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG /variable/CMAKE_Fortran_MODOUT_FLAG

View File

@ -0,0 +1 @@
.. cmake-module:: ../../Modules/FindOpenCL.cmake

24
Help/policy/CMP0051.rst Normal file
View File

@ -0,0 +1,24 @@
CMP0051
-------
List TARGET_OBJECTS in SOURCES target property.
CMake 3.0 and lower did not include the ``TARGET_OBJECTS``
:manual:`generator expression <cmake-generator-expressions(7)>` when
returning the :prop_tgt:`SOURCES` target property.
Configure-time CMake code is not able to handle generator expressions. If
using the :prop_tgt:`SOURCES` target property at configure time, it may be
necessary to first remove generator expressions using the
:command:`string(GENEX_STRIP)` command. Generate-time CMake code such as
:command:`file(GENERATE)` can handle the content without stripping.
The ``OLD`` behavior for this policy is to omit ``TARGET_OBJECTS``
expressions from the :prop_tgt:`SOURCES` target property. The ``NEW``
behavior for this policy is to include ``TARGET_OBJECTS`` expressions
in the output.
This policy was introduced in CMake version 3.1.
CMake version |release| warns when the policy is not set and uses
``OLD`` behavior. Use the :command:`cmake_policy` command to set it
to ``OLD`` or ``NEW`` explicitly.

24
Help/policy/CMP0052.rst Normal file
View File

@ -0,0 +1,24 @@
CMP0052
-------
Reject source and build dirs in installed INTERFACE_INCLUDE_DIRECTORIES.
CMake 3.0 and lower allowed subdirectories of the source directory or build
directory to be in the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of
installed and exported targets, if the directory was also a subdirectory of
the installation prefix. This makes the installation depend on the
existence of the source dir or binary dir, and the installation will be
broken if either are removed after installation.
See :ref:`Include Directories and Usage Requirements` for more on
specifying include directories for targets.
The OLD behavior for this policy is to export the content of the
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` with the source or binary
directory. The NEW behavior for this
policy is to issue an error if such a directory is used.
This policy was introduced in CMake version 3.1.
CMake version |release| warns when the policy is not set and uses
``OLD`` behavior. Use the :command:`cmake_policy` command to set it
to ``OLD`` or ``NEW`` explicitly.

View File

@ -0,0 +1,11 @@
COMPILE_FEATURES
----------------
Compiler features enabled for this target.
The list of features in this property are a subset of the features listed
in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable.
Contents of ``COMPILE_FEATURES`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for
available expressions.

View File

@ -0,0 +1,11 @@
COMPILE_PDB_NAME
----------------
Output name for the MS debug symbol ``.pdb`` file generated by the
compiler while building source files.
This property specifies the base name for the debug symbols file.
If not set, the default is unspecified.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_NAME`
.. include:: COMPILE_PDB_NOTE.txt

View File

@ -0,0 +1,10 @@
COMPILE_PDB_NAME_<CONFIG>
-------------------------
Per-configuration output name for the MS debug symbol ``.pdb`` file
generated by the compiler while building source files.
This is the configuration-specific version of :prop_tgt:`COMPILE_PDB_NAME`.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_NAME_<CONFIG>`
.. include:: COMPILE_PDB_NOTE.txt

View File

@ -0,0 +1,8 @@
.. note::
The compiler-generated program database files are specified by the
``/Fd`` compiler flag and are not the same as linker-generated
program database files specified by the ``/pdb`` linker flag.
Use the |PDB_XXX| property to specify the latter.
This property is not implemented by the :generator:`Visual Studio 6`
generator.

View File

@ -0,0 +1,13 @@
COMPILE_PDB_OUTPUT_DIRECTORY
----------------------------
Output directory for the MS debug symbol ``.pdb`` file
generated by the compiler while building source files.
This property specifies the directory into which the MS debug symbols
will be placed by the compiler. This property is initialized by the
value of the :variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY` variable
if it is set when a target is created.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY`
.. include:: COMPILE_PDB_NOTE.txt

View File

@ -0,0 +1,16 @@
COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
-------------------------------------
Per-configuration output directory for the MS debug symbol ``.pdb`` file
generated by the compiler while building source files.
This is a per-configuration version of
:prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY`,
but multi-configuration generators (VS, Xcode) do NOT append a
per-configuration subdirectory to the specified directory. This
property is initialized by the value of the
:variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable
if it is set when a target is created.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`
.. include:: COMPILE_PDB_NOTE.txt

View File

@ -0,0 +1,8 @@
CXX_EXTENSIONS
--------------
Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
used. For some compilers, this results in adding a flag such
as ``-std=gnu++11`` instead of ``-std=c++11`` to the compile line.

View File

@ -0,0 +1,14 @@
CXX_STANDARD
------------
The C++ standard whose features are required to build this target.
This property specifies the C++ standard whose features are required
to build this target. For some compilers, this results in adding a
flag such as ``-std=c++11`` to the compile line.
Supported values are ``98`` and ``11``.
This property is initialized by the value of
the :variable:`CMAKE_CXX_STANDARD` variable if it is set when a target
is created.

View File

@ -0,0 +1,14 @@
INTERFACE_COMPILE_FEATURES
--------------------------
List of public compile requirements for a library.
Targets may populate this property to publish the compiler features
required to compile against the headers for the target. Consuming
targets can add entries to their own :prop_tgt:`COMPILE_FEATURES`
property such as ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_FEATURES>``
to require the features specified in the interface of ``foo``.
Contents of ``INTERFACE_COMPILE_FEATURES`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions.

View File

@ -0,0 +1,15 @@
INTERFACE_SOURCES
-----------------
List of interface sources to pass to the compiler.
Targets may populate this property to publish the sources
for consuming targets to compile. Consuming
targets can add entries to their own :prop_tgt:`SOURCES` property
such as ``$<TARGET_PROPERTY:foo,INTERFACE_SOURCES>`` to use the
sources specified in the interface of ``foo``.
Contents of ``INTERFACE_SOURCES`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -7,7 +7,5 @@ linker for an executable or shared library target.
This property specifies the base name for the debug symbols file. This property specifies the base name for the debug symbols file.
If not set, the logical target name is used by default. If not set, the logical target name is used by default.
.. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_NAME`
.. include:: PDB_NOTE.txt .. include:: PDB_NOTE.txt
This property is not implemented by the :generator:`Visual Studio 6`
generator.

View File

@ -6,5 +6,5 @@ generated by the linker for an executable or shared library target.
This is the configuration-specific version of :prop_tgt:`PDB_NAME`. This is the configuration-specific version of :prop_tgt:`PDB_NAME`.
This property is not implemented by the :generator:`Visual Studio 6` .. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_NAME_<CONFIG>`
generator. .. include:: PDB_NOTE.txt

View File

@ -3,6 +3,10 @@
is invoked to produce them so they have no linker-generated ``.pdb`` file is invoked to produce them so they have no linker-generated ``.pdb`` file
containing debug symbols. containing debug symbols.
The compiler-generated program database files specified by the MSVC The linker-generated program database files are specified by the
``/Fd`` flag are not the same as linker-generated program database ``/pdb`` linker flag and are not the same as compiler-generated
files and so are not influenced by this property. program database files specified by the ``/Fd`` compiler flag.
Use the |COMPILE_PDB_XXX| property to specify the latter.
This property is not implemented by the :generator:`Visual Studio 6`
generator.

View File

@ -9,7 +9,5 @@ will be placed by the linker. This property is initialized by the
value of the :variable:`CMAKE_PDB_OUTPUT_DIRECTORY` variable if it is value of the :variable:`CMAKE_PDB_OUTPUT_DIRECTORY` variable if it is
set when a target is created. set when a target is created.
.. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY`
.. include:: PDB_NOTE.txt .. include:: PDB_NOTE.txt
This property is not implemented by the :generator:`Visual Studio 6`
generator.

View File

@ -11,5 +11,5 @@ property is initialized by the value of the
:variable:`CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable if it is :variable:`CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable if it is
set when a target is created. set when a target is created.
This property is not implemented by the :generator:`Visual Studio 6` .. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`
generator. .. include:: PDB_NOTE.txt

View File

@ -3,5 +3,4 @@ SOURCES
Source names specified for a target. Source names specified for a target.
Read-only list of sources specified for a target. The names returned List of sources specified for a target.
are suitable for passing to the set_source_files_properties command.

View File

@ -0,0 +1,7 @@
0-sample-topic
--------------
* This is a sample release note for the change in a topic.
Developers should add similar notes for each topic branch
making a noteworthy change. Each document should be named
and titled to match the topic name to avoid merge conflicts.

View File

@ -0,0 +1,5 @@
CMP0052
-------
* Policy :policy:`CMP0052` introduced to control directories in the
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of exported targets.

View File

@ -0,0 +1,6 @@
CMakeDetermineVSServicePack
---------------------------
* The :module:`CMakeDetermineVSServicePack` module now warns that
it is deprecated and should not longer be used. Use the
:variable:`CMAKE_<LANG>_COMPILER_VERSION` variable instead.

View File

@ -0,0 +1,6 @@
ExternalProject-BUILD_ALWAYS
----------------------------
* The :module:`ExternalProject` module ``ExternalProject_Add`` command
learned a new ``BUILD_ALWAYS`` option to cause the external project
build step to run every time the host project is built.

View File

@ -0,0 +1,6 @@
ExternalProject-no-download-progress
------------------------------------
* The :module:`ExternalProject` module ``ExternalProject_Add`` command
learned a new ``DOWNLOAD_NO_PROGRESS`` option to disable progress
output while downloading the source tarball.

View File

@ -0,0 +1,11 @@
ExternalProject_exclude-from-all
--------------------------------
* The :module:`ExternalProject` module ``ExternalProject_Add`` command
learned a new ``EXCLUDE_FROM_ALL`` option to cause the external
project target to have the :prop_tgt:`EXCLUDE_FROM_ALL` target
property set.
* The :module:`ExternalProject` module ``ExternalProject_Add_Step`` command
learned a new ``EXCLUDE_FROM_MAIN`` option to cause the step to not be
a direct dependency of the main external project target.

View File

@ -0,0 +1,6 @@
FeatureSummary_combine_WHAT_values
----------------------------------
* The :module:`FeatureSummary` module ``feature_summary`` API
learned to accept multiple values for the ``WHAT`` option and
combine them appropriately.

View File

@ -0,0 +1,7 @@
FindGTest-AUTO-SOURCES
----------------------
* The :module:`FindGTest` module ``gtest_add_tests`` macro learned
a new ``AUTO`` option to automatically read the :prop_tgt:`SOURCES`
target property of the test executable and scan the source files
for tests to be added.

View File

@ -0,0 +1,5 @@
FindHg-WC_INFO
--------------
* The :module:`FindHg` module gained a new ``Hg_WC_INFO`` macro to
help run ``hg`` to extract information about a Mercurial work copy.

View File

@ -0,0 +1,5 @@
FindPkgConfig-PKG_CONFIG
------------------------
* The :module:`FindPkgConfig` module learned to use the ``PKG_CONFIG``
environment variable value as the ``pkg-config`` executable, if set.

View File

@ -0,0 +1,4 @@
add-FindOpenCL
--------------
* The :module:`FindOpenCL` module was introduced.

View File

@ -0,0 +1,5 @@
add_custom_command-DEPENDS-genex
--------------------------------
* The :command:`add_custom_command` command learned to interpret
:manual:`cmake-generator-expressions(7)` in arguments to ``DEPENDS``.

View File

@ -0,0 +1,18 @@
target-language-features
------------------------
* New :prop_tgt:`CXX_STANDARD` and :prop_tgt:`CXX_EXTENSIONS` target
properties may specify values which CMake uses to compute required
compile options such as ``-std=c++11`` or ``-std=gnu++11``. The
:variable:`CMAKE_CXX_STANDARD` and :variable:`CMAKE_CXX_EXTENSIONS`
variables may be set to initialize the target properties.
* New :prop_tgt:`COMPILE_FEATURES` target property may contain a list
of features required to compile a target. CMake uses this
information to ensure that the compiler in use is capable of building
the target, and to add any necessary compile flags to support language
features.
* New :command:`target_compile_features` command allows populating the
:prop_tgt:`COMPILE_FEATURES` target property, just like any other
build variable.

View File

@ -0,0 +1,6 @@
cpack-deb-compression-types
---------------------------
* The :module:`CPackDeb` module learned a new
:variable:`CPACK_DEBIAN_COMPRESSION_TYPE` variable to set the
tarball compression type.

View File

@ -0,0 +1,5 @@
ctest-coverage-extra
--------------------
* The :command:`ctest_coverage` command learned to read variable
``CTEST_COVERAGE_EXTRA_FLAGS`` to set ``CoverageExtraFlags``.

View File

@ -0,0 +1,5 @@
ctest-intel-coverage
--------------------
* The :command:`ctest_coverage` command learned to support
Intel coverage files with the ``codecov`` tool.

View File

@ -0,0 +1,5 @@
custom-ninja-deptypes
---------------------
* Add a `CMAKE_NINJA_DEPTYPE_<LANG>` variable so that compilers may set the
deptype for use in Ninja other than those CMake itself knows about.

View File

@ -0,0 +1,6 @@
faster-parsers
--------------
* The :manual:`cmake-language(7)` internal implementation of generator
expression and list expansion parsers have been optimized and shows
non-trivial speedup on large projects.

View File

@ -0,0 +1,5 @@
link-libraries-response-files
-----------------------------
* The Makefile generators learned to use response files with GNU tools
on Windows to pass library directories and names to the linker.

View File

@ -0,0 +1,10 @@
msvc-compiler-pdb-files
-----------------------
* New :prop_tgt:`COMPILE_PDB_NAME` and
:prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY` target properties
were introduced to specify the MSVC compiler program database
file location (``cl /Fd``). This complements the existing
:prop_tgt:`PDB_NAME` and :prop_tgt:`PDB_OUTPUT_DIRECTORY`
target properties that specify the linker program database
file location (``link /pdb``).

View File

@ -0,0 +1,6 @@
string-GENEX_STRIP
------------------
* The :command:`string` command learned a new ``GENEX_STRIP`` subcommand
which removes
:manual:`generator expression <cmake-generator-expressions(7)>`.

View File

@ -0,0 +1,5 @@
target-INTERFACE_SOURCES
------------------------
* A new :prop_tgt:`INTERFACE_SOURCES` target property was introduced. This is
consumed by dependent targets, which compile and link the listed sources.

View File

@ -0,0 +1,12 @@
target-SOURCES-genex
--------------------
* The :prop_tgt:`SOURCES` target property now contains
:manual:`generator expression <cmake-generator-expressions(7)>`
such as ``TARGET_OBJECTS`` when read at configure time, if
policy :policy:`CMP0051` is ``NEW``.
* The :prop_tgt:`SOURCES` target property now generally supports
:manual:`generator expression <cmake-generator-expressions(7)>`. The
generator expressions may be used in the :command:`add_library` and
:command:`add_executable` commands.

View File

@ -0,0 +1,6 @@
target-SOURCES-write.rst
------------------------
* It is now possible to write and append to the :prop_tgt:`SOURCES` target
property. The :variable:`CMAKE_DEBUG_TARGET_PROPERTIES` variable may be
used to trace the origin of sources.

View File

@ -0,0 +1,5 @@
target_sources-command
----------------------
* The :command:`target_sources` command was added to add to the
:prop_tgt:`SOURCES` target property.

View File

@ -5,6 +5,8 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file This file should include the adjacent "dev.txt" file
in development versions but not in release versions. in development versions but not in release versions.
.. include:: dev.txt
Releases Releases
======== ========

View File

@ -0,0 +1,8 @@
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
----------------------------------
Output directory for MS debug symbol ``.pdb`` files
generated by the compiler while building source files.
This variable is used to initialize the
:prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY` property on all the targets.

View File

@ -0,0 +1,11 @@
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
-------------------------------------------
Per-configuration output directory for MS debug symbol ``.pdb`` files
generated by the compiler while building source files.
This is a per-configuration version of
:variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY`.
This variable is used to initialize the
:prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`
property on all the targets.

View File

@ -0,0 +1,8 @@
CMAKE_CXX_COMPILE_FEATURES
--------------------------
List of features known to the C++ compiler
These features are known to be available for use with the C++ compiler. This
list is a subset of the features listed in the :variable:`CMAKE_CXX_KNOWN_FEATURES`
variable.

View File

@ -0,0 +1,8 @@
CMAKE_CXX_EXTENSIONS
--------------------
Default value for ``CXX_EXTENSIONS`` property of targets.
This variable is used to initialize the :prop_tgt:`CXX_EXTENSIONS`
property on all targets. See that target property for additional
information.

View File

@ -0,0 +1,238 @@
CMAKE_CXX_KNOWN_FEATURES
------------------------
List of C++ features known to this version of CMake.
The features listed in this variable may be known to be available to the
C++ compiler. If the feature is available with the C++ compiler, it will
be listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable.
The features listed here may be used with the :command:`target_compile_features`
command.
The features known to this version of CMake are:
``cxx_alias_templates``
Template aliases, as defined in N2258_.
.. _N2258: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
``cxx_alignas``
Alignment control ``alignas``, as defined in N2341_.
.. _N2341: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
``cxx_alignof``
Alignment control ``alignof``, as defined in N2341_.
.. _N2341: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
``cxx_attributes``
Generic attributes, as defined in N2761_.
.. _N2761: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
``cxx_auto_type``
Automatic type deduction, as defined in N1984_.
.. _N1984: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
``cxx_constexpr``
Constant expressions, as defined in N2235_.
.. _N2235: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
``cxx_decltype_incomplete_return_types``
Decltype on incomplete return types, as defined in N3276_.
.. _N3276 : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf
``cxx_decltype``
Decltype, as defined in N2343_.
.. _N2343: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
``cxx_default_function_template_args``
Default template arguments for function templates, as defined in DR226_
.. _DR226: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
``cxx_defaulted_functions``
Defaulted functions, as defined in N2346_.
.. _N2346: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
``cxx_defaulted_move_initializers``
Defaulted move initializers, as defined in N3053_.
.. _N3053: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
``cxx_delegating_constructors``
Delegating constructors, as defined in N1986_.
.. _N1986: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
``cxx_deleted_functions``
Deleted functions, as defined in N2346_.
.. _N2346: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
``cxx_enum_forward_declarations``
Enum forward declarations, as defined in N2764_.
.. _N2764: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
``cxx_explicit_conversions``
Explicit conversion operators, as defined in N2437_.
.. _N2437: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
``cxx_extended_friend_declarations``
Extended friend declarations, as defined in N1791_.
.. _N1791: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
``cxx_extern_templates``
Extern templates, as defined in N1987_.
.. _N1987: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
``cxx_final``
Override control ``final`` keyword, as defined in N2928_.
.. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
``cxx_func_identifier``
Predefined ``__func__`` identifier, as defined in N2340_.
.. _N2340: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
``cxx_generalized_initializers``
Initializer lists, as defined in N2672_.
.. _N2672: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
``cxx_inheriting_constructors``
Inheriting constructors, as defined in N2540_.
.. _N2540: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
``cxx_inline_namespaces``
Inline namespaces, as defined in N2535_.
.. _N2535: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
``cxx_lambdas``
Lambda functions, as defined in N2927_.
.. _N2927: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf
``cxx_local_type_template_args``
Local and unnamed types as template arguments, as defined in N2657_.
.. _N2657: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
``cxx_long_long_type``
``long long`` type, as defined in N1811_.
.. _N1811: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
``cxx_noexcept``
Exception specifications, as defined in N3050_.
.. _N3050: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
``cxx_nonstatic_member_init``
Non-static data member initialization, as defined in N2756.
.. _N2756: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2756.htm
``cxx_nullptr``
Null pointer, as defined in N2431_.
.. _N2431: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
``cxx_override``
Override control ``override`` keyword, as defined in N2928_.
.. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
``cxx_range_for``
Range-based for, as defined in N2930_.
.. _N2930: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
``cxx_raw_string_literals``
Raw string literals, as defined in N2442_.
.. _N2442: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
``cxx_reference_qualified_functions``
Reference qualified functions, as defined in N2439_.
.. _N2439: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
``cxx_right_angle_brackets``
Right angle bracket parsing, as defined in N1757_.
.. _N1757: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
``cxx_rvalue_references``
R-value references, as defined in N2118_.
.. _N2118: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
``cxx_sizeof_member``
Size of non-static data members, as defined in N2253_.
.. _N2253: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
``cxx_static_assert``
Static assert, as defined in N1720_.
.. _N1720: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
``cxx_strong_enums``
Strongly typed enums, as defined in N2347_.
.. _N2347: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
``cxx_thread_local``
Thread-local variables, as defined in N2659_.
.. _N2659: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
``cxx_trailing_return_types``
Automatic function return type, as defined in N2541_.
.. _N2541: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
``cxx_unicode_literals``
Unicode string literals, as defined in N2442_.
.. _N2442: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
``cxx_uniform_initialization``
Uniform intialization, as defined in N2640_.
.. _N2640: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf
``cxx_unrestricted_unions``
Unrestricted unions, as defined in N2544_.
.. _N2544: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
``cxx_user_literals``
User-defined literals, as defined in N2765_.
.. _N2765: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
``cxx_variadic_macros``
Variadic macros, as defined in N1653_.
.. _N1653: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
``cxx_variadic_templates``
Variadic templates, as defined in N2242_.
.. _N2242: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf

View File

@ -0,0 +1,8 @@
CMAKE_CXX_STANDARD
------------------
Default value for ``CXX_STANDARD`` property of targets.
This variable is used to initialize the :prop_tgt:`CXX_STANDARD`
property on all targets. See that target property for additional
information.

View File

@ -6,7 +6,8 @@ Enables tracing output for target properties.
This variable can be populated with a list of properties to generate This variable can be populated with a list of properties to generate
debug output for when evaluating target properties. Currently it can debug output for when evaluating target properties. Currently it can
only be used when evaluating the :prop_tgt:`INCLUDE_DIRECTORIES`, only be used when evaluating the :prop_tgt:`INCLUDE_DIRECTORIES`,
:prop_tgt:`COMPILE_DEFINITIONS`, :prop_tgt:`COMPILE_OPTIONS`, :prop_tgt:`AUTOUIC_OPTIONS`, :prop_tgt:`COMPILE_DEFINITIONS`, :prop_tgt:`COMPILE_OPTIONS`,
:prop_tgt:`AUTOUIC_OPTIONS`, :prop_tgt:`SOURCES`, :prop_tgt:`COMPILE_FEATURES`,
:prop_tgt:`POSITION_INDEPENDENT_CODE` target properties and any other property :prop_tgt:`POSITION_INDEPENDENT_CODE` target properties and any other property
listed in :prop_tgt:`COMPATIBLE_INTERFACE_STRING` and other ``COMPATIBLE_INTERFACE_`` listed in :prop_tgt:`COMPATIBLE_INTERFACE_STRING` and other ``COMPATIBLE_INTERFACE_``
properties. It outputs an origin for each entry in the target property. properties. It outputs an origin for each entry in the target property.

View File

@ -1,7 +1,10 @@
CMAKE_HOST_SYSTEM CMAKE_HOST_SYSTEM
----------------- -----------------
Name of system cmake is being run on. Composit Name of OS CMake is being run on.
The same as CMAKE_SYSTEM but for the host system instead of the target This variable is the composite of :variable:`CMAKE_HOST_SYSTEM_NAME` and
system when cross compiling. :variable:`CMAKE_HOST_SYSTEM_VERSION`, e.g.
``${CMAKE_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_VERSION}``. If
:variable:`CMAKE_HOST_SYSTEM_VERSION` is not set, then this variable is
the same as :variable:`CMAKE_HOST_SYSTEM_NAME`.

View File

@ -3,5 +3,6 @@ CMAKE_HOST_SYSTEM_NAME
Name of the OS CMake is running on. Name of the OS CMake is running on.
The same as CMAKE_SYSTEM_NAME but for the host system instead of the On systems that have the uname command, this variable is set to the
target system when cross compiling. output of uname -s. ``Linux``, ``Windows``, and ``Darwin`` for Mac OS X
are the values found on the big three operating systems.

View File

@ -3,5 +3,6 @@ CMAKE_HOST_SYSTEM_PROCESSOR
The name of the CPU CMake is running on. The name of the CPU CMake is running on.
The same as CMAKE_SYSTEM_PROCESSOR but for the host system instead of On systems that support uname, this variable is set to the output of
the target system when cross compiling. uname -p, on windows it is set to the value of the environment variable
``PROCESSOR_ARCHITECTURE``.

View File

@ -1,7 +1,8 @@
CMAKE_HOST_SYSTEM_VERSION CMAKE_HOST_SYSTEM_VERSION
------------------------- -------------------------
OS version CMake is running on. The OS version CMake is running on.
The same as CMAKE_SYSTEM_VERSION but for the host system instead of A numeric version string for the system. On systems that support
the target system when cross compiling. uname, this variable is set to the output of uname -r. On other
systems this is set to major-minor version numbers.

View File

@ -1,9 +1,10 @@
CMAKE_SYSTEM CMAKE_SYSTEM
------------ ------------
Name of system cmake is compiling for. Composit Name of OS CMake is compiling for.
This variable is the composite of CMAKE_SYSTEM_NAME and This variable is the composite of :variable:`CMAKE_SYSTEM_NAME` and
CMAKE_SYSTEM_VERSION, like this :variable:`CMAKE_SYSTEM_VERSION`, e.g.
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}. If CMAKE_SYSTEM_VERSION ``${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}``. If
is not set, then CMAKE_SYSTEM is the same as CMAKE_SYSTEM_NAME. :variable:`CMAKE_SYSTEM_VERSION` is not set, then this variable is
the same as :variable:`CMAKE_SYSTEM_NAME`.

View File

@ -3,7 +3,6 @@ CMAKE_SYSTEM_NAME
Name of the OS CMake is building for. Name of the OS CMake is building for.
This is the name of the operating system on which CMake is targeting. This is the name of the OS on which CMake is targeting. This variable
On systems that have the uname command, this variable is set to the is the same as :variable:`CMAKE_HOST_SYSTEM_NAME` if you build for the
output of uname -s. Linux, Windows, and Darwin for Mac OS X are the host system instead of the target system when cross compiling.
values found on the big three operating systems.

View File

@ -3,6 +3,6 @@ CMAKE_SYSTEM_PROCESSOR
The name of the CPU CMake is building for. The name of the CPU CMake is building for.
On systems that support uname, this variable is set to the output of This variable is the same as :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` if
uname -p, on windows it is set to the value of the environment you build for the host system instead of the target system when
variable PROCESSOR_ARCHITECTURE cross compiling.

View File

@ -1,8 +1,8 @@
CMAKE_SYSTEM_VERSION CMAKE_SYSTEM_VERSION
-------------------- --------------------
OS version CMake is building for. The OS version CMake is building for.
A numeric version string for the system, on systems that support This variable is the same as :variable:`CMAKE_HOST_SYSTEM_VERSION` if
uname, this variable is set to the output of uname -r. On other you build for the host system instead of the target system when
systems this is set to major-minor version numbers. cross compiling.

View File

@ -16,6 +16,7 @@ set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/") set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
set(AM_QT_VERSION_MAJOR "@_target_qt_version@") set(AM_QT_VERSION_MAJOR "@_target_qt_version@")
set(AM_TARGET_NAME @_moc_target_name@) set(AM_TARGET_NAME @_moc_target_name@)
set(AM_ORIGIN_TARGET_NAME @_origin_target_name@)
set(AM_RELAXED_MODE "@_moc_relaxed_mode@") set(AM_RELAXED_MODE "@_moc_relaxed_mode@")
set(AM_UIC_TARGET_OPTIONS @_uic_target_options@) set(AM_UIC_TARGET_OPTIONS @_uic_target_options@)
set(AM_UIC_OPTIONS_FILES @_qt_uic_options_files@) set(AM_UIC_OPTIONS_FILES @_qt_uic_options_files@)

View File

@ -11,13 +11,13 @@
set(PACKAGE_VERSION "@CVF_VERSION@") set(PACKAGE_VERSION "@CVF_VERSION@")
if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
else() else()
set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@") set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@")
endif() endif()
if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
else() else()
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}") set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")

View File

@ -235,8 +235,8 @@ function(get_bundle_main_executable bundle result_var)
# #
set(eol_char "E") set(eol_char "E")
file(READ "${bundle}/Contents/Info.plist" info_plist) file(READ "${bundle}/Contents/Info.plist" info_plist)
string(REGEX REPLACE ";" "\\\\;" info_plist "${info_plist}") string(REPLACE ";" "\\;" info_plist "${info_plist}")
string(REGEX REPLACE "\n" "${eol_char};" info_plist "${info_plist}") string(REPLACE "\n" "${eol_char};" info_plist "${info_plist}")
# Scan the lines for "<key>CFBundleExecutable</key>" - the line after that # Scan the lines for "<key>CFBundleExecutable</key>" - the line after that
# is the name of the main executable. # is the name of the main executable.
@ -247,7 +247,7 @@ function(get_bundle_main_executable bundle result_var)
break() break()
endif() endif()
if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$") if(line MATCHES "<key>CFBundleExecutable</key>")
set(line_is_main_executable 1) set(line_is_main_executable 1)
endif() endif()
endforeach() endforeach()
@ -287,7 +287,7 @@ endfunction()
function(get_dotapp_dir exe dotapp_dir_var) function(get_dotapp_dir exe dotapp_dir_var)
set(s "${exe}") set(s "${exe}")
if(s MATCHES "^.*/.*\\.app/.*$") if(s MATCHES "/.*\\.app/")
# If there is a ".app" parent directory, # If there is a ".app" parent directory,
# ascend until we hit it: # ascend until we hit it:
# (typical of a Mac bundle executable) # (typical of a Mac bundle executable)
@ -394,7 +394,7 @@ function(get_item_key item key_var)
if(WIN32) if(WIN32)
string(TOLOWER "${item_name}" item_name) string(TOLOWER "${item_name}" item_name)
endif() endif()
string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}") string(REPLACE "." "_" ${key_var} "${item_name}")
set(${key_var} ${${key_var}} PARENT_SCOPE) set(${key_var} ${${key_var}} PARENT_SCOPE)
endfunction() endfunction()

View File

@ -31,15 +31,15 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
include(TestCXXAcceptsFlag) include(TestCXXAcceptsFlag)
set(CMAKE_TRY_ANSI_CXX_FLAGS "") set(CMAKE_TRY_ANSI_CXX_FLAGS "")
if(CMAKE_SYSTEM MATCHES "IRIX.*") if(CMAKE_SYSTEM_NAME MATCHES "IRIX")
set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std") set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
endif() endif()
if(CMAKE_SYSTEM MATCHES "OSF.*") if(CMAKE_SYSTEM_NAME MATCHES "OSF")
set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname") set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
endif() endif()
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
# if the compiler accepts it # if the compiler accepts it
if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+") if(NOT CMAKE_TRY_ANSI_CXX_FLAGS STREQUAL "")
CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS) CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS # if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
# to the flag # to the flag

View File

@ -26,7 +26,7 @@ if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1) set(MINGW 1)
endif() endif()
set(CMAKE_C_COMPILER_ID_RUN 1) set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c) set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_C_LINKER_PREFERENCE 10) set(CMAKE_C_LINKER_PREFERENCE 10)

View File

@ -68,10 +68,19 @@
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
# if __WATCOMC__ < 1200
# define COMPILER_ID "Watcom" # define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */ /* __WATCOMC__ = VVRP */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) # else
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# endif
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_C) #elif defined(__SUNPRO_C)
# define COMPILER_ID "SunPro" # define COMPILER_ID "SunPro"

View File

@ -175,10 +175,10 @@ endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE) if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
endif() endif()
if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND) if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
endif() endif()
if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH) if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")

View File

@ -2,6 +2,9 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@")
set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@") set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@") set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@")
set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@") set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@")
@ -27,7 +30,7 @@ if(CMAKE_COMPILER_IS_MINGW)
endif() endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1) set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP)
set(CMAKE_CXX_LINKER_PREFERENCE 30) set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)

View File

@ -73,10 +73,19 @@
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
# if __WATCOMC__ < 1200
# define COMPILER_ID "Watcom" # define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */ /* __WATCOMC__ = VVRP */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) # else
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# endif
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_CC) #elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro" # define COMPILER_ID "SunPro"

View File

@ -266,10 +266,10 @@ endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE) if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
endif() endif()
if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND) if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
endif() endif()
if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH) if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")

View File

@ -16,9 +16,11 @@
# cache values that can be initialized in the platform-compiler.cmake file # cache values that can be initialized in the platform-compiler.cmake file
# it may be included by more than one language. # it may be included by more than one language.
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" if(NOT "x$ENV{LDFLAGS}" STREQUAL "x")
CACHE STRING "Flags used by the linker.") set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
set (CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
set (CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
endif()
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none # default build type is none
@ -82,12 +84,17 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING ${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.") "Flags used by the linker during Release with Debug Info builds.")
endif() endif()
# executable linker flags
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT}"
CACHE STRING "Flags used by the linker.")
# shared linker flags # shared linker flags
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT}"
CACHE STRING "Flags used by the linker during the creation of dll's.") CACHE STRING "Flags used by the linker during the creation of dll's.")
# module linker flags # module linker flags
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT}"
CACHE STRING "Flags used by the linker during the creation of modules.") CACHE STRING "Flags used by the linker during the creation of modules.")
# static linker flags # static linker flags
@ -124,4 +131,3 @@ CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_RELEASE CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
) )

View File

@ -18,7 +18,7 @@ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# prefer the environment variable ASM # prefer the environment variable ASM
if($ENV{ASM${ASM_DIALECT}} MATCHES ".+") if(NOT $ENV{ASM${ASM_DIALECT}} STREQUAL "")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
endif() endif()

View File

@ -48,7 +48,7 @@ else()
set(CMAKE_C_COMPILER_INIT NOTFOUND) set(CMAKE_C_COMPILER_INIT NOTFOUND)
# prefer the environment variable CC # prefer the environment variable CC
if($ENV{CC} MATCHES ".+") if(NOT $ENV{CC} STREQUAL "")
get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT) get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
if(CMAKE_C_FLAGS_ENV_INIT) if(CMAKE_C_FLAGS_ENV_INIT)
set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler") set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
@ -138,7 +138,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-)
elseif(COMPILER_BASENAME MATCHES "qcc(\\.exe)?$") elseif(COMPILER_BASENAME MATCHES "qcc(\\.exe)?$")
if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?.*$") if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-) set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)
endif() endif()
endif () endif ()

View File

@ -47,7 +47,7 @@ else()
set(CMAKE_CXX_COMPILER_INIT NOTFOUND) set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
# prefer the environment variable CXX # prefer the environment variable CXX
if($ENV{CXX} MATCHES ".+") if(NOT $ENV{CXX} STREQUAL "")
get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT) get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
if(CMAKE_CXX_FLAGS_ENV_INIT) if(CMAKE_CXX_FLAGS_ENV_INIT)
set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler") set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
@ -135,7 +135,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-)
elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$") elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$")
if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?.*$") if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-) set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)
endif() endif()
endif () endif ()

View File

@ -0,0 +1,43 @@
#=============================================================================
# Copyright 2013 Stephen Kelly <steveire@gmail.com>
#
# 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.)
function(cmake_determine_compile_features lang)
if(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features)
message(STATUS "Detecting ${lang} compile features")
set(CMAKE_CXX11_COMPILE_FEATURES)
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
cmake_record_cxx_compile_features()
if(NOT _result EQUAL 0)
message(STATUS "Detecting ${lang} compile features - failed")
return()
endif()
if(NOT CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_COMPILE_FEATURES
${CMAKE_CXX11_COMPILE_FEATURES}
)
endif()
set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE)
message(STATUS "Detecting ${lang} compile features - done")
endif()
endfunction()

View File

@ -52,11 +52,11 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n") "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[") file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
foreach(info ${ABI_STRINGS}) foreach(info ${ABI_STRINGS})
if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*") if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]")
string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}") set(ABI_SIZEOF_DPTR "${CMAKE_MATCH_1}")
endif() endif()
if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*") if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]")
string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}") set(ABI_NAME "${CMAKE_MATCH_1}")
endif() endif()
endforeach() endforeach()

View File

@ -27,7 +27,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
else() else()
set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}}) set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
endif() endif()
string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}") string(REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
# Compute the directory in which to run the test. # Compute the directory in which to run the test.
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang}) set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})
@ -367,35 +367,30 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 6 REGEX "INFO:") CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 6 REGEX "INFO:")
set(COMPILER_ID_TWICE) set(COMPILER_ID_TWICE)
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]")
if(COMPILER_ID) if(COMPILER_ID)
set(COMPILER_ID_TWICE 1) set(COMPILER_ID_TWICE 1)
endif() endif()
string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1" set(COMPILER_ID "${CMAKE_MATCH_1}")
COMPILER_ID "${info}")
endif() endif()
if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") if("${info}" MATCHES "INFO:platform\\[([^]\"]*)\\]")
string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1" set(PLATFORM_ID "${CMAKE_MATCH_1}")
PLATFORM_ID "${info}")
endif() endif()
if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") if("${info}" MATCHES "INFO:arch\\[([^]\"]*)\\]")
string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1" set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
ARCHITECTURE_ID "${info}")
endif() endif()
if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") if("${info}" MATCHES "INFO:compiler_version\\[([^]\"]*)\\]")
string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}") string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}")
string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
endif() endif()
if("${info}" MATCHES ".*INFO:simulate\\[([^]\"]*)\\].*") if("${info}" MATCHES "INFO:simulate\\[([^]\"]*)\\]")
set(SIMULATE_ID "${CMAKE_MATCH_1}") set(SIMULATE_ID "${CMAKE_MATCH_1}")
endif() endif()
if("${info}" MATCHES ".*INFO:simulate_version\\[([^]\"]*)\\].*") if("${info}" MATCHES "INFO:simulate_version\\[([^]\"]*)\\]")
set(SIMULATE_VERSION "${CMAKE_MATCH_1}") string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${CMAKE_MATCH_1}")
string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${SIMULATE_VERSION}")
string(REGEX REPLACE "\\.0+([0-9])" ".\\1" SIMULATE_VERSION "${SIMULATE_VERSION}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" SIMULATE_VERSION "${SIMULATE_VERSION}")
endif() endif()
if("${info}" MATCHES ".*INFO:qnxnto") if("${info}" MATCHES "INFO:qnxnto")
set(COMPILER_QNXNTO 1) set(COMPILER_QNXNTO 1)
endif() endif()
endforeach() endforeach()

View File

@ -32,7 +32,7 @@ elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
else() else()
if(NOT CMAKE_Fortran_COMPILER) if(NOT CMAKE_Fortran_COMPILER)
# prefer the environment variable CC # prefer the environment variable CC
if($ENV{FC} MATCHES ".+") if(NOT $ENV{FC} STREQUAL "")
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT) get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
if(CMAKE_Fortran_FLAGS_ENV_INIT) if(CMAKE_Fortran_FLAGS_ENV_INIT)
set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler") set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
@ -130,7 +130,7 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN) OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
if(NOT CMAKE_COMPILER_RETURN) if(NOT CMAKE_COMPILER_RETURN)
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_GNU")
set(CMAKE_Fortran_COMPILER_ID "GNU") set(CMAKE_Fortran_COMPILER_ID "GNU")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU succeeded with " "Determining if the Fortran compiler is GNU succeeded with "
@ -141,10 +141,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
endif() endif()
if(NOT CMAKE_Fortran_PLATFORM_ID) if(NOT CMAKE_Fortran_PLATFORM_ID)
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_MINGW")
set(CMAKE_Fortran_PLATFORM_ID "MinGW") set(CMAKE_Fortran_PLATFORM_ID "MinGW")
endif() endif()
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_CYGWIN")
set(CMAKE_Fortran_PLATFORM_ID "Cygwin") set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
endif() endif()
endif() endif()

View File

@ -18,7 +18,7 @@
if(NOT CMAKE_Java_COMPILER) if(NOT CMAKE_Java_COMPILER)
# prefer the environment variable CC # prefer the environment variable CC
if($ENV{JAVA_COMPILER} MATCHES ".+") if(NOT $ENV{JAVA_COMPILER} STREQUAL "")
get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(CMAKE_Java_FLAGS_ENV_INIT) if(CMAKE_Java_FLAGS_ENV_INIT)
set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler") set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
@ -28,14 +28,14 @@ if(NOT CMAKE_Java_COMPILER)
endif() endif()
endif() endif()
if($ENV{JAVA_RUNTIME} MATCHES ".+") if(NOT $ENV{JAVA_RUNTIME} STREQUAL "")
get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT}) if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
endif() endif()
endif() endif()
if($ENV{JAVA_ARCHIVE} MATCHES ".+") if(NOT $ENV{JAVA_ARCHIVE} STREQUAL "")
get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT}) if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")

View File

@ -20,7 +20,7 @@
# as a default compiler # as a default compiler
if(NOT CMAKE_RC_COMPILER) if(NOT CMAKE_RC_COMPILER)
# prefer the environment variable RC # prefer the environment variable RC
if($ENV{RC} MATCHES ".+") if(NOT $ENV{RC} STREQUAL "")
get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT) get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
if(CMAKE_RC_FLAGS_ENV_INIT) if(CMAKE_RC_FLAGS_ENV_INIT)
set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler") set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")

View File

@ -72,8 +72,8 @@ if(CMAKE_HOST_UNIX)
endif() endif()
set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command") set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
# processor may have double quote in the name, and that needs to be removed # processor may have double quote in the name, and that needs to be removed
string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") string(REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") string(REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif() endif()
else() else()
if(CMAKE_HOST_WIN32) if(CMAKE_HOST_WIN32)

Some files were not shown because too many files have changed in this diff Show More