diff --git a/.gitattributes b/.gitattributes index d21f1dda0..d3f7280e2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,6 +12,8 @@ configure crlf=input *.dsp -crlf *.dsptemplate -crlf *.dsw -crlf +*.pfx -crlf +*.png -crlf *.sln -crlf *.vcproj -crlf diff --git a/Auxiliary/bash-completion/ctest b/Auxiliary/bash-completion/ctest index 25cb99841..327e12c59 100644 --- a/Auxiliary/bash-completion/ctest +++ b/Auxiliary/bash-completion/ctest @@ -19,8 +19,12 @@ _ctest() _filedir return ;; - -L|--label-regex|-LE|--label-exclude|--track|-I|--tests-information|\ - --max-width|--timeout|--stop-time) + -L|--label-regex|-LE|--label-exclude) + COMPREPLY=( $( compgen -W '$( ctest --print-labels 2>/dev/null | + grep "^ " 2>/dev/null | cut -d" " -f 3 )' -- "$cur" ) ) + return + ;; + --track|-I|--tests-information|--max-width|--timeout|--stop-time) # argument required but no completions available return ;; diff --git a/Auxiliary/cmake-indent.vim b/Auxiliary/cmake-indent.vim index a26dd06a2..6cee9c858 100644 --- a/Auxiliary/cmake-indent.vim +++ b/Auxiliary/cmake-indent.vim @@ -16,7 +16,7 @@ " Version: $Revision$ " " Licence: The CMake license applies to this file. See -" http://www.cmake.org/HTML/Copyright.html +" http://www.cmake.org/licensing " This implies that distribution with Vim is allowed if exists("b:did_indent") diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index c8b9f8bb8..7458a660c 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -202,7 +202,7 @@ the indentation. Otherwise it retains the same position on the line" ;; Keyword highlighting regex-to-face map. ;; (defconst cmake-font-lock-keywords - (list '("^[ \t]*\\(\\w+\\)[ \t]*(" 1 font-lock-function-name-face)) + (list '("^[ \t]*\\([[:word:]_]+\\)[ \t]*(" 1 font-lock-function-name-face)) "Highlighting expressions for CMAKE mode." ) @@ -241,7 +241,6 @@ the indentation. Otherwise it retains the same position on the line" ; Create the syntax table (setq cmake-mode-syntax-table (make-syntax-table)) (set-syntax-table cmake-mode-syntax-table) - (modify-syntax-entry ?_ "w" cmake-mode-syntax-table) (modify-syntax-entry ?\( "()" cmake-mode-syntax-table) (modify-syntax-entry ?\) ")(" cmake-mode-syntax-table) (modify-syntax-entry ?# "<" cmake-mode-syntax-table) @@ -322,8 +321,13 @@ and store the result as a list in LISTVAR." ) (require 'thingatpt) +(defun cmake-symbol-at-point () + (let ((symbol (symbol-at-point))) + (and (not (null symbol)) + (symbol-name symbol)))) + (defun cmake-help-type (type) - (let* ((default-entry (word-at-point)) + (let* ((default-entry (cmake-symbol-at-point)) (history (car (cdr (cdr (assoc type cmake-string-to-list-symbol))))) (input (completing-read (format "CMake %s: " type) ; prompt @@ -366,7 +370,7 @@ and store the result as a list in LISTVAR." (defun cmake-help () "Queries for any of the four available help topics and prints out the approriate page." (interactive) - (let* ((default-entry (word-at-point)) + (let* ((default-entry (cmake-symbol-at-point)) (command-list (cmake-get-list "command")) (variable-list (cmake-get-list "variable")) (module-list (cmake-get-list "module")) diff --git a/Auxiliary/cmake-syntax.vim b/Auxiliary/cmake-syntax.vim index 80395ab1a..3e4a12275 100644 --- a/Auxiliary/cmake-syntax.vim +++ b/Auxiliary/cmake-syntax.vim @@ -16,7 +16,7 @@ " Version: $Revision$ " " Licence: The CMake license applies to this file. See -" http://www.cmake.org/HTML/Copyright.html +" http://www.cmake.org/licensing " This implies that distribution with Vim is allowed " For version 5.x: Clear all syntax items @@ -48,9 +48,9 @@ syn keyword cmakeOperators syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_REMOVE VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WRAP_EXCLUDE_FILES \ nextgroup=cmakeArguments -" The keywords are generated as: cmake --help-command-list | tr "\n" " " +" The keywords are generated as: cmake --help-command-list | tr "\n" " " | tr "[:lower:]" "[:upper:]" syn keyword cmakeStatement - \ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE + \ ADD_COMPILE_OPTIONS ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BREAK BUILD_COMMAND BUILD_NAME CMAKE_HOST_SYSTEM_INFORMATION CMAKE_MINIMUM_REQUIRED CMAKE_POLICY CONFIGURE_FILE CREATE_TEST_SOURCELIST CTEST_BUILD CTEST_CONFIGURE CTEST_COVERAGE CTEST_EMPTY_BINARY_DIRECTORY CTEST_MEMCHECK CTEST_READ_CUSTOM_FILES CTEST_RUN_SCRIPT CTEST_SLEEP CTEST_START CTEST_SUBMIT CTEST_TEST CTEST_UPDATE CTEST_UPLOAD DEFINE_PROPERTY ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_PROPERTY GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS RETURN SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_PROPERTY SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_COMPILE_DEFINITIONS TARGET_COMPILE_FEATURES TARGET_COMPILE_OPTIONS TARGET_INCLUDE_DIRECTORIES TARGET_LINK_LIBRARIES TARGET_SOURCES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VARIABLE_WATCH WHILE WRITE_FILE \ nextgroup=cmakeArguments syn keyword cmakeTodo \ TODO FIXME XXX diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index fb55bfc1d..22ca8cfa1 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -50,7 +50,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") if(NOT DEFINED CPACK_SYSTEM_NAME) # make sure package is not Cygwin-unknown, for Cygwin just # cygwin is good for the system name - if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN") set(CPACK_SYSTEM_NAME Cygwin) else() set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) @@ -59,11 +59,37 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") if(${CPACK_SYSTEM_NAME} MATCHES Windows) if(CMAKE_CL_64) set(CPACK_SYSTEM_NAME win64-x64) + set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}") else() set(CPACK_SYSTEM_NAME win32-x86) endif() endif() + if(${CMAKE_SYSTEM_NAME} MATCHES Windows) + set(_CPACK_IFW_PACKAGE_ICON + "set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")") + if(BUILD_QtDialog) + set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/bin/cmake-gui.exe\", \"@StartMenuDir@/CMake (cmake-gui).lnk\");\n") + endif() + if(SPHINX_HTML) + set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/html/index.html\", \"@StartMenuDir@/CMake Documentation.lnk\");\n") + endif() + configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in" + "${CMake_BINARY_DIR}/installscript.qs" @ONLY + ) + install(FILES "${CMake_SOURCE_DIR}/Source/QtIFW/cmake.org.html" + DESTINATION "." + ) + set(_CPACK_IFW_PACKAGE_SCRIPT "set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT \"${CMake_BINARY_DIR}/installscript.qs\")") + endif() + + if(${CMAKE_SYSTEM_NAME} MATCHES Linux) + set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}") + set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}") + endif() + + set(_CPACK_IFW_PACKAGE_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) + if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # default to source package - system, on cygwin system is not diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index aba404f09..57ed4cafd 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -31,6 +31,28 @@ endif() # they might not if qt was not enabled for the build include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL) +if(CPACK_GENERATOR MATCHES "IFW") + # Installer configuration + set(CPACK_IFW_PACKAGE_TITLE "CMake Build Tool") + set(CPACK_IFW_PRODUCT_URL "http://www.cmake.org") + @_CPACK_IFW_PACKAGE_ICON@ + set(CPACK_IFW_PACKAGE_WINDOW_ICON + "@CMake_SOURCE_DIR@/Source/QtDialog/CMakeSetup128.png") + # Package configuration group + set(CPACK_IFW_PACKAGE_GROUP CMake) + # Group configuration + set(CPACK_COMPONENT_GROUP_CMAKE_DISPLAY_NAME + "@CPACK_PACKAGE_NAME@") + set(CPACK_COMPONENT_GROUP_CMAKE_DESCRIPTION + "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@") + # IFW group configuration + set(CPACK_IFW_COMPONENT_GROUP_CMAKE_VERSION + "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_GROUP_CMAKE_LICENSES + "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@") + @_CPACK_IFW_PACKAGE_SCRIPT@ +endif() + if(CPACK_GENERATOR MATCHES "CygwinSource") # when packaging source make sure the .build directory is not included set(CPACK_SOURCE_IGNORE_FILES diff --git a/CMakeLists.txt b/CMakeLists.txt index 761ad208e..1250a9477 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,9 @@ if(CMAKE_BOOTSTRAP) unset(CMAKE_BOOTSTRAP CACHE) 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}") # Disallow architecture-specific try_run. It may not run on the host. @@ -34,6 +36,21 @@ if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") endmacro() endif() +# Use most-recent available language dialects with GNU and Clang +if(NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 11) +endif() +if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +# option to set the internal encoding of CMake to UTF-8 +option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally." ON) +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 # simply to improve readability of the main script @@ -48,7 +65,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) # Allow the user to enable/disable all system utility library options by # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}. - set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB) + set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA ZLIB) foreach(util ${UTILITIES}) if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES) @@ -84,6 +101,10 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) "${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON) CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2" "${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) + CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_LIBLZMA "Use system-installed liblzma" + "${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) + option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}") + option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}") # Mention to the user what system libraries are being used. foreach(util ${UTILITIES}) @@ -102,9 +123,11 @@ endmacro() -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) +if(NOT CMake_TEST_EXTERNAL_CMAKE) + set(CMAKE_BUILD_ON_VISUAL_STUDIO 0) + if(WIN32 AND NOT UNIX AND NOT MINGW) + set(CMAKE_BUILD_ON_VISUAL_STUDIO 1) + endif() endif() @@ -114,29 +137,6 @@ endif() #----------------------------------------------------------------------- macro(CMAKE_SETUP_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) foreach(util CURL EXPAT XMLRPC ZLIB) if(CMAKE_USE_SYSTEM_${util}) @@ -149,9 +149,19 @@ macro(CMAKE_SETUP_TESTING) # the ctest from this cmake is used for testing # and not the ctest from the cmake building and testing # cmake. - set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest") - set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") - set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") + 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_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") + set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") + endif() endif() # configure some files for testing @@ -164,8 +174,6 @@ macro(CMAKE_SETUP_TESTING) ${CMake_BINARY_DIR}/Modules/.NoDartCoverage) configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in ${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) configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY) @@ -204,12 +212,6 @@ endmacro() # Simply to improve readability of the main script. #----------------------------------------------------------------------- macro (CMAKE_BUILD_UTILITIES) - #--------------------------------------------------------------------- - # Create the KWIML library for CMake. - set(KWIML cmIML) - set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) - add_subdirectory(Utilities/KWIML) - #--------------------------------------------------------------------- # Create the kwsys library for CMake. set(KWSYS_NAMESPACE cmsys) @@ -279,15 +281,19 @@ macro (CMAKE_BUILD_UTILITIES) set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER}) set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES}) set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES}) - option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE) - if(NOT CMAKE_BUILD_CURL_SHARED) - add_definitions(-DCURL_STATICLIB) - endif() + add_definitions(-DCURL_STATICLIB) set(CMAKE_CURL_INCLUDES) set(CMAKE_CURL_LIBRARIES cmcurl) if(CMAKE_TESTS_CDASH_SERVER) set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") endif() + option(CMAKE_USE_OPENSSL "Use OpenSSL." OFF) + mark_as_advanced(CMAKE_USE_OPENSSL) + if(CMAKE_USE_OPENSSL) + set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") + set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory") + mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH) + endif() add_subdirectory(Utilities/cmcurl) CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") @@ -310,10 +316,27 @@ macro (CMAKE_BUILD_UTILITIES) CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") endif() + #--------------------------------------------------------------------- + # Build or use system liblzma for libarchive. + if(CMAKE_USE_SYSTEM_LIBLZMA) + find_package(LibLZMA) + if(NOT LIBLZMA_FOUND) + message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!") + endif() + set(LZMA_INCLUDE_DIR ${LIBLZMA_INCLUDE_DIRS}) + set(LZMA_LIBRARY ${LIBLZMA_LIBRARIES}) + else() + add_subdirectory(Utilities/cmliblzma) + CMAKE_SET_TARGET_FOLDER(cmliblzma "Utilities/3rdParty") + set(LZMA_INCLUDE_DIR + "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api") + set(LZMA_LIBRARY cmliblzma) + endif() + #--------------------------------------------------------------------- # Build or use system libarchive for CMake and CTest. if(CMAKE_USE_SYSTEM_LIBARCHIVE) - find_package(LibArchive) + find_package(LibArchive 3.0.0) if(NOT LibArchive_FOUND) message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!") endif() @@ -325,6 +348,12 @@ macro (CMAKE_BUILD_UTILITIES) add_definitions(-DLIBARCHIVE_STATIC) set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle") set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL") + set(ENABLE_LZMA ON CACHE INTERNAL "Enable the use of the system found LZMA library if found") + set(ENABLE_ZLIB ON CACHE INTERNAL "Enable the use of the system found ZLIB library if found") + set(ENABLE_BZip2 ON CACHE INTERNAL "Enable the use of the system found BZip2 library if found") + set(ENABLE_EXPAT OFF CACHE INTERNAL "Enable the use of the system found EXPAT library if found") + set(ENABLE_PCREPOSIX OFF CACHE INTERNAL "Enable the use of the system found PCREPOSIX library if found") + set(ENABLE_LibGCC OFF CACHE INTERNAL "Enable the use of the system found LibGCC library if found") set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support") set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support") set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support") @@ -350,6 +379,25 @@ macro (CMAKE_BUILD_UTILITIES) CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty") endif() + #--------------------------------------------------------------------- + # Build jsoncpp library. + if(CMAKE_USE_SYSTEM_JSONCPP) + if(NOT CMAKE_VERSION VERSION_LESS 3.0) + include(${CMake_SOURCE_DIR}/Source/Modules/FindJsonCpp.cmake) + else() + message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP requires CMake >= 3.0") + endif() + if(NOT JsonCpp_FOUND) + message(FATAL_ERROR + "CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!") + endif() + set(CMAKE_JSONCPP_LIBRARIES JsonCpp::JsonCpp) + else() + set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp) + add_subdirectory(Utilities/cmjsoncpp) + CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty") + endif() + #--------------------------------------------------------------------- # Build XMLRPC library for CMake and CTest. if(CTEST_USE_XMLRPC) @@ -366,7 +414,7 @@ macro (CMAKE_BUILD_UTILITIES) # Use curses? if (UNIX) # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex - if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) + if(NOT CMAKE_SYSTEM_NAME MATCHES syllable) set(CURSES_NEED_NCURSES TRUE) find_package(Curses QUIET) if (CURSES_LIBRARY) @@ -382,23 +430,29 @@ macro (CMAKE_BUILD_UTILITIES) set(BUILD_CursesDialog 0) endif () if(BUILD_CursesDialog) - add_subdirectory(Source/CursesDialog/form) + if(NOT CMAKE_USE_SYSTEM_FORM) + add_subdirectory(Source/CursesDialog/form) + elseif(NOT CURSES_FORM_LIBRARY) + message( FATAL_ERROR "CMAKE_USE_SYSTEM_FORM in ON but CURSES_FORM_LIBRARY is not set!" ) + endif() endif() endmacro () #----------------------------------------------------------------------- -if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") - execute_process(COMMAND ${CMAKE_CXX_COMPILER} - ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE _GXX_VERSION - ) - string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" - _GXX_VERSION_SHORT ${_GXX_VERSION}) - if(_GXX_VERSION_SHORT EQUAL 33) - message(FATAL_ERROR - "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n" - "Please use GXX 4.2 or greater to build CMake on OpenBSD\n" - "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}") +if(NOT CMake_TEST_EXTERNAL_CMAKE) + if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") + execute_process(COMMAND ${CMAKE_CXX_COMPILER} + ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _GXX_VERSION + ) + string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" + _GXX_VERSION_SHORT ${_GXX_VERSION}) + if(_GXX_VERSION_SHORT EQUAL 33) + message(FATAL_ERROR + "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n" + "Please use GXX 4.2 or greater to build CMake on OpenBSD\n" + "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}") + endif() endif() endif() @@ -417,35 +471,37 @@ include (${CMAKE_ROOT}/Modules/Dart.cmake) set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake") -# where to write the resulting executables and libraries -set(BUILD_SHARED_LIBS OFF) -set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") -set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL - "Where to put the libraries for CMake") +if(NOT CMake_TEST_EXTERNAL_CMAKE) + # where to write the resulting executables and libraries + set(BUILD_SHARED_LIBS OFF) + set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") + set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL + "Where to put the libraries for CMake") -# The CMake executables usually do not need any rpath to run in the build or -# install tree. -set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") + # The CMake executables usually do not need any rpath to run in the build or + # install tree. + set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") -# Load install destinations. -include(Source/CMakeInstallDestinations.cmake) + # Load install destinations. + include(Source/CMakeInstallDestinations.cmake) -if(BUILD_TESTING) - include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) -endif() + if(BUILD_TESTING) + include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) + endif() -# include special compile flags for some compilers -include(CompileFlags.cmake) + # 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) + # 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() # CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests. # # If not defined or "", this variable defaults to the server at -# http://www.cdash.org/CDash. +# "http://open.cdash.org". # # If set explicitly to "NOTFOUND", curl tests and ctest tests that use # the network are skipped. @@ -456,136 +512,146 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) # should be run first. # if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") - set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash") + set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org") endif() -# build the utilities (a macro defined in this file) -CMAKE_BUILD_UTILITIES() - -# 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, -# 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 -# generating the documentation. -if(BUILD_CursesDialog) - get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH) - 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") - set(CURSES_NEED_RPATH TRUE) - endif() -endif() +# Create the KWIML library for CMake. +set(KWIML cmIML) +set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) +add_subdirectory(Utilities/KWIML) -if(BUILD_QtDialog) - if(APPLE) - set(CMAKE_BUNDLE_VERSION - "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") - set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") - # make sure CMAKE_INSTALL_PREFIX ends in / - string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) - math(EXPR LEN "${LEN} -1" ) - string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) - if(NOT "${ENDCH}" STREQUAL "/") - set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") +if(NOT CMake_TEST_EXTERNAL_CMAKE) + # build the utilities (a macro defined in this file) + CMAKE_BUILD_UTILITIES() + + # 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, + # 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 + # generating the documentation. + if(BUILD_CursesDialog) + get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH) + 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") + set(CURSES_NEED_RPATH TRUE) endif() - set(CMAKE_INSTALL_PREFIX - "${CMAKE_INSTALL_PREFIX}CMake.app/Contents") endif() - set(QT_NEED_RPATH FALSE) - 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) + if(BUILD_QtDialog) + if(APPLE) + set(CMAKE_BUNDLE_VERSION + "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") + set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") + # make sure CMAKE_INSTALL_PREFIX ends in / + string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) + math(EXPR LEN "${LEN} -1" ) + string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) + if(NOT "${ENDCH}" STREQUAL "/") + set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") + endif() + set(CMAKE_INSTALL_PREFIX + "${CMAKE_INSTALL_PREFIX}CMake.app/Contents") + endif() + + set(QT_NEED_RPATH FALSE) + 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) + endif() endif() -endif() -# 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, -# 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 build tree, which is both the build and the install RPATH. -if (UNIX) - 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) - set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - endif() -endif () + # 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, + # 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 build tree, which is both the build and the install RPATH. + if (UNIX) + 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) + set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + endif() + endif () -# add the uninstall support -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - @ONLY) -add_custom_target(uninstall - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + # add the uninstall support + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + @ONLY) + add_custom_target(uninstall + "${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) CMAKE_SETUP_TESTING() -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in" - "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf" - COPYONLY) - -if(NOT CMake_VERSION_IS_RELEASE) - if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND - NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2) - set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts - -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security - -Wmissing-format-attribute -fno-common -Wundef - ) - set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W - -Wshadow -Wpointer-arith -Wformat-security -Wundef - ) - foreach(FLAG_LANG C CXX) - foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST}) - if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ") - set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}") - endif() +if(NOT CMake_TEST_EXTERNAL_CMAKE) + if(NOT CMake_VERSION_IS_RELEASE) + if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND + NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2) + set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts + -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security + -Wmissing-format-attribute -fno-common -Wundef + ) + set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W + -Wshadow -Wpointer-arith -Wformat-security -Wundef + ) + + foreach(FLAG_LANG C CXX) + foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST}) + if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ") + set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}") + endif() + endforeach() endforeach() - endforeach() - unset(C_FLAGS_LIST) - unset(CXX_FLAGS_LIST) + unset(C_FLAGS_LIST) + unset(CXX_FLAGS_LIST) + endif() endif() + + # build the remaining subdirectories + add_subdirectory(Source) + add_subdirectory(Utilities) endif() -# build the remaining subdirectories -add_subdirectory(Source) -add_subdirectory(Utilities) add_subdirectory(Tests) -if(BUILD_TESTING) - CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests") -endif() -CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat") -if(TARGET documentation) - CMAKE_SET_TARGET_FOLDER(documentation "Documentation") +if(NOT CMake_TEST_EXTERNAL_CMAKE) + if(BUILD_TESTING) + CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests") + endif() + if(TARGET documentation) + CMAKE_SET_TARGET_FOLDER(documentation "Documentation") + endif() endif() # add a test add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" - --system-information -G "${CMAKE_TEST_GENERATOR}" ) - -# Install license file as it requires. -install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}) - -# Install script directories. -install( - DIRECTORY Help Modules Templates - DESTINATION ${CMAKE_DATA_DIR} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) - -# Install auxiliary files integrating with other tools. -add_subdirectory(Auxiliary) + --system-information -G "${CMAKE_GENERATOR}" ) + +if(NOT CMake_TEST_EXTERNAL_CMAKE) + # Install license file as it requires. + install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}) + + # Install script directories. + install( + DIRECTORY Help Modules Templates + DESTINATION ${CMAKE_DATA_DIR} + FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + ) + + # Install auxiliary files integrating with other tools. + add_subdirectory(Auxiliary) +endif() diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 92eacd8e3..df2f94c2a 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -13,13 +13,8 @@ set(CTEST_PROJECT_NAME "CMake") set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=CMake") set(CTEST_DROP_SITE_CDASH TRUE) set(CTEST_CDASH_VERSION "1.6") 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") diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index eb0b2f695..f499be1d9 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -19,6 +19,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "Utilities.cmbzip2." "Source.CTest.Curl" "Source.CursesDialog.form" + "Source.cm_sha2.*warning.*cast increases required alignment of target type" "Utilities.cmcurl" "Utilities.cmexpat." "Utilities.cmlibarchive" @@ -39,12 +40,14 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*" "Warning: public.*_archive.*clashes with prior module.*" "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.*" "stl_deque.h:1051" "(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)" - "(Lexer|Parser).*warning.*statement is unreachable" + "(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)" "PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c" - "[Qq]t([Cc]ore|[Gg]ui).*warning.*conversion.*may alter its value" + "[Qq]t([Cc]ore|[Gg]ui|[Ww]idgets).*warning.*conversion.*may alter its value" "warning:.*is.*very unsafe.*consider using.*" "warning:.*is.*misused, please use.*" "CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element" @@ -52,6 +55,9 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "ld: warning: directory not found for option .-(F|L)" "warning.*This version of Mac OS X is unsupported" "clang.*: warning: argument unused during compilation: .-g" + "note: in expansion of macro" # diagnostic context note + "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto + "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto # Ignore clang's summary warning, assuming prior text has matched some # other warning expression: diff --git a/CTestCustom.ctest.in b/CTestCustom.ctest.in deleted file mode 100644 index 6127843f6..000000000 --- a/CTestCustom.ctest.in +++ /dev/null @@ -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") diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 587403178..3c053fae0 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -16,11 +16,8 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 7") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) endif() -if(CMAKE_GENERATOR MATCHES "Visual Studio 6") - set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif() -if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") +if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel") set(_INTEL_WINDOWS 1) endif() @@ -34,20 +31,20 @@ else() endif() #silence duplicate symbol warnings on AIX -if(CMAKE_SYSTEM MATCHES "AIX.*") +if(CMAKE_SYSTEM_NAME MATCHES "AIX") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") endif() endif() -if(CMAKE_SYSTEM MATCHES "IRIX.*") +if(CMAKE_SYSTEM_NAME MATCHES "IRIX") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") endif() endif() -if(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") endif() @@ -65,6 +62,24 @@ if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP") endif() endif() +# Workaround for short jump tables on PA-RISC +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") + if(CMAKE_COMPILER_IS_GNUC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-calls") + endif() + if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-calls") + endif() +endif() + +if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") + endif() +endif() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") @@ -73,11 +88,3 @@ endif () if (CMAKE_ANSI_CFLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") endif () - -# avoid binutils problem with large binaries, e.g. when building CMake in debug mode -# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230 -if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*") -endif () - -include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) diff --git a/Copyright.txt b/Copyright.txt index 214d7dea8..6c9fb0934 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -1,5 +1,5 @@ CMake - Cross Platform Makefile Generator -Copyright 2000-2014 Kitware, Inc. +Copyright 2000-2015 Kitware, Inc. Copyright 2000-2011 Insight Software Consortium All rights reserved. diff --git a/DartConfig.cmake b/DartConfig.cmake index 37f66c7c1..92dffca7a 100644 --- a/DartConfig.cmake +++ b/DartConfig.cmake @@ -13,6 +13,6 @@ set(CTEST_PROJECT_NAME "CMake") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=CMake") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/DartLocal.conf.in b/DartLocal.conf.in deleted file mode 100644 index e28cb187f..000000000 --- a/DartLocal.conf.in +++ /dev/null @@ -1,121 +0,0 @@ -ExpectedBuilds: \ -{andoria.kitware Linux-g++3.4-KDevelop} \ -{andoria.kitware Linux-g++3.4-SVN} \ -{DASH1.kitware Win32-nmake71} \ -{DASH1.kitware Win32-vs71} \ -{DASH1.kitware Win32-vs71Rel} \ -{DASH1.kitware zRel24-Win32-nmake71} \ -{DASH1.kitware zRel24-Win32-vs71} \ -{DASH11.kitware zRel24-Win32-nmake71} \ -{dash14.kitware Win32-bcc5.6} \ -{dash14.kitware Win32-cygwin} \ -{dash14.kitware Win32-mingw} \ -{dash14.kitware zRel24-Win32-bcc5.6} \ -{dash17.kitware Linux-g++4.0} \ -{dash1win64.kitware Win64-vs80} \ -{dash1win98.kitware Win32-vs60} \ -{DASH2.kitware Win32-nmake70} \ -{DASH2.kitware Win32-vs70} \ -{DASH2.kitware Win32-vs70-InPlace} \ -{DASH2.kitware zRel24-Win32-nmake70} \ -{DASH2.kitware zRel24-Win32-vs70} \ -{DASH3.kitware Win32-nmake60} \ -{DASH3.kitware Win32-vs60} \ -{DASH3.kitware zRel24-Win32-nmake60} \ -{DASH3.kitware zRel24-Win32-vs60} \ -{dash4.kitware Win32-bcc5.8} \ -{DASH5.kitware Linux-gcc332-InPlace} \ -{DASH5.kitware zRel24-Linix-gcc332} \ -{DASH6.kitware zRel24-Linix-gcc332} \ -{dash8.kitware Linux64-g++} \ -{dash8.kitware Linux64-g++332} \ -{dash8.kitware Linux64-g++341} \ -{dash8.kitware zRel24-Linux64-g++} \ -{dash8.kitware zRel24-Linux64-g++332} \ -{dashmacmini1.kitware Darwin-Tiger-Xcode21} \ -{dashmacmini1.kitware zRel24-Darwin-Tiger-g++} \ -{dashmacmini2.kitware DarwinIntel-g++} \ -{dashmacmini2.kitware DarwinIntel-Universal} \ -{dashmacmini2.kitware Darwin-Tiger-Xcode21-univ} \ -{dashmacmini3.kitware Darwin-LeopardIntel-g++} \ -{dashmacmini3.kitware Darwin-LeopardIntel-Universal} \ -{dashmacmini3.kitware Darwin-Leopard-Xcode21-univ} \ -{dashsgi1.kitware IRIX32-CC} \ -{dashsgi1.kitware IRIX64-CC} \ -{dashsun1.kitware SunOS-CC} \ -{dashsun1.kitware SunOS-CC-64} \ -{dashsun1.kitware SunOS-gcc34-64} \ -{destiny.kitware HP-UX-aCC} \ -{destiny.kitware HP-UX-aCC-gmake} \ -{devqnx.acfr.usyd.edu.au qnx-V3.3.5-gcc_ntox86} \ -{grayson.kitware Win32-nmake80} \ -{heart HP-UXia64-aCC} \ -{hythloth.kitware Linux64-bullseye-cov} \ -{hythloth.kitware Linux64-suncc-5.9} \ -{hythloth.kitware Linux-nightly-win32-release} \ -{insight.journal.kitware KWStyle} \ -{iris.elemtech IRIX64-CC64-7.4} \ -{iris.elemtech IRIX64-CC-7.4} \ -{JET.kitware Linux-valgrind2} \ -{krondor.kitware Darwin-c++} \ -{krondor.kitware zRel24-Darwin-c++} \ -{midworld.kitware DarwinG5-g++} \ -{midworld.kitware DarwinG5-XCode15} \ -{midworld.kitware zRel24-DarwinG5-g++} \ -{pre.vision.cs.rpi.edu FreeBSD-CC-gmake} \ -{pre.vision.cs.rpi.edu FreeBSD-CC-make} \ -{RogueResearch3 Mac10.5-CMake-gcc-dbg-ppc} \ -{RogueResearch3 Mac10.5-CMake-gcc-dbg-ppc64} \ -{RogueResearch3 Mac10.5-CMake-gcc-rel-ppc} \ -{RogueResearch3 Mac10.5-CMake-gcc-rel-ppc64} \ -{RogueResearch3 Mac10.5-CMake-Xcode-dbg-ppc} \ -{RogueResearch3 Mac10.5-CMake-Xcode-dbg-ppc64} \ -{RogueResearch4 Mac10.5-CMake-gcc-dbg-i386} \ -{RogueResearch4 Mac10.5-CMake-gcc-dbg-rosetta} \ -{RogueResearch4 Mac10.5-CMake-gcc-rel-i386} \ -{tick.rz.uni-augsburg.de LinuxPPC-g++3.3} \ -{tick.rz.uni-augsburg.de LinuxPPC-g++3.4} \ -{trinsic.kitware Win32-mingw} \ -{r06n01.pbm.ihost.com AIX53-xlC} \ -{r06n01.pbm.ihost.com zRel24-AIX53-xlC} \ -{valhalla.kitware Win32-wcl386} - -#{devqnx.acfr.usyd.edu.au qnx-V3.3.5-gcc_ntox86 } \ -#{mr-orange.obtech.net gentoo-linux-x86\_64-gcc-4.0.2 } \ -#{G5.Nfsnet.Org Darwin8.3-gcc4} \ - -# commas in names do not work for expected builds.... - -#{G4.Nfsnet.Org Darwin-c++} \ -#{salmon.nlm.nih.gov Darwin8.7-gcc4} \ - -#{crd.ge.com Solaris-gcc343} \ -#{crd.ge.com Linux-icc81} \ -#{crd.ge.com Windows-bcc32} \ -#{crd.ge.com Windows-nmake71} \ -#{crd.ge.com Windows-nmake60} \ - -#{dash16.kitware Linux-g++4.0} \ -#{styx Linuxia64-g++} \ -#{crd.ge.com Cygwin-gcc344} \ -#{valhalla.kitware Win32-bccRel} \ -#{valhalla.kitware Win32-bcc} \ -#{valhalla.kitware Win32-g++} \ -#{valhalla.kitware Win32-nmake60} \ -#{valhalla.kitware Win32-nmake70} \ -#{valhalla.kitware Win32-vs60} \ -#{valhalla.kitware Win32-vs70} -#{crd.ge.com FreeBSD-gcc321} \ -#{crd.ge.com Linux-gcc320} \ - -#{cogattaca.kitware LinuxWin32-g++-Werror} \ -#{cogattaca.kitware LinuxWin32-g++} \ - -#{dash8.kitware Win64-icl80} \ -#{dash8.kitware zLRB-Win64-icl80} \ - -#{hythloth.kitware Linux-icc-8.1} \ - -CompressionMode: ALL -CompressionCommand: /bin/gzip -CompressionType: gzip diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst index 5d71e1124..3fe2a3330 100644 --- a/Help/command/add_compile_options.rst +++ b/Help/command/add_compile_options.rst @@ -7,14 +7,15 @@ Adds options to the compilation of source files. add_compile_options(