diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/CPackComponent.cmake | 4 | ||||
-rw-r--r-- | Modules/CPackDeb.cmake | 6 | ||||
-rw-r--r-- | Modules/CPackNSIS.cmake | 2 | ||||
-rw-r--r-- | Modules/CPackRPM.cmake | 4 | ||||
-rw-r--r-- | Modules/CheckForPthreads.c | 2 | ||||
-rw-r--r-- | Modules/CheckFunctionExists.c | 3 | ||||
-rw-r--r-- | Modules/CheckFunctionExists.cmake | 14 | ||||
-rw-r--r-- | Modules/CheckLibraryExists.cmake | 13 | ||||
-rw-r--r-- | Modules/CheckSymbolExists.cmake | 10 | ||||
-rw-r--r-- | Modules/Compiler/IAR.cmake | 4 | ||||
-rw-r--r-- | Modules/FindHDF5.cmake | 2 | ||||
-rw-r--r-- | Modules/FindThreads.cmake | 27 | ||||
-rw-r--r-- | Modules/FindwxWidgets.cmake | 4 | ||||
-rw-r--r-- | Modules/readme.txt | 2 |
16 files changed, 75 insertions, 26 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 4b0d278..e0b5468 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -101,7 +101,7 @@ if(NOT CMAKE_C_COMPILER_ID_RUN) CMAKE_C_COMPILER_ID_PLATFORM_CONTENT) # The IAR compiler produces weird output. - # See http://www.cmake.org/Bug/view.php?id=10176#c19598 + # See https://cmake.org/Bug/view.php?id=10176#c19598 list(APPEND CMAKE_C_COMPILER_ID_VENDORS IAR) set(CMAKE_C_COMPILER_ID_VENDOR_FLAGS_IAR ) set(CMAKE_C_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler") diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 680356d..3c9bbc2 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -96,7 +96,7 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN) CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT) # The IAR compiler produces weird output. - # See http://www.cmake.org/Bug/view.php?id=10176#c19598 + # See https://cmake.org/Bug/view.php?id=10176#c19598 list(APPEND CMAKE_CXX_COMPILER_ID_VENDORS IAR) set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR ) set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler") diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake index 573e5aa..96d5609 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -263,7 +263,7 @@ # # The site argument is a URL where the archives for downloadable # components will reside, e.g., -# http://www.cmake.org/files/2.6.1/installer/ All of the archives +# https://cmake.org/files/2.6.1/installer/ All of the archives # produced by CPack should be uploaded to that location. # # UPLOAD_DIRECTORY is the local directory where CPack will create the @@ -301,7 +301,7 @@ if(NOT CPackComponent_CMake_INCLUDED) set(CPackComponent_CMake_INCLUDED 1) -# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments +# Argument-parsing macro from https://cmake.org/Wiki/CMakeMacroParseArguments macro(cpack_parse_arguments prefix arg_names option_names) set(${prefix}_DEFAULT_ARGS) foreach(arg_name ${arg_names}) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 93d51c3..60e0d1f 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -9,7 +9,7 @@ # # CPackDeb may be used to create Deb package using CPack. # CPackDeb is a CPack generator thus it uses the CPACK_XXX variables -# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. +# used by CPack : https://cmake.org/Wiki/CMake:CPackConfiguration. # CPackDeb generator should work on any linux host but it will produce # better deb package when Debian specific tools 'dpkg-xxx' are usable on # the build system. @@ -23,7 +23,7 @@ # a component GROUP name. # # You'll find a detailed usage on the wiki: -# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 . +# https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 . # However as a handy reminder here comes the list of specific variables: # # .. variable:: CPACK_DEBIAN_PACKAGE_NAME @@ -153,7 +153,7 @@ # You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value # if you use this feature, because if you don't :code:`dpkg-shlibdeps` # may fail to find your own shared libs. -# See http://www.cmake.org/Wiki/CMake_RPATH_handling. +# See https://cmake.org/Wiki/CMake_RPATH_handling. # # # .. variable:: CPACK_DEBIAN_PACKAGE_DEBUG diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake index 4b2e0eb..c6b3d19 100644 --- a/Modules/CPackNSIS.cmake +++ b/Modules/CPackNSIS.cmake @@ -115,7 +115,7 @@ # # set(CPACK_NSIS_MENU_LINKS # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" -# "CMake Help" "http://www.cmake.org" "CMake Web Site") +# "CMake Help" "https://cmake.org" "CMake Web Site") # #============================================================================= diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 7c1db14..1e7b055 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -9,7 +9,7 @@ # # CPackRPM may be used to create RPM package using CPack. CPackRPM is a # CPack generator thus it uses the CPACK_XXX variables used by CPack : -# http://www.cmake.org/Wiki/CMake:CPackConfiguration +# https://cmake.org/Wiki/CMake:CPackConfiguration # # However CPackRPM has specific features which are controlled by the # specifics CPACK_RPM_XXX variables. CPackRPM is a component aware @@ -24,7 +24,7 @@ # # :: # -# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 +# https://cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 # # However as a handy reminder here comes the list of specific variables: # diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c index 7250fbf..2732957 100644 --- a/Modules/CheckForPthreads.c +++ b/Modules/CheckForPthreads.c @@ -31,7 +31,7 @@ void* runner(void* args) int cc; for ( cc = 0; cc < 10; cc ++ ) { - printf("%d CC: %d\n", (int)args, cc); + printf("%p CC: %d\n", args, cc); } res ++; return 0; diff --git a/Modules/CheckFunctionExists.c b/Modules/CheckFunctionExists.c index 607b3e8..fd29618 100644 --- a/Modules/CheckFunctionExists.c +++ b/Modules/CheckFunctionExists.c @@ -1,5 +1,8 @@ #ifdef CHECK_FUNCTION_EXISTS +#ifdef __cplusplus +extern "C" +#endif char CHECK_FUNCTION_EXISTS(); #ifdef __CLASSIC_C__ int main(){ diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index d277c32..5dd3751 100644 --- a/Modules/CheckFunctionExists.cmake +++ b/Modules/CheckFunctionExists.cmake @@ -57,14 +57,26 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) else() set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES) endif() + + if(CMAKE_C_COMPILER_LOADED) + set(_cfe_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c) + elseif(CMAKE_CXX_COMPILER_LOADED) + set(_cfe_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists/CheckFunctionExists.cxx) + configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cfe_source}" COPYONLY) + else() + message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled") + endif() + try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} - ${CMAKE_ROOT}/Modules/CheckFunctionExists.c + ${_cfe_source} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}" OUTPUT_VARIABLE OUTPUT) + unset(_cfe_source) + if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}") if(NOT CMAKE_REQUIRED_QUIET) diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index 95c595a..6b53823 100644 --- a/Modules/CheckLibraryExists.cmake +++ b/Modules/CheckLibraryExists.cmake @@ -53,15 +53,26 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) set(CHECK_LIBRARY_EXISTS_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES}) endif() + + if(CMAKE_C_COMPILER_LOADED) + set(_cle_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c) + elseif(CMAKE_CXX_COMPILER_LOADED) + set(_cle_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckLibraryExists/CheckFunctionExists.cxx) + configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cle_source}" COPYONLY) + else() + message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled") + endif() + try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} - ${CMAKE_ROOT}/Modules/CheckFunctionExists.c + ${_cle_source} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION} -DLINK_DIRECTORIES:STRING=${LOCATION} OUTPUT_VARIABLE OUTPUT) + unset(_cle_source) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index 79c5ba7..c4dff3f 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -44,10 +44,14 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) - - macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) - _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) + if(CMAKE_C_COMPILER_LOADED) + _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) + elseif(CMAKE_CXX_COMPILER_LOADED) + _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) + else() + message(FATAL_ERROR "CHECK_SYMBOL_EXISTS needs either C or CXX language enabled") + endif() endmacro() macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE) diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake index 00e4713..8c6c3f6 100644 --- a/Modules/Compiler/IAR.cmake +++ b/Modules/Compiler/IAR.cmake @@ -1,6 +1,6 @@ # This file is processed when the IAR compiler is used for a C or C++ file # Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/ -# The initial feature request is here: http://www.cmake.org/Bug/view.php?id=10176 +# The initial feature request is here: https://cmake.org/Bug/view.php?id=10176 # It also contains additional links and information. if(_IAR_CMAKE_LOADED) @@ -39,7 +39,7 @@ endif() if(NOT IAR_TARGET_ARCHITECTURE) message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported " - " by CMake. Please go to http://www.cmake.org/Bug and enter a feature request there.") + " by CMake. Please go to https://cmake.org/Bug and enter a feature request there.") endif() set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 37bca83..9f6e666 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -307,7 +307,7 @@ if( NOT HDF5_FOUND ) if( UNIX AND HDF5_USE_STATIC_LIBRARIES ) # According to bug 1643 on the CMake bug tracker, this is the # preferred method for searching for a static library. - # See http://www.cmake.org/Bug/view.php?id=1643. We search + # See https://cmake.org/Bug/view.php?id=1643. We search # first for the full static library name, but fall back to a # generic search on the name if the static search fails. set( THIS_LIBRARY_SEARCH_DEBUG lib${LIB}d.a ${LIB}d ) diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index a0bc4d1..c607923 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -39,7 +39,7 @@ #============================================================================= # Copyright 2002-2009 Kitware, Inc. -# Copyright 2011-2014 Rolf Eike Beer <eike@sf-mail.de> +# Copyright 2011-2015 Rolf Eike Beer <eike@sf-mail.de> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -51,15 +51,23 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -include (CheckIncludeFiles) include (CheckLibraryExists) include (CheckSymbolExists) set(Threads_FOUND FALSE) set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET}) set(CMAKE_REQUIRED_QUIET ${Threads_FIND_QUIETLY}) +if(CMAKE_C_COMPILER_LOADED) + include (CheckIncludeFile) +elseif(CMAKE_CXX_COMPILER_LOADED) + include (CheckIncludeFileCXX) +else() + message(FATAL_ERROR "FindThreads only works if either C or CXX language is enabled") +endif() + # Do we have sproc? if(CMAKE_SYSTEM_NAME MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD) + include (CheckIncludeFiles) CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H) endif() @@ -83,11 +91,18 @@ macro(_check_pthreads_flag) # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread if(NOT DEFINED THREADS_HAVE_PTHREAD_ARG) message(STATUS "Check if compiler accepts -pthread") + if(CMAKE_C_COMPILER_LOADED) + set(_threads_src ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c) + elseif(CMAKE_CXX_COMPILER_LOADED) + set(_threads_src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindThreads/CheckForPthreads.cxx) + configure_file(${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c "${_threads_src}" COPYONLY) + endif() try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c + ${_threads_src} CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread COMPILE_OUTPUT_VARIABLE OUTPUT) + unset(_threads_src) if(THREADS_HAVE_PTHREAD_ARG) if(THREADS_PTHREAD_ARG STREQUAL "2") @@ -120,7 +135,11 @@ if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD) set(CMAKE_USE_SPROC_INIT 1) else() # Do we have pthreads? - CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H) + if(CMAKE_C_COMPILER_LOADED) + CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H) + else() + CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H) + endif() if(CMAKE_HAVE_PTHREAD_H) # diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 54a74f6..9037594 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -193,8 +193,8 @@ set(wxWidgets_CXX_FLAGS "") # to prevent UsewxWidgets.cmake from using SYSTEM. # # See cmake mailing list discussions for more info: -# http://www.cmake.org/pipermail/cmake/2008-April/021115.html -# http://www.cmake.org/pipermail/cmake/2008-April/021146.html +# https://cmake.org/pipermail/cmake/2008-April/021115.html +# https://cmake.org/pipermail/cmake/2008-April/021146.html # if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) diff --git a/Modules/readme.txt b/Modules/readme.txt index b40f3d0..1e0c13b 100644 --- a/Modules/readme.txt +++ b/Modules/readme.txt @@ -1,4 +1,4 @@ See the "Find Modules" section of the cmake-developer(7) manual page. For more information about how to contribute modules to CMake, see this page: -http://www.cmake.org/Wiki/CMake:Module_Maintainers +https://cmake.org/Wiki/CMake:Module_Maintainers |