Merge branch 'master' into revise-compiler-id-policies

This commit is contained in:
Brad King 2014-04-02 14:44:35 -04:00
commit 8018fcca6e
818 changed files with 11408 additions and 7751 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)
@ -387,7 +383,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 +397,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 +415,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 +459,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 +496,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 +533,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 +556,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 +596,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

@ -39,6 +39,8 @@ 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)"
@ -52,6 +54,7 @@ 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
# 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

@ -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

@ -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);

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

@ -100,6 +100,10 @@ Properties on Targets
/prop_tgt/COMPILE_DEFINITIONS /prop_tgt/COMPILE_DEFINITIONS
/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/DEBUG_POSTFIX /prop_tgt/DEBUG_POSTFIX

View File

@ -173,7 +173,7 @@ The Qt 4 and 5 :prop_tgt:`IMPORTED` targets for the QtGui libraries specify
that the qtmain.lib static library shipped with Qt will be linked by all that the qtmain.lib static library shipped with Qt will be linked by all
dependent executables which have the :prop_tgt:`WIN32_EXECUTABLE` enabled. dependent executables which have the :prop_tgt:`WIN32_EXECUTABLE` enabled.
Do disable this behavior, enable the ``Qt5_NO_LINK_QTMAIN`` target property for To disable this behavior, enable the ``Qt5_NO_LINK_QTMAIN`` target property for
Qt 5 based targets or ``QT4_NO_LINK_QTMAIN`` target property for Qt 4 based Qt 5 based targets or ``QT4_NO_LINK_QTMAIN`` target property for Qt 4 based
targets. targets.

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

View File

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

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

@ -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

@ -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,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,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,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

@ -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

@ -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

@ -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

@ -27,7 +27,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

@ -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

@ -74,6 +74,23 @@
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix" # define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# else /* unknown platform */
# define PLATFORM_ID ""
# endif
#else /* unknown platform */ #else /* unknown platform */
# define PLATFORM_ID "" # define PLATFORM_ID ""
@ -107,6 +124,17 @@
# define ARCHITECTURE_ID "" # define ARCHITECTURE_ID ""
# endif # endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#else #else
# define ARCHITECTURE_ID "" # define ARCHITECTURE_ID ""
#endif #endif

View File

@ -53,6 +53,7 @@ macro(CMAKE_RESET_CHECK_STATE)
set(CMAKE_REQUIRED_DEFINITIONS) set(CMAKE_REQUIRED_DEFINITIONS)
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
set(CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_QUIET)
endmacro() endmacro()
@ -68,6 +69,7 @@ macro(CMAKE_PUSH_CHECK_STATE)
set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET})
if (ARGC GREATER 0 AND ARGV0 STREQUAL "RESET") if (ARGC GREATER 0 AND ARGV0 STREQUAL "RESET")
cmake_reset_check_state() cmake_reset_check_state()
@ -84,6 +86,7 @@ macro(CMAKE_POP_CHECK_STATE)
set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
set(CMAKE_REQUIRED_QUIET ${_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1") math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
endif() endif()

View File

@ -67,7 +67,12 @@
# * Mandatory : YES # * Mandatory : YES
# * Default : 'devel' # * Default : 'devel'
# #
# The debian package section # .. variable:: CPACK_DEBIAN_COMPRESSION_TYPE
#
# * Mandatory : YES
# * Default : 'gzip'
#
# Possible values are: lzma, xz, bzip2 and gzip.
# #
# .. variable:: CPACK_DEBIAN_PACKAGE_PRIORITY # .. variable:: CPACK_DEBIAN_PACKAGE_PRIORITY
# #
@ -390,6 +395,12 @@ if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
endif() endif()
# Compression: (recommended)
if(NOT CPACK_DEBIAN_COMPRESSION_TYPE)
set(CPACK_DEBIAN_COMPRESSION_TYPE "gzip")
endif()
# Recommends: # Recommends:
# You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS # You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS

View File

@ -216,9 +216,24 @@
# allow other CMake projects to find your package with # allow other CMake projects to find your package with
# the :command:`find_package` command. # the :command:`find_package` command.
# #
# .. variable:: CPACK_WIX_PROPERTY_<PROPERTY>
#
# This variable can be used to provide a value for
# the Windows Installer property ``<PROPERTY>``
#
# The follwing list contains some example properties that can be used to
# customize information under
# "Programs and Features" (also known as "Add or Remove Programs")
#
# * ARPCOMMENTS - Comments
# * ARPHELPLINK - Help and support information URL
# * ARPURLINFOABOUT - General information URL
# * URLUPDATEINFO - Update information URL
# * ARPHELPTELEPHONE - Help and support telephone number
# * ARPSIZE - Size (in kilobytes) of the application
#============================================================================= #=============================================================================
# Copyright 2013 Kitware, Inc. # Copyright 2014 Kitware, Inc.
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.

View File

@ -21,6 +21,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2005-2009 Kitware, Inc. # Copyright 2005-2009 Kitware, Inc.
@ -67,7 +68,9 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n") "${SOURCE}\n")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR}") message(STATUS "Performing Test ${VAR}")
endif()
try_compile(${VAR} try_compile(${VAR}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
@ -85,13 +88,17 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
if(${VAR}) if(${VAR})
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Success") message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
endif()
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"

View File

@ -21,6 +21,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
@ -56,7 +57,9 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n") "${SOURCE}\n")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR}") message(STATUS "Performing Test ${VAR}")
endif()
try_run(${VAR}_EXITCODE ${VAR}_COMPILED try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
@ -73,7 +76,9 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
# if the return value was 0 then it worked # if the return value was 0 then it worked
if("${${VAR}_EXITCODE}" EQUAL 0) if("${${VAR}_EXITCODE}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Success") message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
@ -86,7 +91,9 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
endif() endif()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"

View File

@ -21,6 +21,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2005-2009 Kitware, Inc. # Copyright 2005-2009 Kitware, Inc.
@ -68,7 +69,9 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n") "${SOURCE}\n")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR}") message(STATUS "Performing Test ${VAR}")
endif()
try_compile(${VAR} try_compile(${VAR}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
@ -86,13 +89,17 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
if(${VAR}) if(${VAR})
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Success") message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n" "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
endif()
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n" "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"

View File

@ -21,6 +21,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
@ -56,7 +57,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n") "${SOURCE}\n")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR}") message(STATUS "Performing Test ${VAR}")
endif()
try_run(${VAR}_EXITCODE ${VAR}_COMPILED try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
@ -74,7 +77,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
# if the return value was 0 then it worked # if the return value was 0 then it worked
if("${${VAR}_EXITCODE}" EQUAL 0) if("${${VAR}_EXITCODE}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Success") message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n" "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
@ -87,7 +92,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
endif() endif()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n" "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"

View File

@ -27,6 +27,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2003-2011 Kitware, Inc. # Copyright 2003-2011 Kitware, Inc.

View File

@ -20,6 +20,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2002-2011 Kitware, Inc. # Copyright 2002-2011 Kitware, Inc.
@ -40,7 +41,9 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$") if("${VARIABLE}" MATCHES "^${VARIABLE}$")
set(MACRO_CHECK_FUNCTION_DEFINITIONS set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION}") message(STATUS "Looking for ${FUNCTION}")
endif()
if(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@ -63,12 +66,16 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE}) if(${VARIABLE})
set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}") set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION} - found") message(STATUS "Looking for ${FUNCTION} - found")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists passed with the following output:\n" "Determining if the function ${FUNCTION} exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION} - not found") message(STATUS "Looking for ${FUNCTION} - not found")
endif()
set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists failed with the following output:\n" "Determining if the function ${FUNCTION} exists failed with the following output:\n"

View File

@ -24,6 +24,7 @@
# CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2002-2009 Kitware, Inc. # Copyright 2002-2009 Kitware, Inc.
@ -49,7 +50,9 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE}) set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${INCLUDE}") message(STATUS "Looking for ${INCLUDE}")
endif()
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS}) set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
@ -69,14 +72,18 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
endif() endif()
if(${VARIABLE}) if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${INCLUDE} - found") message(STATUS "Looking for ${INCLUDE} - found")
endif()
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "
"exists passed with the following output:\n" "exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${INCLUDE} - not found") message(STATUS "Looking for ${INCLUDE} - not found")
endif()
set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "

View File

@ -28,6 +28,7 @@
# CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2002-2009 Kitware, Inc. # Copyright 2002-2009 Kitware, Inc.
@ -53,7 +54,9 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE}) set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for C++ include ${INCLUDE}") message(STATUS "Looking for C++ include ${INCLUDE}")
endif()
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
@ -73,14 +76,18 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
endif() endif()
if(${VARIABLE}) if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for C++ include ${INCLUDE} - found") message(STATUS "Looking for C++ include ${INCLUDE} - found")
endif()
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "
"exists passed with the following output:\n" "exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for C++ include ${INCLUDE} - not found") message(STATUS "Looking for C++ include ${INCLUDE} - not found")
endif()
set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "

View File

@ -23,6 +23,7 @@
# CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2003-2012 Kitware, Inc. # Copyright 2003-2012 Kitware, Inc.
@ -66,7 +67,9 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
set(_description "include file ${_INCLUDE}") set(_description "include file ${_INCLUDE}")
endif() endif()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${_description}") message(STATUS "Looking for ${_description}")
endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
@ -76,14 +79,18 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE}) if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${_description} - found") message(STATUS "Looking for ${_description} - found")
endif()
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist passed with the following output:\n" "exist passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${_description} - not found") message(STATUS "Looking for ${_description} - not found")
endif()
set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}") set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "

View File

@ -23,6 +23,7 @@
# CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2002-2009 Kitware, Inc. # Copyright 2002-2009 Kitware, Inc.
@ -43,7 +44,9 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$") if("${VARIABLE}" MATCHES "^${VARIABLE}$")
set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
endif()
set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY}) set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
if(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_LIBRARY_EXISTS_LIBRARIES set(CHECK_LIBRARY_EXISTS_LIBRARIES
@ -60,14 +63,18 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE}) if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found") message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
endif()
set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}") set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"passed with the following output:\n" "passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found") message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
endif()
set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}") set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "

View File

@ -33,6 +33,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2005-2009 Kitware, Inc. # Copyright 2005-2009 Kitware, Inc.
@ -97,12 +98,16 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
if (${_VARIABLE}) if (${_VARIABLE})
set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True") message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n" "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else () else ()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False") message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
endif()
set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n" "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"

View File

@ -28,6 +28,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
# #
# #
# #

View File

@ -28,6 +28,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2003-2011 Kitware, Inc. # Copyright 2003-2011 Kitware, Inc.
@ -74,7 +75,9 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${SOURCEFILE}" @ONLY) "${SOURCEFILE}" @ONLY)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${SYMBOL}") message(STATUS "Looking for ${SYMBOL}")
endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
"${SOURCEFILE}" "${SOURCEFILE}"
@ -85,7 +88,9 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"${CMAKE_SYMBOL_EXISTS_INCLUDES}" "${CMAKE_SYMBOL_EXISTS_INCLUDES}"
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE}) if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${SYMBOL} - found") message(STATUS "Looking for ${SYMBOL} - found")
endif()
set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}") set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the ${SYMBOL} " "Determining if the ${SYMBOL} "
@ -93,7 +98,9 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"${OUTPUT}\nFile ${SOURCEFILE}:\n" "${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${SYMBOL} - not found") message(STATUS "Looking for ${SYMBOL} - not found")
endif()
set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}") set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the ${SYMBOL} " "Determining if the ${SYMBOL} "

View File

@ -59,6 +59,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
# CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include # CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
#============================================================================= #=============================================================================
@ -75,6 +76,7 @@
# License text for the above reference.) # License text for the above reference.)
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckIncludeFileCXX)
cmake_policy(PUSH) cmake_policy(PUSH)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR) cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
@ -84,7 +86,9 @@ get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Helper function. DO NOT CALL DIRECTLY. # Helper function. DO NOT CALL DIRECTLY.
function(__check_type_size_impl type var map builtin language) function(__check_type_size_impl type var map builtin language)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Check size of ${type}") message(STATUS "Check size of ${type}")
endif()
# Include header files. # Include header files.
set(headers) set(headers)
@ -168,13 +172,17 @@ function(__check_type_size_impl type var map builtin language)
message(SEND_ERROR "CHECK_TYPE_SIZE found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !") message(SEND_ERROR "CHECK_TYPE_SIZE found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
endif() endif()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Check size of ${type} - done") message(STATUS "Check size of ${type} - done")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${type} passed with the following output:\n${output}\n\n") "Determining size of ${type} passed with the following output:\n${output}\n\n")
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})") set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
else() else()
# The check failed to compile. # The check failed to compile.
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Check size of ${type} - failed") message(STATUS "Check size of ${type} - failed")
endif()
file(READ ${src} content) file(READ ${src} content)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n") "Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
@ -218,9 +226,15 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
set(_builtin 0) set(_builtin 0)
else() else()
set(_builtin 1) set(_builtin 1)
if("${_language}" STREQUAL "C")
check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H) check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H) check_include_file(stddef.h HAVE_STDDEF_H)
elseif("${_language}" STREQUAL "CXX")
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
check_include_file_cxx(stdint.h HAVE_STDINT_H)
check_include_file_cxx(stddef.h HAVE_STDDEF_H)
endif()
endif() endif()
unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY) unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
unset(_CHECK_TYPE_SIZE_LANGUAGE) unset(_CHECK_TYPE_SIZE_LANGUAGE)

View File

@ -27,6 +27,7 @@
# CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_REQUIRED_QUIET = execute quietly without messages
#============================================================================= #=============================================================================
# Copyright 2002-2009 Kitware, Inc. # Copyright 2002-2009 Kitware, Inc.
@ -47,7 +48,9 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$") if("${VARIABLE}" MATCHES "^${VARIABLE}$")
set(MACRO_CHECK_VARIABLE_DEFINITIONS set(MACRO_CHECK_VARIABLE_DEFINITIONS
"-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}") "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${VAR}") message(STATUS "Looking for ${VAR}")
endif()
if(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@ -63,13 +66,17 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE}) if(${VARIABLE})
set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}") set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${VAR} - found") message(STATUS "Looking for ${VAR} - found")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the variable ${VAR} exists passed with the following output:\n" "Determining if the variable ${VAR} exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else() else()
set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}") set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${VAR} - not found") message(STATUS "Looking for ${VAR} - not found")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the variable ${VAR} exists failed with the following output:\n" "Determining if the variable ${VAR} exists failed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")

View File

@ -20,6 +20,7 @@
# [DOWNLOAD_NAME fname] # File name to store (if not end of URL) # [DOWNLOAD_NAME fname] # File name to store (if not end of URL)
# [DOWNLOAD_DIR dir] # Directory to store downloaded files # [DOWNLOAD_DIR dir] # Directory to store downloaded files
# [DOWNLOAD_COMMAND cmd...] # Command to download source tree # [DOWNLOAD_COMMAND cmd...] # Command to download source tree
# [DOWNLOAD_NO_PROGRESS 1] # Disable download progress reports
# [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository # [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository
# [CVS_MODULE mod] # Module to checkout from CVS repo # [CVS_MODULE mod] # Module to checkout from CVS repo
# [CVS_TAG tag] # Tag to checkout from CVS repo # [CVS_TAG tag] # Tag to checkout from CVS repo
@ -54,6 +55,7 @@
# [BINARY_DIR dir] # Specify build dir location # [BINARY_DIR dir] # Specify build dir location
# [BUILD_COMMAND cmd...] # Command to drive the native build # [BUILD_COMMAND cmd...] # Command to drive the native build
# [BUILD_IN_SOURCE 1] # Use source dir for build dir # [BUILD_IN_SOURCE 1] # Use source dir for build dir
# [BUILD_ALWAYS 1] # No stamp file, build step always runs
# #--Install step--------------- # #--Install step---------------
# [INSTALL_DIR dir] # Installation prefix # [INSTALL_DIR dir] # Installation prefix
# [INSTALL_COMMAND cmd...] # Command to drive install after build # [INSTALL_COMMAND cmd...] # Command to drive install after build
@ -452,6 +454,7 @@ execute_process(
WORKING_DIRECTORY \"${work_dir}\" WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code RESULT_VARIABLE error_code
OUTPUT_VARIABLE head_sha OUTPUT_VARIABLE head_sha
OUTPUT_STRIP_TRAILING_WHITESPACE
) )
if(error_code) if(error_code)
message(FATAL_ERROR \"Failed to get the hash for HEAD\") message(FATAL_ERROR \"Failed to get the hash for HEAD\")
@ -470,6 +473,17 @@ else()
set(is_remote_ref 0) set(is_remote_ref 0)
endif() endif()
# Tag is in the form <remote>/<tag> (i.e. origin/master) we must strip
# the remote from the tag.
if(\"\${show_ref_output}\" MATCHES \"refs/remotes/${git_tag}\")
string(REGEX MATCH \"^([^/]+)/(.+)$\" _unused \"${git_tag}\")
set(git_remote \"\${CMAKE_MATCH_1}\")
set(git_tag \"\${CMAKE_MATCH_2}\")
else()
set(git_remote \"origin\")
set(git_tag \"${git_tag}\")
endif()
# This will fail if the tag does not exist (it probably has not been fetched # This will fail if the tag does not exist (it probably has not been fetched
# yet). # yet).
execute_process( execute_process(
@ -477,6 +491,7 @@ execute_process(
WORKING_DIRECTORY \"${work_dir}\" WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code RESULT_VARIABLE error_code
OUTPUT_VARIABLE tag_sha OUTPUT_VARIABLE tag_sha
OUTPUT_STRIP_TRAILING_WHITESPACE
) )
# Is the hash checkout out that we want? # Is the hash checkout out that we want?
@ -490,6 +505,86 @@ if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\"
message(FATAL_ERROR \"Failed to fetch repository '${git_repository}'\") message(FATAL_ERROR \"Failed to fetch repository '${git_repository}'\")
endif() endif()
if(is_remote_ref)
# Check if stash is needed
execute_process(
COMMAND \"${git_EXECUTABLE}\" status --porcelain
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
OUTPUT_VARIABLE repo_status
)
if(error_code)
message(FATAL_ERROR \"Failed to get the status\")
endif()
string(LENGTH \"\${repo_status}\" need_stash)
# If not in clean state, stash changes in order to be able to be able to
# perform git pull --rebase
if(need_stash)
execute_process(
COMMAND \"${git_EXECUTABLE}\" stash save --all --quiet
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
if(error_code)
message(FATAL_ERROR \"Failed to stash changes\")
endif()
endif()
# Pull changes from the remote branch
execute_process(
COMMAND \"${git_EXECUTABLE}\" rebase \${git_remote}/\${git_tag}
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
if(error_code)
# Rebase failed: Restore previous state.
execute_process(
COMMAND \"${git_EXECUTABLE}\" rebase --abort
WORKING_DIRECTORY \"${work_dir}\"
)
if(need_stash)
execute_process(
COMMAND \"${git_EXECUTABLE}\" stash pop --index --quiet
WORKING_DIRECTORY \"${work_dir}\"
)
endif()
message(FATAL_ERROR \"\\nFailed to rebase in: '${work_dir}/${src_name}'.\\nYou will have to resolve the conflicts manually\")
endif()
if(need_stash)
execute_process(
COMMAND \"${git_EXECUTABLE}\" stash pop --index --quiet
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
if(error_code)
# Stash pop --index failed: Try again dropping the index
execute_process(
COMMAND \"${git_EXECUTABLE}\" reset --hard --quiet
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
execute_process(
COMMAND \"${git_EXECUTABLE}\" stash pop --quiet
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
if(error_code)
# Stash pop failed: Restore previous state.
execute_process(
COMMAND \"${git_EXECUTABLE}\" reset --hard --quiet \${head_sha}
WORKING_DIRECTORY \"${work_dir}\"
)
execute_process(
COMMAND \"${git_EXECUTABLE}\" stash pop --index --quiet
WORKING_DIRECTORY \"${work_dir}\"
)
message(FATAL_ERROR \"\\nFailed to unstash changes in: '${work_dir}/${src_name}'.\\nYou will have to resolve the conflicts manually\")
endif()
endif()
endif()
else()
execute_process( execute_process(
COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag} COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
WORKING_DIRECTORY \"${work_dir}\" WORKING_DIRECTORY \"${work_dir}\"
@ -498,6 +593,7 @@ if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\"
if(error_code) if(error_code)
message(FATAL_ERROR \"Failed to checkout tag: '${git_tag}'\") message(FATAL_ERROR \"Failed to checkout tag: '${git_tag}'\")
endif() endif()
endif()
execute_process( execute_process(
COMMAND \"${git_EXECUTABLE}\" submodule update --recursive ${git_submodules} COMMAND \"${git_EXECUTABLE}\" submodule update --recursive ${git_submodules}
@ -514,7 +610,7 @@ endif()
endfunction(_ep_write_gitupdate_script) endfunction(_ep_write_gitupdate_script)
function(_ep_write_downloadfile_script script_filename remote local timeout hash tls_verify tls_cainfo) function(_ep_write_downloadfile_script script_filename remote local timeout no_progress hash tls_verify tls_cainfo)
if(timeout) if(timeout)
set(timeout_args TIMEOUT ${timeout}) set(timeout_args TIMEOUT ${timeout})
set(timeout_msg "${timeout} seconds") set(timeout_msg "${timeout} seconds")
@ -523,6 +619,12 @@ function(_ep_write_downloadfile_script script_filename remote local timeout hash
set(timeout_msg "none") set(timeout_msg "none")
endif() endif()
if(no_progress)
set(show_progress "")
else()
set(show_progress "SHOW_PROGRESS")
endif()
if("${hash}" MATCHES "${_ep_hash_regex}") if("${hash}" MATCHES "${_ep_hash_regex}")
set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1}=${CMAKE_MATCH_2}) set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1}=${CMAKE_MATCH_2})
else() else()
@ -562,7 +664,7 @@ ${tls_cainfo}
file(DOWNLOAD file(DOWNLOAD
\"${remote}\" \"${remote}\"
\"${local}\" \"${local}\"
SHOW_PROGRESS ${show_progress}
${hash_args} ${hash_args}
${timeout_args} ${timeout_args}
STATUS status STATUS status
@ -1442,10 +1544,11 @@ function(_ep_add_download_command name)
string(REPLACE ";" "-" fname "${fname}") string(REPLACE ";" "-" fname "${fname}")
set(file ${download_dir}/${fname}) set(file ${download_dir}/${fname})
get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT) get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT)
get_property(no_progress TARGET ${name} PROPERTY _EP_DOWNLOAD_NO_PROGRESS)
get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY) get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO) get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO)
set(download_script "${stamp_dir}/download-${name}.cmake") set(download_script "${stamp_dir}/download-${name}.cmake")
_ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${hash}" "${tls_verify}" "${tls_cainfo}") _ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${no_progress}" "${hash}" "${tls_verify}" "${tls_cainfo}")
set(cmd ${CMAKE_COMMAND} -P "${download_script}" set(cmd ${CMAKE_COMMAND} -P "${download_script}"
COMMAND) COMMAND)
set(retries 3) set(retries 3)
@ -1716,10 +1819,18 @@ function(_ep_add_build_command name)
set(log "") set(log "")
endif() endif()
get_property(build_always TARGET ${name} PROPERTY _EP_BUILD_ALWAYS)
if(build_always)
set(always 1)
else()
set(always 0)
endif()
ExternalProject_Add_Step(${name} build ExternalProject_Add_Step(${name} build
COMMAND ${cmd} COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir} WORKING_DIRECTORY ${binary_dir}
DEPENDEES configure DEPENDEES configure
ALWAYS ${always}
${log} ${log}
) )
endfunction() endfunction()

View File

@ -71,6 +71,13 @@
# RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME # RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME
# RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME # RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME
# #
# With the exception of the ``ALL`` value, these values can be combined
# in order to customize the output. For example:
#
# ::
#
# feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
#
# #
# #
# If a FILENAME is given, the information is printed into this file. If # If a FILENAME is given, the information is printed into this file. If
@ -417,8 +424,8 @@ endfunction()
function(FEATURE_SUMMARY) function(FEATURE_SUMMARY)
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...) # CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
set(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) set(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
set(oneValueArgs FILENAME VAR DESCRIPTION WHAT) set(oneValueArgs FILENAME VAR DESCRIPTION)
set(multiValueArgs ) # none set(multiValueArgs WHAT)
CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
@ -451,7 +458,8 @@ function(FEATURE_SUMMARY)
set(requiredPackagesNotFound TRUE) set(requiredPackagesNotFound TRUE)
endif() endif()
elseif("${_FS_WHAT}" STREQUAL "ALL") else()
if("${_FS_WHAT}" STREQUAL "ALL")
set(allWhatParts "ENABLED_FEATURES" set(allWhatParts "ENABLED_FEATURES"
"RUNTIME_PACKAGES_FOUND" "RUNTIME_PACKAGES_FOUND"
@ -466,8 +474,26 @@ function(FEATURE_SUMMARY)
"REQUIRED_PACKAGES_NOT_FOUND" "REQUIRED_PACKAGES_NOT_FOUND"
) )
else()
set(allWhatParts)
foreach(part ${_FS_WHAT})
list(FIND validWhatParts "${part}" indexInList)
if(NOT "${indexInList}" STREQUAL "-1")
list(APPEND allWhatParts "${part}")
else()
if("${part}" STREQUAL "ALL")
message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() contains ALL, which cannot be combined with other values.")
else()
message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() contains ${part}, which is not a valid value.")
endif()
endif()
endforeach()
endif()
set(title_ENABLED_FEATURES "The following features have been enabled:") set(title_ENABLED_FEATURES "The following features have been enabled:")
set(title_DISABLED_FEATURES "The following features have been disabled:") set(title_DISABLED_FEATURES "The following features have been disabled:")
set(title_PACKAGES_FOUND "The following packages have been found:")
set(title_PACKAGES_NOT_FOUND "The following packages have not been found:")
set(title_OPTIONAL_PACKAGES_FOUND "The following OPTIONAL packages have been found:") set(title_OPTIONAL_PACKAGES_FOUND "The following OPTIONAL packages have been found:")
set(title_OPTIONAL_PACKAGES_NOT_FOUND "The following OPTIONAL packages have not been found:") set(title_OPTIONAL_PACKAGES_NOT_FOUND "The following OPTIONAL packages have not been found:")
set(title_RECOMMENDED_PACKAGES_FOUND "The following RECOMMENDED packages have been found:") set(title_RECOMMENDED_PACKAGES_FOUND "The following RECOMMENDED packages have been found:")
@ -488,8 +514,6 @@ function(FEATURE_SUMMARY)
endif() endif()
endif() endif()
endforeach() endforeach()
else()
message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
endif() endif()
if(_FS_FILENAME) if(_FS_FILENAME)

View File

@ -52,6 +52,9 @@
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${BLAS_FIND_QUIETLY})
set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
@ -687,4 +690,5 @@ else()
endif() endif()
endif() endif()
cmake_pop_check_state()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})

View File

@ -57,7 +57,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
if (BZIP2_FOUND) if (BZIP2_FOUND)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${BZip2_FIND_QUIETLY})
CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX) CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
cmake_pop_check_state()
endif () endif ()
mark_as_advanced(BZIP2_INCLUDE_DIR) mark_as_advanced(BZIP2_INCLUDE_DIR)

View File

@ -62,6 +62,7 @@ if (NOT DEFINED Backtrace_LIBRARY)
# First, check if we already have backtrace(), e.g., in libc # First, check if we already have backtrace(), e.g., in libc
cmake_push_check_state(RESET) cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS}) set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
set(CMAKE_REQUIRED_QUIET ${Backtrace_FIND_QUIETLY})
check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND) check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
cmake_pop_check_state() cmake_pop_check_state()
endif() endif()

View File

@ -954,7 +954,8 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
# Compute component-specific hints. # Compute component-specific hints.
set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "") set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python") if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
${COMPONENT} STREQUAL "graph_parallel")
foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES}) foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES})
if(IS_ABSOLUTE "${lib}") if(IS_ABSOLUTE "${lib}")
get_filename_component(libdir "${lib}" PATH) get_filename_component(libdir "${lib}" PATH)

View File

@ -987,7 +987,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
endif() endif()
endif() endif()
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
# CMake source. # CMake source.
# Remove leading / # Remove leading /

View File

@ -36,9 +36,13 @@ find_library(CUPS_LIBRARIES NAMES cups )
if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${Cups_FIND_QUIETLY})
# ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint) # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE) CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
cmake_pop_check_state()
endif () endif ()
if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h") if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")

View File

@ -67,6 +67,9 @@ endif()
# default search paths. # default search paths.
if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${Curses_FIND_QUIETLY})
CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}" CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
wsyncup "" CURSES_CURSES_HAS_WSYNCUP) wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
@ -77,6 +80,7 @@ if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
set(CURSES_USE_NCURSES TRUE) set(CURSES_USE_NCURSES TRUE)
endif() endif()
endif() endif()
cmake_pop_check_state()
endif() endif()

View File

@ -62,7 +62,7 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
ENV GTKMM_BASEPATH ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
PATH_SUFFIXES include/freetype2 include PATH_SUFFIXES include/freetype2 include freetype2
) )
find_path(FREETYPE_INCLUDE_DIR_freetype2 find_path(FREETYPE_INCLUDE_DIR_freetype2
@ -79,7 +79,7 @@ find_path(FREETYPE_INCLUDE_DIR_freetype2
ENV GTKMM_BASEPATH ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
PATH_SUFFIXES include/freetype2 include PATH_SUFFIXES include/freetype2 include freetype2
) )
find_library(FREETYPE_LIBRARY find_library(FREETYPE_LIBRARY

View File

@ -66,6 +66,7 @@ if(GIF_INCLUDE_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckStructHasMember.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckStructHasMember.cmake)
CMAKE_PUSH_CHECK_STATE() CMAKE_PUSH_CHECK_STATE()
set(CMAKE_REQUIRED_QUIET ${GIF_FIND_QUIETLY})
set(GIF_VERSION 3) set(GIF_VERSION 3)
set(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
CHECK_STRUCT_HAS_MEMBER(GifFileType UserData gif_lib.h GIF_GifFileType_UserData ) CHECK_STRUCT_HAS_MEMBER(GifFileType UserData gif_lib.h GIF_GifFileType_UserData )

View File

@ -79,7 +79,7 @@
# extra_args = Pass a list of extra arguments to be passed to # extra_args = Pass a list of extra arguments to be passed to
# executable enclosed in quotes (or "" for none) # executable enclosed in quotes (or "" for none)
# ARGN = A list of source files to search for tests & test # ARGN = A list of source files to search for tests & test
# fixtures. # fixtures. Or AUTO to find them from executable target.
# #
# #
# #
@ -88,7 +88,7 @@
# Example: # Example:
# set(FooTestArgs --foo 1 --bar 2) # set(FooTestArgs --foo 1 --bar 2)
# add_executable(FooTest FooUnitTest.cc) # add_executable(FooTest FooUnitTest.cc)
# GTEST_ADD_TESTS(FooTest "${FooTestArgs}" FooUnitTest.cc) # GTEST_ADD_TESTS(FooTest "${FooTestArgs}" AUTO)
#============================================================================= #=============================================================================
# Copyright 2009 Kitware, Inc. # Copyright 2009 Kitware, Inc.
@ -111,6 +111,10 @@ function(GTEST_ADD_TESTS executable extra_args)
if(NOT ARGN) if(NOT ARGN)
message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS") message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
endif() endif()
if(ARGN STREQUAL "AUTO")
# obtain sources used for building that executable
get_property(ARGN TARGET ${executable} PROPERTY SOURCES)
endif()
foreach(source ${ARGN}) foreach(source ${ARGN})
file(READ "${source}" contents) file(READ "${source}" contents)
string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})

View File

@ -2,7 +2,7 @@
# FindHg # FindHg
# ------ # ------
# #
# # Extract information from a mercurial working copy.
# #
# The module defines the following variables: # The module defines the following variables:
# #
@ -12,6 +12,20 @@
# HG_FOUND - true if the command line client was found # HG_FOUND - true if the command line client was found
# HG_VERSION_STRING - the version of mercurial found # HG_VERSION_STRING - the version of mercurial found
# #
# If the command line client executable is found the following macro is defined:
#
# ::
#
# HG_WC_INFO(<dir> <var-prefix>)
#
# Hg_WC_INFO extracts information of a mercurial working copy
# at a given location. This macro defines the following variables:
#
# ::
#
# <var-prefix>_WC_CHANGESET - current changeset
# <var-prefix>_WC_REVISION - current revision
#
# Example usage: # Example usage:
# #
# :: # ::
@ -19,11 +33,15 @@
# find_package(Hg) # find_package(Hg)
# if(HG_FOUND) # if(HG_FOUND)
# message("hg found: ${HG_EXECUTABLE}") # message("hg found: ${HG_EXECUTABLE}")
# HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
# message("Current revision is ${Project_WC_REVISION}")
# message("Current changeset is ${Project_WC_CHANGESET}")
# endif() # endif()
#============================================================================= #=============================================================================
# Copyright 2010-2012 Kitware, Inc. # Copyright 2010-2012 Kitware, Inc.
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de> # Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# Copyright 2014 Matthaeus G. Chajdas
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -37,6 +55,8 @@
find_program(HG_EXECUTABLE find_program(HG_EXECUTABLE
NAMES hg NAMES hg
PATHS
[HKEY_LOCAL_MACHINE\\Software\\TortoiseHG]
PATH_SUFFIXES Mercurial PATH_SUFFIXES Mercurial
DOC "hg command line client" DOC "hg command line client"
) )
@ -51,6 +71,21 @@ if(HG_EXECUTABLE)
set(HG_VERSION_STRING "${CMAKE_MATCH_1}") set(HG_VERSION_STRING "${CMAKE_MATCH_1}")
endif() endif()
unset(hg_version) unset(hg_version)
macro(HG_WC_INFO dir prefix)
execute_process(COMMAND ${HG_EXECUTABLE} id -i -n
WORKING_DIRECTORY ${dir}
RESULT_VARIABLE hg_id_result
ERROR_VARIABLE hg_id_error
OUTPUT_VARIABLE ${prefix}_WC_DATA
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${hg_id_result} EQUAL 0)
message(SEND_ERROR "Command \"${HG_EXECUTBALE} id -n\" in directory ${dir} failed with output:\n${hg_id_error}")
endif()
string(REGEX REPLACE "([0-9a-f]+)\\+? [0-9]+\\+?" "\\1" ${prefix}_WC_CHANGESET ${${prefix}_WC_DATA})
string(REGEX REPLACE "[0-9a-f]+\\+? ([0-9]+)\\+?" "\\1" ${prefix}_WC_REVISION ${${prefix}_WC_DATA})
endmacro(HG_WC_INFO)
endif() endif()
# Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if # Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if

View File

@ -54,6 +54,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
else () else ()
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
endif () endif ()
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY})
set(LAPACK_FOUND FALSE) set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE) set(LAPACK95_FOUND FALSE)
@ -347,4 +351,5 @@ else()
endif() endif()
endif() endif()
cmake_pop_check_state()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})

View File

@ -55,9 +55,12 @@ endif()
# Avoid using old codebase # Avoid using old codebase
if (LIBLZMA_LIBRARY) if (LIBLZMA_LIBRARY)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${LibLZMA_FIND_QUIETLY})
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER) CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER) CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET) CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
endif () endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

135
Modules/FindOpenCL.cmake Normal file
View File

@ -0,0 +1,135 @@
#.rst:
# FindOpenCL
# ----------
#
# Try to find OpenCL
#
# Once done this will define::
#
# OpenCL_FOUND - True if OpenCL was found
# OpenCL_INCLUDE_DIRS - include directories for OpenCL
# OpenCL_LIBRARIES - link against this library to use OpenCL
# OpenCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
# OpenCL_VERSION_MAJOR - The major version of the OpenCL implementation
# OpenCL_VERSION_MINOR - The minor version of the OpenCL implementation
#
# The module will also define two cache variables::
#
# OpenCL_INCLUDE_DIR - the OpenCL include directory
# OpenCL_LIBRARY - the path to the OpenCL library
#
#=============================================================================
# Copyright 2014 Matthaeus G. Chajdas
#
# 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(_FIND_OPENCL_VERSION)
include(CheckSymbolExists)
include(CMakePushCheckState)
set(CMAKE_REQUIRED_QUIET ${OpenCL_FIND_QUIETLY})
CMAKE_PUSH_CHECK_STATE()
foreach(VERSION "2_0" "1_2" "1_1" "1_0")
set(CMAKE_REQUIRED_INCLUDES "${OpenCL_INCLUDE_DIR}")
if(APPLE)
CHECK_SYMBOL_EXISTS(
CL_VERSION_${VERSION}
"${OpenCL_INCLUDE_DIR}/OpenCL/cl.h"
OPENCL_VERSION_${VERSION})
else()
CHECK_SYMBOL_EXISTS(
CL_VERSION_${VERSION}
"${OpenCL_INCLUDE_DIR}/CL/cl.h"
OPENCL_VERSION_${VERSION})
endif()
if(OPENCL_VERSION_${VERSION})
string(REPLACE "_" "." VERSION "${VERSION}")
set(OpenCL_VERSION_STRING ${VERSION} PARENT_SCOPE)
string(REGEX MATCHALL "[0-9]+" version_components "${VERSION}")
list(GET version_components 0 major_version)
list(GET version_components 1 minor_version)
set(OpenCL_VERSION_MAJOR ${major_version} PARENT_SCOPE)
set(OpenCL_VERSION_MINOR ${minor_version} PARENT_SCOPE)
break()
endif()
endforeach()
CMAKE_POP_CHECK_STATE()
endfunction()
find_path(OpenCL_INCLUDE_DIR
NAMES
CL/cl.h OpenCL/cl.h
PATHS ENV
"PROGRAMFILES(X86)"
AMDAPPSDKROOT
INTELOCLSDKROOT
NVSDKCOMPUTE_ROOT
CUDA_PATH
ATISTREAMSDKROOT
PATH_SUFFIXES
OpenCL/common/inc
"AMD APP/include")
_FIND_OPENCL_VERSION()
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
find_library(OpenCL_LIBRARY
NAMES OpenCL
PATHS ENV
"PROGRAMFILES(X86)"
AMDAPPSDKROOT
INTELOCLSDKROOT
CUDA_PATH
NVSDKCOMPUTE_ROOT
ATISTREAMSDKROOT
PATH_SUFFIXES
"AMD APP/lib/x86"
lib/x86
lib/Win32
OpenCL/common/lib/Win32)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
find_library(OpenCL_LIBRARY
NAMES OpenCL
PATHS ENV
"PROGRAMFILES(X86)"
AMDAPPSDKROOT
INTELOCLSDKROOT
CUDA_PATH
NVSDKCOMPUTE_ROOT
ATISTREAMSDKROOT
PATH_SUFFIXES
"AMD APP/lib/x86_64"
lib/x86_64
lib/x64
OpenCL/common/lib/x64)
endif()
else()
find_library(OpenCL_LIBRARY
NAMES OpenCL)
endif()
set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
set(OpenCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIR})
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(
OpenCL
FOUND_VAR OpenCL_FOUND
REQUIRED_VARS OpenCL_LIBRARY OpenCL_INCLUDE_DIR
VERSION_VAR OpenCL_VERSION_STRING)
mark_as_advanced(
OpenCL_INCLUDE_DIR
OpenCL_LIBRARY)

View File

@ -39,6 +39,8 @@
# License text for the above reference.) # License text for the above reference.)
set(_OPENMP_REQUIRED_VARS) set(_OPENMP_REQUIRED_VARS)
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${OpenMP_FIND_QUIETLY})
function(_OPENMP_FLAG_CANDIDATES LANG) function(_OPENMP_FLAG_CANDIDATES LANG)
set(OpenMP_FLAG_CANDIDATES set(OpenMP_FLAG_CANDIDATES
@ -116,7 +118,9 @@ if(CMAKE_C_COMPILER_LOADED)
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}") set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE) unset(OpenMP_FLAG_DETECTED CACHE)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Try OpenMP C flag = [${FLAG}]") message(STATUS "Try OpenMP C flag = [${FLAG}]")
endif()
check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED) check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED) if(OpenMP_FLAG_DETECTED)
@ -150,7 +154,9 @@ if(CMAKE_CXX_COMPILER_LOADED)
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}") set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE) unset(OpenMP_FLAG_DETECTED CACHE)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Try OpenMP CXX flag = [${FLAG}]") message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
endif()
check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED) check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED) if(OpenMP_FLAG_DETECTED)
@ -167,6 +173,8 @@ if(CMAKE_CXX_COMPILER_LOADED)
unset(OpenMP_CXX_TEST_SOURCE) unset(OpenMP_CXX_TEST_SOURCE)
endif() endif()
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
if(_OPENMP_REQUIRED_VARS) if(_OPENMP_REQUIRED_VARS)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

View File

@ -2,139 +2,19 @@
# FindPkgConfig # FindPkgConfig
# ------------- # -------------
# #
# a pkg-config module for CMake # A `pkg-config` module for CMake.
# #
# Finds the ``pkg-config`` executable and add the
# :command:`pkg_check_modules` and :command:`pkg_search_module`
# commands.
# #
# # In order to find the ``pkg-config`` executable, it uses the
# Usage: # :variable:`PKG_CONFIG_EXECUTABLE` variable or the ``PKG_CONFIG``
# # environment variable first.
# ::
#
# pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
# checks for all the given modules
#
#
#
# ::
#
# pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
# checks for given modules and uses the first working one
#
#
#
# When the 'REQUIRED' argument was set, macros will fail with an error
# when module(s) could not be found
#
# When the 'QUIET' argument is set, no status messages will be printed.
#
# It sets the following variables:
#
# ::
#
# PKG_CONFIG_FOUND ... if pkg-config executable was found
# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
# PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
# (since CMake 2.8.8)
#
#
#
# For the following variables two sets of values exist; first one is the
# common one and has the given PREFIX. The second set contains flags
# which are given out when pkgconfig was called with the '--static'
# option.
#
# ::
#
# <XPREFIX>_FOUND ... set to 1 if module(s) exist
# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
# <XPREFIX>_LDFLAGS ... all required linker flags
# <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
# <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
# <XPREFIX>_CFLAGS ... all required cflags
# <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
#
#
#
# ::
#
# <XPREFIX> = <PREFIX> for common case
# <XPREFIX> = <PREFIX>_STATIC for static linking
#
#
#
# There are some special variables whose prefix depends on the count of
# given modules. When there is only one module, <PREFIX> stays
# unchanged. When there are multiple modules, the prefix will be
# changed to <PREFIX>_<MODNAME>:
#
# ::
#
# <XPREFIX>_VERSION ... version of the module
# <XPREFIX>_PREFIX ... prefix-directory of the module
# <XPREFIX>_INCLUDEDIR ... include-dir of the module
# <XPREFIX>_LIBDIR ... lib-dir of the module
#
#
#
# ::
#
# <XPREFIX> = <PREFIX> when |MODULES| == 1, else
# <XPREFIX> = <PREFIX>_<MODNAME>
#
#
#
# A <MODULE> parameter can have the following formats:
#
# ::
#
# {MODNAME} ... matches any version
# {MODNAME}>={VERSION} ... at least version <VERSION> is required
# {MODNAME}={VERSION} ... exactly version <VERSION> is required
# {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
#
#
#
# Examples
#
# ::
#
# pkg_check_modules (GLIB2 glib-2.0)
#
#
#
# ::
#
# pkg_check_modules (GLIB2 glib-2.0>=2.10)
# requires at least version 2.10 of glib2 and defines e.g.
# GLIB2_VERSION=2.10.3
#
#
#
# ::
#
# pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
# requires both glib2 and gtk2, and defines e.g.
# FOO_glib-2.0_VERSION=2.10.3
# FOO_gtk+-2.0_VERSION=2.8.20
#
#
#
# ::
#
# pkg_check_modules (XRENDER REQUIRED xrender)
# defines e.g.:
# XRENDER_LIBRARIES=Xrender;X11
# XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
#
#
#
# ::
#
# pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2014 Kitware, Inc.
# Copyright 2014 Christoph Grüninger <foss@grueninger.de>
# Copyright 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> # Copyright 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
@ -150,6 +30,10 @@
### Common stuff #### ### Common stuff ####
set(PKG_CONFIG_VERSION 1) set(PKG_CONFIG_VERSION 1)
# find pkg-config, use PKG_CONFIG if set
if((NOT PKG_CONFIG_EXECUTABLE) AND (NOT "$ENV{PKG_CONFIG}" STREQUAL ""))
set(PKG_CONFIG_EXECUTABLE "$ENV{PKG_CONFIG}" CACHE FILEPATH "pkg-config executable")
endif()
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
mark_as_advanced(PKG_CONFIG_EXECUTABLE) mark_as_advanced(PKG_CONFIG_EXECUTABLE)
@ -215,9 +99,20 @@ macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
endmacro() endmacro()
# Splits given arguments into options and a package list # Splits given arguments into options and a package list
macro(_pkgconfig_parse_options _result _is_req _is_silent) macro(_pkgconfig_parse_options _result _is_req _is_silent _no_cmake_path _no_cmake_environment_path)
set(${_is_req} 0) set(${_is_req} 0)
set(${_is_silent} 0) set(${_is_silent} 0)
set(${_no_cmake_path} 0)
set(${_no_cmake_environment_path} 0)
if(DEFINED PKG_CONFIG_USE_CMAKE_PREFIX_PATH)
if(NOT PKG_CONFIG_USE_CMAKE_PREFIX_PATH)
set(${_no_cmake_path} 1)
set(${_no_cmake_environment_path} 1)
endif()
elseif(${CMAKE_MINIMUM_REQUIRED_VERSION} VERSION_LESS 3.1)
set(${_no_cmake_path} 1)
set(${_no_cmake_environment_path} 1)
endif()
foreach(_pkg ${ARGN}) foreach(_pkg ${ARGN})
if (_pkg STREQUAL "REQUIRED") if (_pkg STREQUAL "REQUIRED")
@ -226,15 +121,48 @@ macro(_pkgconfig_parse_options _result _is_req _is_silent)
if (_pkg STREQUAL "QUIET") if (_pkg STREQUAL "QUIET")
set(${_is_silent} 1) set(${_is_silent} 1)
endif () endif ()
if (_pkg STREQUAL "NO_CMAKE_PATH")
set(${_no_cmake_path} 1)
endif()
if (_pkg STREQUAL "NO_CMAKE_ENVIRONMENT_PATH")
set(${_no_cmake_environment_path} 1)
endif()
endforeach() endforeach()
set(${_result} ${ARGN}) set(${_result} ${ARGN})
list(REMOVE_ITEM ${_result} "REQUIRED") list(REMOVE_ITEM ${_result} "REQUIRED")
list(REMOVE_ITEM ${_result} "QUIET") list(REMOVE_ITEM ${_result} "QUIET")
list(REMOVE_ITEM ${_result} "NO_CMAKE_PATH")
list(REMOVE_ITEM ${_result} "NO_CMAKE_ENVIRONMENT_PATH")
endmacro() endmacro()
# Add the content of a variable or an environment variable to a list of
# paths
# Usage:
# - _pkgconfig_add_extra_path(_extra_paths VAR)
# - _pkgconfig_add_extra_path(_extra_paths ENV VAR)
function(_pkgconfig_add_extra_path _extra_paths_var _var)
set(_is_env 0)
if(_var STREQUAL "ENV")
set(_var ${ARGV2})
set(_is_env 1)
endif()
if(NOT _is_env)
if(NOT "${${_var}}" STREQUAL "")
list(APPEND ${_extra_paths_var} ${CMAKE_PREFIX_PATH})
endif()
else()
if(NOT "$ENV{${_var}}" STREQUAL "")
file(TO_CMAKE_PATH "$ENV{${_var}}" _path)
list(APPEND ${_extra_paths_var} ${_path})
unset(_path)
endif()
endif()
set(${_extra_paths_var} ${${_extra_paths_var}} PARENT_SCOPE)
endfunction()
### ###
macro(_pkg_check_modules_internal _is_required _is_silent _prefix) macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cmake_environment_path _prefix)
_pkgconfig_unset(${_prefix}_FOUND) _pkgconfig_unset(${_prefix}_FOUND)
_pkgconfig_unset(${_prefix}_VERSION) _pkgconfig_unset(${_prefix}_VERSION)
_pkgconfig_unset(${_prefix}_PREFIX) _pkgconfig_unset(${_prefix}_PREFIX)
@ -273,6 +201,77 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
set(_pkg_check_modules_packages) set(_pkg_check_modules_packages)
set(_pkg_check_modules_failed) set(_pkg_check_modules_failed)
set(_extra_paths)
if(NOT _no_cmake_path)
_pkgconfig_add_extra_path(_extra_paths CMAKE_PREFIX_PATH)
_pkgconfig_add_extra_path(_extra_paths CMAKE_FRAMEWORK_PATH)
_pkgconfig_add_extra_path(_extra_paths CMAKE_APPBUNDLE_PATH)
endif()
if(NOT _no_cmake_environment_path)
_pkgconfig_add_extra_path(_extra_paths ENV CMAKE_PREFIX_PATH)
_pkgconfig_add_extra_path(_extra_paths ENV CMAKE_FRAMEWORK_PATH)
_pkgconfig_add_extra_path(_extra_paths ENV CMAKE_APPBUNDLE_PATH)
endif()
if(NOT "${_extra_paths}" STREQUAL "")
# Save the PKG_CONFIG_PATH environment variable, and add paths
# from the CMAKE_PREFIX_PATH variables
set(_pkgconfig_path_old $ENV{PKG_CONFIG_PATH})
set(_pkgconfig_path ${_pkgconfig_path_old})
if(NOT "${_pkgconfig_path}" STREQUAL "")
file(TO_CMAKE_PATH "${_pkgconfig_path}" _pkgconfig_path)
endif()
# Create a list of the possible pkgconfig subfolder (depending on
# the system
set(_lib_dirs)
if(NOT DEFINED CMAKE_SYSTEM_NAME
OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
AND NOT CMAKE_CROSSCOMPILING))
if(EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE)
list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
endif()
else()
# not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if(uselib64)
list(APPEND _lib_dirs "lib64/pkgconfig")
endif()
endif()
endif()
list(APPEND _lib_dirs "lib/pkgconfig")
# Check if directories exist and eventually append them to the
# pkgconfig path list
foreach(_prefix_dir ${_extra_paths})
foreach(_lib_dir ${_lib_dirs})
if(EXISTS "${_prefix_dir}/${_lib_dir}")
list(APPEND _pkgconfig_path "${_prefix_dir}/${_lib_dir}")
list(REMOVE_DUPLICATES _pkgconfig_path)
endif()
endforeach()
endforeach()
# Prepare and set the environment variable
if(NOT "${_pkgconfig_path}" STREQUAL "")
# remove empty values from the list
list(REMOVE_ITEM _pkgconfig_path "")
file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
if(UNIX)
string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}")
string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}")
endif()
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path})
endif()
# Unset variables
unset(_lib_dirs)
unset(_pkgconfig_path)
endif()
# iterate through module list and check whether they exist and match the required version # iterate through module list and check whether they exist and match the required version
foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list}) foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
set(_pkg_check_modules_exist_query) set(_pkg_check_modules_exist_query)
@ -338,7 +337,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
if(_pkg_check_modules_failed) if(_pkg_check_modules_failed)
# fail when requested # fail when requested
if (${_is_required}) if (${_is_required})
message(SEND_ERROR "A required package was not found") message(FATAL_ERROR "A required package was not found")
endif () endif ()
else() else()
# when we are here, we checked whether requested modules # when we are here, we checked whether requested modules
@ -376,6 +375,14 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags )
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other )
endif() endif()
if(NOT "${_extra_paths}" STREQUAL "")
# Restore the environment variable
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path})
endif()
unset(_extra_paths)
unset(_pkgconfig_path_old)
else() else()
if (${_is_required}) if (${_is_required})
message(SEND_ERROR "pkg-config tool not found") message(SEND_ERROR "pkg-config tool not found")
@ -387,23 +394,138 @@ endmacro()
### User visible macros start here ### User visible macros start here
### ###
### #[========================================[.rst:
.. command:: pkg_check_modules
Checks for all the given modules. ::
pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
<MODULE> [<MODULE>]*)
When the ``REQUIRED`` argument was set, macros will fail with an error
when module(s) could not be found.
When the ``QUIET`` argument is set, no status messages will be printed.
By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or
later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set, the
:variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH`, and
:variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables will
be added to ``pkg-config`` search path.
The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments
disable this behavior for the cache variables and the environment
variables, respectively.
It sets the following variables: ::
PKG_CONFIG_FOUND ... if pkg-config executable was found
PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
(since CMake 2.8.8)
For the following variables two sets of values exist; first one is the
common one and has the given PREFIX. The second set contains flags
which are given out when ``pkg-config`` was called with the ``--static``
option. ::
<XPREFIX>_FOUND ... set to 1 if module(s) exist
<XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
<XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
<XPREFIX>_LDFLAGS ... all required linker flags
<XPREFIX>_LDFLAGS_OTHER ... all other linker flags
<XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
<XPREFIX>_CFLAGS ... all required cflags
<XPREFIX>_CFLAGS_OTHER ... the other compiler flags
::
<XPREFIX> = <PREFIX> for common case
<XPREFIX> = <PREFIX>_STATIC for static linking
There are some special variables whose prefix depends on the count of
given modules. When there is only one module, <PREFIX> stays
unchanged. When there are multiple modules, the prefix will be
changed to <PREFIX>_<MODNAME>: ::
<XPREFIX>_VERSION ... version of the module
<XPREFIX>_PREFIX ... prefix-directory of the module
<XPREFIX>_INCLUDEDIR ... include-dir of the module
<XPREFIX>_LIBDIR ... lib-dir of the module
::
<XPREFIX> = <PREFIX> when |MODULES| == 1, else
<XPREFIX> = <PREFIX>_<MODNAME>
A <MODULE> parameter can have the following formats: ::
{MODNAME} ... matches any version
{MODNAME}>={VERSION} ... at least version <VERSION> is required
{MODNAME}={VERSION} ... exactly version <VERSION> is required
{MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
Examples
.. code-block:: cmake
pkg_check_modules (GLIB2 glib-2.0)
.. code-block:: cmake
pkg_check_modules (GLIB2 glib-2.0>=2.10)
Requires at least version 2.10 of glib2 and defines e.g.
``GLIB2_VERSION=2.10.3``
.. code-block:: cmake
pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
Requires both glib2 and gtk2, and defines e.g.
``FOO_glib-2.0_VERSION=2.10.3`` and ``FOO_gtk+-2.0_VERSION=2.8.20``
.. code-block:: cmake
pkg_check_modules (XRENDER REQUIRED xrender)
Defines e.g.:
``XRENDER_LIBRARIES=Xrender;X11`` and
``XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp``
#]========================================]
macro(pkg_check_modules _prefix _module0) macro(pkg_check_modules _prefix _module0)
# check cached value # check cached value
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
_pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN}) _pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path "${_module0}" ${ARGN})
_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules}) _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} "${_prefix}" ${_pkg_modules})
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
endif() endif()
endmacro() endmacro()
###
#[========================================[.rst:
.. command:: pkg_search_module
Same as :command:`pkg_check_modules`, but instead it checks for given
modules and uses the first working one. ::
pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
<MODULE> [<MODULE>]*)
Examples
.. code-block:: cmake
pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
#]========================================]
macro(pkg_search_module _prefix _module0) macro(pkg_search_module _prefix _module0)
# check cached value # check cached value
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
set(_pkg_modules_found 0) set(_pkg_modules_found 0)
_pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN}) _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path "${_module0}" ${ARGN})
if (NOT ${_pkg_is_silent}) if (NOT ${_pkg_is_silent})
message(STATUS "checking for one of the modules '${_pkg_modules_alt}'") message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
@ -412,7 +534,7 @@ macro(pkg_search_module _prefix _module0)
# iterate through all modules and stop at the first working one. # iterate through all modules and stop at the first working one.
foreach(_pkg_alt ${_pkg_modules_alt}) foreach(_pkg_alt ${_pkg_modules_alt})
if(NOT _pkg_modules_found) if(NOT _pkg_modules_found)
_pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}") _pkg_check_modules_internal(0 1 ${_no_cmake_path} ${_no_cmake_environment_path} "${_prefix}" "${_pkg_alt}")
endif() endif()
if (${_prefix}_FOUND) if (${_prefix}_FOUND)
@ -430,6 +552,26 @@ macro(pkg_search_module _prefix _module0)
endif() endif()
endmacro() endmacro()
#[========================================[.rst:
.. variable:: PKG_CONFIG_EXECUTABLE
Path to the pkg-config executable.
.. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH
Whether :command:`pkg_check_modules` and :command:`pkg_search_module`
should add the paths in :variable:`CMAKE_PREFIX_PATH`,
:variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH`
cache and environment variables to ``pkg-config`` search path.
If this variable is not set, this behavior is enabled by default if
:variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled
otherwise.
#]========================================]
### Local Variables: ### Local Variables:
### mode: cmake ### mode: cmake
### End: ### End:

View File

@ -27,6 +27,10 @@
# of version numbers that should be taken into account when searching # of version numbers that should be taken into account when searching
# for Python. You need to set this variable before calling # for Python. You need to set this variable before calling
# find_package(PythonInterp). # find_package(PythonInterp).
#
# If also calling find_package(PythonLibs), call find_package(PythonInterp)
# first to get the currently active Python version by default with a consistent
# version of PYTHON_LIBRARIES.
#============================================================================= #=============================================================================
# Copyright 2005-2010 Kitware, Inc. # Copyright 2005-2010 Kitware, Inc.
@ -71,18 +75,23 @@ if(PythonInterp_FIND_VERSION)
else() else()
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
endif() endif()
list(APPEND _Python_NAMES python)
# Search for the current active python version first
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES}) find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
# Set up the versions we know about, in the order we will search. Always add # Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front. # the user supplied additional versions to the front.
set(_Python_VERSIONS set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
${Python_ADDITIONAL_VERSIONS} # If FindPythonInterp has already found the major and minor version,
${_PYTHON_FIND_OTHER_VERSIONS} # insert that version next to get consistent versions of the interpreter and
) # library.
if(DEFINED PYTHONLIBS_VERSION_STRING)
string(REPLACE "." ";" _PYTHONLIBS_VERSION "${PYTHONLIBS_VERSION_STRING}")
list(GET _PYTHONLIBS_VERSION 0 _PYTHONLIBS_VERSION_MAJOR)
list(GET _PYTHONLIBS_VERSION 1 _PYTHONLIBS_VERSION_MINOR)
list(APPEND _Python_VERSIONS ${_PYTHONLIBS_VERSION_MAJOR}.${_PYTHONLIBS_VERSION_MINOR})
endif()
# Search for the current active python version first
list(APPEND _Python_VERSIONS ";")
list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
unset(_PYTHON_FIND_OTHER_VERSIONS) unset(_PYTHON_FIND_OTHER_VERSIONS)
unset(_PYTHON1_VERSIONS) unset(_PYTHON1_VERSIONS)
@ -91,7 +100,7 @@ unset(_PYTHON3_VERSIONS)
# Search for newest python version if python executable isn't found # Search for newest python version if python executable isn't found
if(NOT PYTHON_EXECUTABLE) if(NOT PYTHON_EXECUTABLE)
foreach(_CURRENT_VERSION ${_Python_VERSIONS}) foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
set(_Python_NAMES python${_CURRENT_VERSION}) set(_Python_NAMES python${_CURRENT_VERSION})
if(WIN32) if(WIN32)
list(APPEND _Python_NAMES python) list(APPEND _Python_NAMES python)

View File

@ -31,6 +31,10 @@
# #
# PYTHON_LIBRARY - path to the python library # PYTHON_LIBRARY - path to the python library
# PYTHON_INCLUDE_DIR - path to where Python.h is found # PYTHON_INCLUDE_DIR - path to where Python.h is found
#
# If also calling find_package(PythonInterp), call find_package(PythonInterp)
# first to get the currently active Python version by default with a consistent
# version of PYTHON_LIBRARIES.
#============================================================================= #=============================================================================
# Copyright 2001-2009 Kitware, Inc. # Copyright 2001-2009 Kitware, Inc.
@ -80,10 +84,14 @@ endif()
# Set up the versions we know about, in the order we will search. Always add # Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front. # the user supplied additional versions to the front.
set(_Python_VERSIONS # If FindPythonInterp has already found the major and minor version,
${Python_ADDITIONAL_VERSIONS} # insert that version between the user supplied versions and the stock
${_PYTHON_FIND_OTHER_VERSIONS} # version list.
) set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
endif()
list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
unset(_PYTHON_FIND_OTHER_VERSIONS) unset(_PYTHON_FIND_OTHER_VERSIONS)
unset(_PYTHON1_VERSIONS) unset(_PYTHON1_VERSIONS)

View File

@ -335,6 +335,7 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSymbolExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSymbolExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake) include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake) set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
@ -613,9 +614,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
set(QT_QTCORE_FOUND 1) set(QT_QTCORE_FOUND 1)
else() else()
message(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" " if(NOT Qt4_FIND_QUIETLY)
message(WARNING
"${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as "
"\"${QT_LIBRARY_DIR_TMP}\" "
"but QtCore could not be found there. " "but QtCore could not be found there. "
"Qt is NOT installed correctly for the target build environment.") "Qt is NOT installed correctly for the target build environment.")
endif()
set(Qt4_FOUND FALSE) set(Qt4_FOUND FALSE)
if(Qt4_FIND_REQUIRED) if(Qt4_FIND_REQUIRED)
message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
@ -747,11 +752,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
# Find out what window system we're using # Find out what window system we're using
# #
############################################# #############################################
# Save required variable cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
set(CMAKE_REQUIRED_QUIET ${Qt4_FIND_QUIETLY})
# Check for Window system symbols (note: only one should end up being set) # Check for Window system symbols (note: only one should end up being set)
CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11) CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
CHECK_CXX_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN) CHECK_CXX_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
@ -771,9 +775,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
endif () endif ()
endif () endif ()
# Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables cmake_pop_check_state()
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
# #
############################################# #############################################

View File

@ -54,7 +54,9 @@ find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
HINTS HINTS
ENV SDLIMAGEDIR ENV SDLIMAGEDIR
ENV SDLDIR ENV SDLDIR
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include PATH_SUFFIXES SDL
# path suffixes to search inside ENV{SDLDIR}
include/SDL include/SDL12 include/SDL11 include
) )
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)

View File

@ -54,7 +54,9 @@ find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
HINTS HINTS
ENV SDLMIXERDIR ENV SDLMIXERDIR
ENV SDLDIR ENV SDLDIR
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include PATH_SUFFIXES SDL
# path suffixes to search inside ENV{SDLDIR}
include/SDL include/SDL12 include/SDL11 include
) )
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)

View File

@ -54,7 +54,9 @@ find_path(SDL_NET_INCLUDE_DIR SDL_net.h
HINTS HINTS
ENV SDLNETDIR ENV SDLNETDIR
ENV SDLDIR ENV SDLDIR
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include PATH_SUFFIXES SDL
# path suffixes to search inside ENV{SDLDIR}
include/SDL include/SDL12 include/SDL11 include
) )
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)

View File

@ -98,7 +98,9 @@ find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
HINTS HINTS
ENV SDLSOUNDDIR ENV SDLSOUNDDIR
ENV SDLDIR ENV SDLDIR
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include PATH_SUFFIXES SDL
# path suffixes to search inside ENV{SDLDIR}
include/SDL include/SDL12 include/SDL11 include
) )
find_library(SDL_SOUND_LIBRARY find_library(SDL_SOUND_LIBRARY

View File

@ -54,7 +54,9 @@ find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
HINTS HINTS
ENV SDLTTFDIR ENV SDLTTFDIR
ENV SDLDIR ENV SDLDIR
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include PATH_SUFFIXES SDL
# path suffixes to search inside ENV{SDLDIR}
include/SDL include/SDL12 include/SDL11 include
) )
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)

View File

@ -37,6 +37,8 @@ include (CheckIncludeFiles)
include (CheckLibraryExists) include (CheckLibraryExists)
include (CheckSymbolExists) include (CheckSymbolExists)
set(Threads_FOUND FALSE) set(Threads_FOUND FALSE)
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${Threads_FIND_QUIETLY})
# Do we have sproc? # Do we have sproc?
if(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD) if(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
@ -63,16 +65,15 @@ else()
set(CMAKE_THREAD_LIBS_INIT "") set(CMAKE_THREAD_LIBS_INIT "")
set(CMAKE_HAVE_THREADS_LIBRARY 1) set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE) set(Threads_FOUND TRUE)
endif() else()
if(NOT CMAKE_HAVE_THREADS_LIBRARY)
# Do we have -lpthreads # Do we have -lpthreads
CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE) CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
if(CMAKE_HAVE_PTHREADS_CREATE) if(CMAKE_HAVE_PTHREADS_CREATE)
set(CMAKE_THREAD_LIBS_INIT "-lpthreads") set(CMAKE_THREAD_LIBS_INIT "-lpthreads")
set(CMAKE_HAVE_THREADS_LIBRARY 1) set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE) set(Threads_FOUND TRUE)
endif() else()
# Ok, how about -lpthread # Ok, how about -lpthread
CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
@ -80,9 +81,8 @@ else()
set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1) set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE) set(Threads_FOUND TRUE)
endif()
if(CMAKE_SYSTEM MATCHES "SunOS.*") elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
# On sun also check for -lthread # On sun also check for -lthread
CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE) CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
if(CMAKE_HAVE_THR_CREATE) if(CMAKE_HAVE_THR_CREATE)
@ -93,10 +93,11 @@ else()
endif() endif()
endif() endif()
endif() endif()
endif()
if(NOT CMAKE_HAVE_THREADS_LIBRARY) if(NOT CMAKE_HAVE_THREADS_LIBRARY)
# If we did not found -lpthread, -lpthread, or -lthread, look for -pthread # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
if("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG") if("x${THREADS_HAVE_PTHREAD_ARG}" STREQUAL "x")
message(STATUS "Check if compiler accepts -pthread") message(STATUS "Check if compiler accepts -pthread")
try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
@ -174,5 +175,6 @@ if(CMAKE_USE_PTHREADS_INIT)
endif() endif()
endif() endif()
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)

View File

@ -73,6 +73,8 @@ if (UNIX)
# found in tcl on the mac # found in tcl on the mac
set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK}) set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
set(CMAKE_FIND_FRAMEWORK NEVER) set(CMAKE_FIND_FRAMEWORK NEVER)
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${X11_FIND_QUIETLY})
set(X11_INC_SEARCH_PATH set(X11_INC_SEARCH_PATH
/usr/pkg/xorg/include /usr/pkg/xorg/include
/usr/X11R6/include /usr/X11R6/include
@ -507,6 +509,7 @@ if (UNIX)
X11_XSync_INCLUDE_PATH X11_XSync_INCLUDE_PATH
) )
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE}) set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
endif () endif ()
# X11_FIND_REQUIRED_<component> could be checked too # X11_FIND_REQUIRED_<component> could be checked too

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