diff -Nru cmake-3.4.1/Auxiliary/cmake-mode.el cmake-3.5.0/Auxiliary/cmake-mode.el --- cmake-3.4.1/Auxiliary/cmake-mode.el 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Auxiliary/cmake-mode.el 2016-03-08 14:36:21.000000000 +0000 @@ -177,7 +177,7 @@ (interactive) (save-excursion (goto-char (point-min)) - (while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t) + (while (re-search-forward "^\\([ \t]*\\)\\_<\\(\\(?:\\w\\|\\s_\\)+\\)\\_>\\([ \t]*(\\)" nil t) (replace-match (concat (match-string 1) diff -Nru cmake-3.4.1/bootstrap cmake-3.5.0/bootstrap --- cmake-3.4.1/bootstrap 2015-12-02 15:43:25.000000000 +0000 +++ cmake-3.5.0/bootstrap 2016-03-08 14:36:25.000000000 +0000 @@ -63,9 +63,11 @@ cmake_data_dir_keyword="OTHER" cmake_doc_dir_keyword="OTHER" cmake_man_dir_keyword="OTHER" +cmake_xdgdata_dir_keyword="OTHER" cmake_data_dir="" cmake_doc_dir="" cmake_man_dir="" +cmake_xdgdata_dir="" cmake_init_file="" cmake_bootstrap_system_libs="" cmake_bootstrap_qt_gui="" @@ -214,6 +216,7 @@ cmake_data_dir_default="`cmake_install_dest_default DATA ${cmake_data_dir_keyword}`" cmake_doc_dir_default="`cmake_install_dest_default DOC ${cmake_doc_dir_keyword}`" cmake_man_dir_default="`cmake_install_dest_default MAN ${cmake_man_dir_keyword}`" +cmake_xdgdata_dir_default="`cmake_install_dest_default XDGDATA ${cmake_xdgdata_dir_keyword}`" CMAKE_KNOWN_C_COMPILERS="cc gcc xlc icc tcc" CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ c++ icc como " @@ -259,8 +262,8 @@ cmPropertyMap \ cmPropertyDefinition \ cmPropertyDefinitionMap \ - cmMakeDepend \ cmMakefile \ + cmExportBuildFileGenerator \ cmExportFileGenerator \ cmExportInstallFileGenerator \ cmExportTryCompileFileGenerator \ @@ -373,11 +376,6 @@ SystemTools.hxx \ Terminal.h" -KWIML_FILES=' - ABI.h - INT.h -' - # Display CMake bootstrap usage cmake_usage() { @@ -406,6 +404,8 @@ --no-system-zlib use cmake-provided zlib library (default) --system-bzip2 use system-installed bzip2 library --no-system-bzip2 use cmake-provided bzip2 library (default) + --system-liblzma use system-installed liblzma library + --no-system-liblzma use cmake-provided liblzma library (default) --system-libarchive use system-installed libarchive library --no-system-libarchive use cmake-provided libarchive library (default) @@ -428,6 +428,8 @@ ['"${cmake_doc_dir_default}"'] --mandir=DIR install man pages files in PREFIX/DIR/manN ['"${cmake_man_dir_default}"'] + --xdgdatadir=DIR install XDG specific files in PREFIX/DIR + ['"${cmake_xdgdata_dir_default}"'] ' exit 10 } @@ -455,6 +457,18 @@ exit ${res} } +cmake_generate_file () +{ + OUTFILE="$1" + CONTENT="$2" + echo "$CONTENT" > "$OUTFILE.tmp" + if "${_diff}" "$OUTFILE.tmp" "$OUTFILE" > /dev/null 2> /dev/null ; then + rm -f "$OUTFILE.tmp" + else + mv -f "$OUTFILE.tmp" "$OUTFILE" + fi +} + # Replace KWSYS_NAMESPACE with cmsys cmake_replace_string () { @@ -493,7 +507,7 @@ s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g; s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g; s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g; - s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}${_tmp}" + }" >> "${OUTFILE}${_tmp}" if [ -f "${OUTFILE}${_tmp}" ]; then if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then #echo "Files are the same" @@ -572,7 +586,7 @@ echo "Test produced non-zero return code" return 3 fi - echo "Test succeded" + echo "Test succeeded" return 0 } @@ -616,13 +630,14 @@ --datadir=*) cmake_data_dir=`cmake_arg "$1"` ;; --docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;; --mandir=*) cmake_man_dir=`cmake_arg "$1"` ;; + --xdgdatadir=*) cmake_xdgdata_dir=`cmake_arg "$1"` ;; --init=*) cmake_init_file=`cmake_arg "$1"` ;; --system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;; --no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;; - --system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-zlib) + --system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-zlib|--system-liblzma) lib=`cmake_arg "$1" "--system-"` cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;; - --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-zlib) + --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-zlib|--no-system-liblzma) lib=`cmake_arg "$1" "--no-system-"` cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;; --qt-gui) cmake_bootstrap_qt_gui="1" ;; @@ -702,18 +717,6 @@ cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys" fi -for a in stl ios; do - [ -d "cmsys/${a}" ] || mkdir "cmsys/${a}" - if [ ! -d "cmsys/${a}" ]; then - cmake_error 5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}" - fi -done - -[ -d "cmIML" ] || mkdir "cmIML" -if [ ! -d "cmIML" ]; then - cmake_error 12 "Cannot create directory ${cmake_bootstrap_dir}/cmIML" -fi - # Delete all the bootstrap files rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log" rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}" @@ -1173,7 +1176,6 @@ KWSYS_BUILD_SHARED=0 KWSYS_LFS_AVAILABLE=0 KWSYS_LFS_REQUESTED=0 -KWSYS_STAT_HAS_ST_MTIM=0 KWSYS_STL_HAS_WSTRING=0 KWSYS_CXX_HAS_SETENV=0 KWSYS_CXX_HAS_UNSETENV=0 @@ -1217,15 +1219,6 @@ echo "${cmake_cxx_compiler} does not have stl wstring" fi -if cmake_try_run "${cmake_cxx_compiler}" \ - "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \ - "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then - KWSYS_STAT_HAS_ST_MTIM=1 - echo "${cmake_cxx_compiler} has struct stat with st_mtim member" -else - echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member" -fi - # Just to be safe, let us store compiler and flags to the header file cmake_bootstrap_version='$Revision$' @@ -1297,10 +1290,7 @@ "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys done -for a in ${KWIML_FILES}; do - cmake_replace_string "${cmake_source_dir}/Utilities/KWIML/${a}.in" \ - "${cmake_bootstrap_dir}/cmIML/${a}" KWIML cmIML -done +cmake_generate_file "${cmake_bootstrap_dir}/cmThirdParty.h" "" # Generate Makefile dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h" @@ -1343,9 +1333,9 @@ -DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES} " cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ - -I`cmake_escape \"${cmake_bootstrap_dir}\"`" + -I`cmake_escape \"${cmake_source_dir}/Utilities\"`" cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ - -I`cmake_escape \"${cmake_bootstrap_dir}\"`" + -I`cmake_escape \"${cmake_source_dir}/Utilities\"`" echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile" echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile" for a in ${CMAKE_CXX_SOURCES}; do @@ -1385,6 +1375,7 @@ set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE) set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE) set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE) +set (CMAKE_XDGDATA_DIR "'"${cmake_xdgdata_dir}"'" CACHE PATH "Install location for XDG specific files (relative to prefix)." FORCE) ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" # Add configuration settings given as command-line options. diff -Nru cmake-3.4.1/CMakeCPack.cmake cmake-3.5.0/CMakeCPack.cmake --- cmake-3.4.1/CMakeCPack.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/CMakeCPack.cmake 2016-03-08 14:36:21.000000000 +0000 @@ -198,6 +198,17 @@ set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991") + if(MSVC AND NOT "$ENV{WIX}" STREQUAL "") + set(WIX_CUSTOM_ACTION_ENABLED TRUE) + if(CMAKE_CONFIGURATION_TYPES) + set(WIX_CUSTOM_ACTION_MULTI_CONFIG TRUE) + else() + set(WIX_CUSTOM_ACTION_MULTI_CONFIG FALSE) + endif() + else() + set(WIX_CUSTOM_ACTION_ENABLED FALSE) + endif() + # Set the options file that needs to be included inside CMakeCPackOptions.cmake set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" diff -Nru cmake-3.4.1/CMakeCPackOptions.cmake.in cmake-3.5.0/CMakeCPackOptions.cmake.in --- cmake-3.4.1/CMakeCPackOptions.cmake.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/CMakeCPackOptions.cmake.in 2016-03-08 14:36:21.000000000 +0000 @@ -183,13 +183,20 @@ endif() endif() +if("${CPACK_GENERATOR}" STREQUAL "DragNDrop") + set(CPACK_DMG_BACKGROUND_IMAGE + "@CMake_SOURCE_DIR@/Packaging/CMakeDMGBackground.tif") + set(CPACK_DMG_DS_STORE_SETUP_SCRIPT + "@CMake_SOURCE_DIR@/Packaging/CMakeDMGSetup.scpt") +endif() + if("${CPACK_GENERATOR}" STREQUAL "WIX") # Reset CPACK_PACKAGE_VERSION to deal with WiX restriction. # But the file names still use the full CMake_VERSION value: set(CPACK_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME}-@CMake_VERSION@-${CPACK_SYSTEM_NAME}") + "cmake-@CMake_VERSION@-${CPACK_SYSTEM_NAME}") set(CPACK_SOURCE_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME}-@CMake_VERSION@-Source") + "cmake-@CMake_VERSION@") if(NOT CPACK_WIX_SIZEOF_VOID_P) set(CPACK_WIX_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@") @@ -227,10 +234,57 @@ set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high") set(CPACK_WIX_UI_BANNER - "@CMake_SOURCE_DIR@/Utilities/Release/cpack_wix_ui_banner.jpg" + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_banner.jpg" ) set(CPACK_WIX_UI_DIALOG - "@CMake_SOURCE_DIR@/Utilities/Release/cpack_wix_ui_dialog.jpg" + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_dialog.jpg" + ) + + set(CPACK_WIX_EXTRA_SOURCES + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/install_dir.wxs" + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_extra_dialog.wxs" + ) + + set(_WIX_CUSTOM_ACTION_ENABLED "@WIX_CUSTOM_ACTION_ENABLED@") + if(_WIX_CUSTOM_ACTION_ENABLED) + list(APPEND CPACK_WIX_EXTRA_SOURCES + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs" + ) + list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dCHECK_NSIS=1) + + set(_WIX_CUSTOM_ACTION_MULTI_CONFIG "@WIX_CUSTOM_ACTION_MULTI_CONFIG@") + if(_WIX_CUSTOM_ACTION_MULTI_CONFIG) + if(CPACK_BUILD_CONFIG) + set(_WIX_CUSTOM_ACTION_CONFIG "${CPACK_BUILD_CONFIG}") + else() + set(_WIX_CUSTOM_ACTION_CONFIG "Release") + endif() + + list(APPEND CPACK_WIX_EXTRA_SOURCES + "@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll-${_WIX_CUSTOM_ACTION_CONFIG}.wxs") + else() + list(APPEND CPACK_WIX_EXTRA_SOURCES + "@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll.wxs") + endif() + endif() + + set(CPACK_WIX_UI_REF "CMakeUI_InstallDir") + + set(CPACK_WIX_PATCH_FILE + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_path_env.xml" + ) + + set(CPACK_WIX_TEMPLATE + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/WIX.template.in" ) + + set(BUILD_QtDialog "@BUILD_QtDialog@") + + if(BUILD_QtDialog) + list(APPEND CPACK_WIX_PATCH_FILE + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_desktop_shortcut.xml" + ) + list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dBUILD_QtDialog=1) + endif() endif() diff -Nru cmake-3.4.1/CMakeLists.txt cmake-3.5.0/CMakeLists.txt --- cmake-3.4.1/CMakeLists.txt 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/CMakeLists.txt 2016-03-08 14:36:21.000000000 +0000 @@ -138,8 +138,13 @@ 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}") + # For now use system KWIML only if explicitly requested rather + # than activating via the general system libs options. + option(CMAKE_USE_SYSTEM_KWIML "Use system-installed KWIML" OFF) + mark_as_advanced(CMAKE_USE_SYSTEM_KWIML) + # Mention to the user what system libraries are being used. - foreach(util ${UTILITIES}) + foreach(util ${UTILITIES} KWIML) if(CMAKE_USE_SYSTEM_${util}) message(STATUS "Using system-installed ${util}") endif() @@ -270,6 +275,20 @@ # (a macro defined in this file) CMAKE_HANDLE_SYSTEM_LIBRARIES() + if(CMAKE_USE_SYSTEM_KWIML) + find_package(KWIML 1.0) + if(NOT KWIML_FOUND) + message(FATAL_ERROR "CMAKE_USE_SYSTEM_KWIML is ON but KWIML is not found!") + endif() + set(CMake_KWIML_LIBRARIES kwiml::kwiml) + else() + set(CMake_KWIML_LIBRARIES "") + if(BUILD_TESTING) + set(KWIML_TEST_ENABLE 1) + endif() + add_subdirectory(Utilities/KWIML) + endif() + #--------------------------------------------------------------------- # Build zlib library for Curl, CMake, and CTest. set(CMAKE_ZLIB_HEADER "cm_zlib.h") @@ -372,12 +391,14 @@ 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_LIBXML2 OFF CACHE INTERNAL "Enable the use of the system found libxml2 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") + set(ENABLE_CNG OFF CACHE INTERNAL "Enable the use of CNG(Crypto Next Generation)") add_subdirectory(Utilities/cmlibarchive) CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) @@ -536,10 +557,10 @@ set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org") endif() -# Create the KWIML library for CMake. -set(KWIML cmIML) -set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) -add_subdirectory(Utilities/KWIML) +if(CMake_TEST_EXTERNAL_CMAKE) + set(KWIML_TEST_ENABLE 1) + add_subdirectory(Utilities/KWIML) +endif() if(NOT CMake_TEST_EXTERNAL_CMAKE) # build the utilities (a macro defined in this file) diff -Nru cmake-3.4.1/Copyright.txt cmake-3.5.0/Copyright.txt --- cmake-3.4.1/Copyright.txt 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Copyright.txt 2016-03-08 14:36:21.000000000 +0000 @@ -1,5 +1,5 @@ CMake - Cross Platform Makefile Generator -Copyright 2000-2015 Kitware, Inc. +Copyright 2000-2016 Kitware, Inc. Copyright 2000-2011 Insight Software Consortium All rights reserved. diff -Nru cmake-3.4.1/CTestCustom.cmake.in cmake-3.5.0/CTestCustom.cmake.in --- cmake-3.4.1/CTestCustom.cmake.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/CTestCustom.cmake.in 2016-03-08 14:36:21.000000000 +0000 @@ -21,7 +21,8 @@ "Utilities.cmcurl" "Utilities.cmexpat." "Utilities.cmlibarchive" - "/usr/include.*warning.*shadowed declaration is here" + "warning: declaration of .single. shadows a global declaration" + "/usr/include.*(warning|note).*shadowed declaration is here" "/usr/bin/ld.*warning.*-..*directory.name.*bin.*does not exist" "Redeclaration of .send..... with a different storage class specifier" "is not used for resolving any symbol" @@ -36,7 +37,7 @@ "LINK : warning LNK4089: all references to.*SHELL32.dll.*discarded by /OPT:REF" "LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF" "LINK : warning LNK4089: all references to.*ole32.dll.*discarded by /OPT:REF" - "Warning.*: .*/Utilities/KWIML/test/test_INT_format.h.* # Redundant preprocessing concatenation" + "Warning.*: .*/Utilities/KWIML/test/test_int_format.h.* # Redundant preprocessing concatenation" "Warning: library was too large for page size.*" "Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*" "Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*" diff -Nru cmake-3.4.1/debian/changelog cmake-3.5.0/debian/changelog --- cmake-3.4.1/debian/changelog 2016-03-29 05:00:32.000000000 +0000 +++ cmake-3.5.0/debian/changelog 2016-03-29 05:12:01.000000000 +0000 @@ -1,14 +1,18 @@ -cmake (3.4.1-2.1~aroth~ppa1~16.04.1) xenial; urgency=medium +cmake (3.5.0-1.1~aroth~ppa1~16.04.1) xenial; urgency=medium - * No-change build for wily and xenial + * No-change build for ubuntu - -- Andreas Roth Tue, 29 Mar 2016 06:59:19 +0200 + -- Andreas Roth Tue, 29 Mar 2016 07:09:17 +0200 -cmake (3.4.1-2~ubuntu16.04.1~ppa1) xenial; urgency=medium +cmake (3.5.0-1) unstable; urgency=medium - * No-change backport to xenial + * New upstream release. + - Fixes fltk_wrap_ui segmentation fault. (Closes: #809535) + * Pass correct buildsystem to dh_auto_test, fixes FTBFS. (Closes: #818040) + * Change Vcs-* and Homepage to https URLs. + * Migrate to dbgsym debug package. - -- Nathan Osman Wed, 10 Feb 2016 20:34:06 -0800 + -- Felix Geyer Sun, 13 Mar 2016 15:16:37 +0100 cmake (3.4.1-2) unstable; urgency=medium diff -Nru cmake-3.4.1/debian/control cmake-3.5.0/debian/control --- cmake-3.4.1/debian/control 2015-12-14 20:41:00.000000000 +0000 +++ cmake-3.5.0/debian/control 2016-03-13 14:16:02.000000000 +0000 @@ -5,7 +5,7 @@ Uploaders: Lisandro Damián Nicanor Pérez Meyer , Felix Geyer , Mario Lang -Build-Depends: debhelper (>= 9.20141010~), +Build-Depends: debhelper (>= 9.20160114~), dpkg-dev (>= 1.17.14~), libarchive-dev (>= 2.8.0), libbz2-dev, @@ -19,9 +19,9 @@ qtbase5-dev , zlib1g-dev Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/pkg-cmake/cmake.git -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-cmake/cmake.git/ -Homepage: http://cmake.org/ +Vcs-Git: https://anonscm.debian.org/git/pkg-cmake/cmake.git +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-cmake/cmake.git/ +Homepage: https://cmake.org/ Package: cmake Architecture: any @@ -111,17 +111,3 @@ . This package provides additional documentation in various formats like HTML or plain text. - -Package: cmake-dbg -Architecture: any -Section: debug -Priority: extra -Pre-Depends: dpkg (>= 1.17.5~) -Depends: cmake (= ${binary:Version}), ${misc:Depends} -Description: debugging symbols for CMake - CMake is used to control the software compilation process using simple - platform and compiler independent configuration files. CMake generates native - makefiles and workspaces that can be used in the compiler environment of your - choice. - . - This package provides CMake debugging symbols. diff -Nru cmake-3.4.1/debian/patches/FindBoost_add_-lpthread_#563479.diff cmake-3.5.0/debian/patches/FindBoost_add_-lpthread_#563479.diff --- cmake-3.4.1/debian/patches/FindBoost_add_-lpthread_#563479.diff 2015-09-20 18:52:58.000000000 +0000 +++ cmake-3.5.0/debian/patches/FindBoost_add_-lpthread_#563479.diff 2016-03-13 12:48:42.000000000 +0000 @@ -12,7 +12,7 @@ --- cmake.orig/Modules/FindBoost.cmake +++ cmake/Modules/FindBoost.cmake @@ -447,6 +447,22 @@ function(_Boost_GUESS_COMPILER_PREFIX _r - set(${_ret} ${_boost_COMPILER} PARENT_SCOPE) + set(${componentvar} ${_boost_processed_components} PARENT_SCOPE) endfunction() +function(_Boost_consider_adding_pthreads _outvar) diff -Nru cmake-3.4.1/debian/rules cmake-3.5.0/debian/rules --- cmake-3.4.1/debian/rules 2015-09-20 18:53:06.000000000 +0000 +++ cmake-3.5.0/debian/rules 2016-03-13 14:13:07.000000000 +0000 @@ -46,7 +46,7 @@ $(BOOTSTRAP_PARALLEL) --verbose override_dh_auto_test: - HOME="`pwd`/Build" dh_auto_test -- ARGS="-E CTestTestUpload" + HOME="`pwd`/Build" dh_auto_test --buildsystem=cmake -- ARGS="-E CTestTestUpload" override_dh_auto_clean: dh_auto_clean @@ -65,7 +65,10 @@ override_dh_sphinxdoc: dh_sphinxdoc -pcmake-doc +override_dh_strip: + dh_strip --dbgsym-migration='cmake-dbg (<< 3.5.0-1~)' + %: - dh $@ --with=sphinxdoc --parallel --builddirectory=Build --dbg-package=cmake-dbg + dh $@ --with=sphinxdoc --parallel --builddirectory=Build .PHONY: override_dh_auto_configure override_dh_auto_clean diff -Nru cmake-3.4.1/Help/command/add_custom_command.rst cmake-3.5.0/Help/command/add_custom_command.rst --- cmake-3.4.1/Help/command/add_custom_command.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/command/add_custom_command.rst 2016-03-08 14:36:21.000000000 +0000 @@ -178,7 +178,7 @@ :: - add_custom_command(TARGET target + add_custom_command(TARGET PRE_BUILD | PRE_LINK | POST_BUILD COMMAND command1 [ARGS] [args1...] [COMMAND command2 [ARGS] [args2...] ...] @@ -188,7 +188,10 @@ [VERBATIM] [USES_TERMINAL]) This defines a new command that will be associated with building the -specified target. When the command will happen is determined by which +specified ````. The ```` must be defined in the current +directory; targets defined in other directories may not be specified. + +When the command will happen is determined by which of the following is specified: ``PRE_BUILD`` diff -Nru cmake-3.4.1/Help/command/cmake_minimum_required.rst cmake-3.5.0/Help/command/cmake_minimum_required.rst --- cmake-3.4.1/Help/command/cmake_minimum_required.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/command/cmake_minimum_required.rst 2016-03-08 14:36:21.000000000 +0000 @@ -5,7 +5,7 @@ :: - cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]] + cmake_minimum_required(VERSION major.minor[.patch[.tweak]] [FATAL_ERROR]) If the current version of CMake is lower than that required it will diff -Nru cmake-3.4.1/Help/command/cmake_parse_arguments.rst cmake-3.5.0/Help/command/cmake_parse_arguments.rst --- cmake-3.4.1/Help/command/cmake_parse_arguments.rst 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Help/command/cmake_parse_arguments.rst 2016-03-08 14:36:21.000000000 +0000 @@ -0,0 +1,85 @@ +cmake_parse_arguments +--------------------- + +``cmake_parse_arguments`` is intended to be used in macros or functions for +parsing the arguments given to that macro or function. It processes the +arguments and defines a set of variables which hold the values of the +respective options. + +:: + + cmake_parse_arguments( + args...) + + +The ```` argument contains all options for the respective macro, +i.e. keywords which can be used when calling the macro without any value +following, like e.g. the ``OPTIONAL`` keyword of the :command:`install` +command. + +The ```` argument contains all keywords for this macro +which are followed by one value, like e.g. ``DESTINATION`` keyword of the +:command:`install` command. + +The ```` argument contains all keywords for this +macro which can be followed by more than one value, like e.g. the +``TARGETS`` or ``FILES`` keywords of the :command:`install` command. + +.. note:: + + All keywords shall be unique. I.e. every keyword shall only be specified + once in either ````, ```` or + ````. A warning will be emitted if uniqueness is + violated. + +When done, ``cmake_parse_arguments`` will have defined for each of the +keywords listed in ````, ```` and +```` a variable composed of the given ```` +followed by ``"_"`` and the name of the respective keyword. These +variables will then hold the respective value from the argument list. +For the ```` keywords this will be ``TRUE`` or ``FALSE``. + +All remaining arguments are collected in a variable +``_UNPARSED_ARGUMENTS``, this can be checked afterwards to see +whether your macro was called with unrecognized parameters. + +As an example here a ``my_install()`` macro, which takes similar arguments +as the real :command:`install` command: + +.. code-block:: cmake + + function(MY_INSTALL) + set(options OPTIONAL FAST) + set(oneValueArgs DESTINATION RENAME) + set(multiValueArgs TARGETS CONFIGURATIONS) + cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN} ) + + # ... + +Assume ``my_install()`` has been called like this: + +.. code-block:: cmake + + my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) + +After the ``cmake_parse_arguments`` call the macro will have set the +following variables:: + + MY_INSTALL_OPTIONAL = TRUE + MY_INSTALL_FAST = FALSE (was not used in call to my_install) + MY_INSTALL_DESTINATION = "bin" + MY_INSTALL_RENAME = "" (was not used) + MY_INSTALL_TARGETS = "foo;bar" + MY_INSTALL_CONFIGURATIONS = "" (was not used) + MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (nothing expected after "OPTIONAL") + +You can then continue and process these variables. + +Keywords terminate lists of values, e.g. if directly after a +one_value_keyword another recognized keyword follows, this is +interpreted as the beginning of the new option. E.g. +``my_install(TARGETS foo DESTINATION OPTIONAL)`` would result in +``MY_INSTALL_DESTINATION`` set to ``"OPTIONAL"``, but as ``OPTIONAL`` +is a keyword itself ``MY_INSTALL_DESTINATION`` will be empty and +``MY_INSTALL_OPTIONAL`` will therefore be set to ``TRUE``. diff -Nru cmake-3.4.1/Help/command/get_target_property.rst cmake-3.5.0/Help/command/get_target_property.rst --- cmake-3.4.1/Help/command/get_target_property.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/command/get_target_property.rst 2016-03-08 14:36:21.000000000 +0000 @@ -13,6 +13,6 @@ Properties are usually used to control how a target is built, but some query the target instead. This command can get properties for any target so far created. The targets do not need to be in the current -CMakeLists.txt file. +``CMakeLists.txt`` file. See also the more general :command:`get_property` command. diff -Nru cmake-3.4.1/Help/command/if.rst cmake-3.5.0/Help/command/if.rst --- cmake-3.4.1/Help/command/if.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/command/if.rst 2016-03-08 14:36:21.000000000 +0000 @@ -67,9 +67,10 @@ True if the given name is an existing policy (of the form ``CMP``). ``if(TARGET target-name)`` - True if the given name is an existing logical target name such as those - created by the :command:`add_executable`, :command:`add_library`, or - :command:`add_custom_target` commands. + True if the given name is an existing logical target name created + by a call to the :command:`add_executable`, :command:`add_library`, + or :command:`add_custom_target` command that has already been invoked + (in any directory). ``if(TEST test-name)`` True if the given name is an existing test name created by the @@ -80,7 +81,7 @@ only for full paths. ``if(file1 IS_NEWER_THAN file2)`` - True if file1 is newer than file2 or if one of the two files doesn't + True if ``file1`` is newer than ``file2`` or if one of the two files doesn't exist. Behavior is well-defined only for full paths. If the file time stamps are exactly the same, an ``IS_NEWER_THAN`` comparison returns true, so that any dependent build operations will occur in the event diff -Nru cmake-3.4.1/Help/command/install.rst cmake-3.5.0/Help/command/install.rst --- cmake-3.4.1/Help/command/install.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/command/install.rst 2016-03-08 14:36:21.000000000 +0000 @@ -72,12 +72,13 @@ [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE| PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE] [DESTINATION ] - [INCLUDES DESTINATION [ ...]] [PERMISSIONS permissions...] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT ] [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP] - ] [...]) + ] [...] + [INCLUDES DESTINATION [ ...]] + ) The ``TARGETS`` form specifies rules for installing targets from a project. There are five kinds of target files that may be installed: @@ -97,11 +98,7 @@ If none is given the installation properties apply to all target types. If only one is given then only targets of that type will be installed (which can be used to install just a DLL or just an import -library). The ``INCLUDES DESTINATION`` specifies a list of directories -which will be added to the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` -target property of the ```` when exported by the -:command:`install(EXPORT)` command. If a relative path is -specified, it is treated as relative to the ``$``. +library). The ``PRIVATE_HEADER``, ``PUBLIC_HEADER``, and ``RESOURCE`` arguments cause subsequent properties to be applied to installing a ``FRAMEWORK`` @@ -131,6 +128,14 @@ :prop_tgt:`SOVERSION` target properties for details on creating versioned shared libraries. +The ``INCLUDES DESTINATION`` specifies a list of directories +which will be added to the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` +target property of the ```` when exported by the +:command:`install(EXPORT)` command. If a relative path is +specified, it is treated as relative to the ``$``. +This is independent of the rest of the argument groups and does +not actually install anything. + One or more groups of properties may be specified in a single call to the ``TARGETS`` form of this command. A target may be installed more than once to different locations. Consider hypothetical targets ``myExe``, @@ -271,9 +276,10 @@ file permissions, the scripts will be given specific permissions, and any ``CVS`` directories will be excluded. -The install destination given to the directory install ``DESTINATION`` may -use "generator expressions" with the syntax ``$<...>``. See the -:manual:`cmake-generator-expressions(7)` manual for available expressions. +The list of ``dirs...`` given to ``DIRECTORY`` and the install destination +given to the directory install ``DESTINATION`` may use "generator expressions" +with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` +manual for available expressions. Custom Installation Logic ^^^^^^^^^^^^^^^^^^^^^^^^^ diff -Nru cmake-3.4.1/Help/manual/cmake.1.rst cmake-3.5.0/Help/manual/cmake.1.rst --- cmake-3.4.1/Help/manual/cmake.1.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake.1.rst 2016-03-08 14:36:21.000000000 +0000 @@ -167,16 +167,23 @@ Change the current working directory and run a command. ``compare_files `` - Check if file1 is same as file2. + Check if ```` is same as ````. If files are the same, + then returns 0, if not itreturns 1. -``copy `` - Copy file to destination (either file or directory). - -``copy_directory `` - Copy directory 'source' content to directory 'destination'. - -``copy_if_different `` - Copy file if input has changed. +``copy ... `` + Copy files to ```` (either file or directory). + If multiple files are specified, the ```` must be + directory and it must exist. + +``copy_directory ... `` + Copy directories to ```` directory. + If ```` directory does not exist it will be created. + +``copy_if_different ... `` + Copy files to ```` (either file or directory) if + they have changed. + If multiple files are specified, the ```` must be + directory and it must exist. ``echo [...]`` Displays arguments as text. @@ -188,19 +195,23 @@ Run command in a modified environment. ``environment`` - Display the current environment. + Display the current environment variables. -``make_directory `` - Create a directory. +``make_directory ...`` + Create ```` directories. If necessary, create parent + directories too. If a directory already exists it will be + silently ignored. -``md5sum [...]`` +``md5sum ...`` Compute md5sum of files. -``remove [-f] [...]`` - Remove the file(s), use ``-f`` to force it. +``remove [-f] ...`` + Remove the file(s), use ``-f`` to force it. If a file does + not exist it will be silently ignored. ``remove_directory `` - Remove a directory and its contents. + Remove a directory and its contents. If a directory does + not exist it will be silently ignored. ``rename `` Rename a file or directory (on one volume). @@ -233,7 +244,8 @@ Touch a file. ``touch_nocreate `` - Touch a file if it exists but do not create it. + Touch a file if it exists but do not create it. If a file does + not exist it will be silently ignored. UNIX-specific Command-Line Tools -------------------------------- diff -Nru cmake-3.4.1/Help/manual/cmake-buildsystem.7.rst cmake-3.5.0/Help/manual/cmake-buildsystem.7.rst --- cmake-3.4.1/Help/manual/cmake-buildsystem.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-buildsystem.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -95,15 +95,18 @@ """""""""""""""" A ``SHARED`` library may be marked with the :prop_tgt:`FRAMEWORK` -target property to create an OS X Framework: +target property to create an OS X or iOS Framework Bundle. +The ``MACOSX_FRAMEWORK_IDENTIFIER`` sets ``CFBundleIdentifier`` key +and it uniquely identifies the bundle. .. code-block:: cmake add_library(MyFramework SHARED MyFramework.cpp) set_target_properties(MyFramework PROPERTIES - FRAMEWORK 1 + FRAMEWORK TRUE FRAMEWORK_VERSION A - ) + MACOSX_FRAMEWORK_IDENTIFIER org.cmake.MyFramework + ) .. _`Object Libraries`: @@ -424,7 +427,7 @@ ) add_library(lib1Version3 SHARED lib1_v3.cpp) - set_property(TARGET lib1Version2 PROPERTY INTERFACE_CONTAINER_SIZE_REQUIRED 1000) + set_property(TARGET lib1Version3 PROPERTY INTERFACE_CONTAINER_SIZE_REQUIRED 1000) add_executable(exe1 exe1.cpp) # CONTAINER_SIZE_REQUIRED will be "200" diff -Nru cmake-3.4.1/Help/manual/cmake-commands.7.rst cmake-3.5.0/Help/manual/cmake-commands.7.rst --- cmake-3.4.1/Help/manual/cmake-commands.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-commands.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -29,6 +29,7 @@ /command/build_command /command/cmake_host_system_information /command/cmake_minimum_required + /command/cmake_parse_arguments /command/cmake_policy /command/configure_file /command/continue diff -Nru cmake-3.4.1/Help/manual/cmake-developer.7.rst cmake-3.5.0/Help/manual/cmake-developer.7.rst --- cmake-3.4.1/Help/manual/cmake-developer.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-developer.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -718,7 +718,7 @@ If False, do not try to use the relevant CMake wrapping command. ``Xxx_Yy_FOUND`` - If False, optional Yy part of Xxx sytem is not available. + If False, optional Yy part of Xxx system is not available. ``Xxx_FOUND`` Set to false, or undefined, if we haven't found, or don't want to use diff -Nru cmake-3.4.1/Help/manual/cmake-modules.7.rst cmake-3.5.0/Help/manual/cmake-modules.7.rst --- cmake-3.4.1/Help/manual/cmake-modules.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-modules.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -213,6 +213,7 @@ /module/FindwxWidgets /module/FindwxWindows /module/FindXCTest + /module/FindXalanC /module/FindXercesC /module/FindX11 /module/FindXMLRPC diff -Nru cmake-3.4.1/Help/manual/cmake-packages.7.rst cmake-3.5.0/Help/manual/cmake-packages.7.rst --- cmake-3.4.1/Help/manual/cmake-packages.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-packages.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -89,7 +89,7 @@ Config-file packages are provided by upstream vendors as part of development packages, that is, they belong with the header files and any other files -provided to assist downsteams in using the package. +provided to assist downstreams in using the package. A set of variables which provide package status information are also set automatically when using a config-file package. The ``_FOUND`` @@ -352,7 +352,7 @@ used to export the targets in the ``ClimbingStatsTargets`` export-set, defined previously by the :command:`install(TARGETS)` command. This command generates the ``ClimbingStatsTargets.cmake`` file to contain :prop_tgt:`IMPORTED` -targets, suitable for use by downsteams and arranges to install it to +targets, suitable for use by downstreams and arranges to install it to ``lib/cmake/ClimbingStats``. The generated ``ClimbingStatsConfigVersion.cmake`` and a ``cmake/ClimbingStatsConfig.cmake`` are installed to the same location, completing the package. @@ -383,7 +383,7 @@ was specified. This causes the ``IMPORTED`` targets to have their :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` populated with the ``include`` directory in the :variable:`CMAKE_INSTALL_PREFIX`. When the ``IMPORTED`` -target is used by downsteam, it automatically consumes the entries from +target is used by downstream, it automatically consumes the entries from that property. Creating a Package Configuration File @@ -412,7 +412,7 @@ target_link_libraries(ClimbingStats PUBLIC Stats::Types) As the ``Stats::Types`` target is a ``PUBLIC`` dependency of ``ClimbingStats``, -downsteams must also find the ``Stats`` package and link to the ``Stats::Types`` +downstreams must also find the ``Stats`` package and link to the ``Stats::Types`` library. The ``Stats`` package should be found in the ``ClimbingStatsConfig.cmake`` file to ensure this. The ``find_dependency`` macro from the :module:`CMakeFindDependencyMacro` helps with this by propagating @@ -464,7 +464,7 @@ The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets definition file which is specific to the build-tree, and is not relocatable. -This can similiarly be used with a suitable package configuration file and +This can similarly be used with a suitable package configuration file and package version file to define a package for the build tree which may be used without installation. Consumers of the build tree can simply ensure that the :variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the diff -Nru cmake-3.4.1/Help/manual/cmake-properties.7.rst cmake-3.5.0/Help/manual/cmake-properties.7.rst --- cmake-3.4.1/Help/manual/cmake-properties.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-properties.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -191,6 +191,7 @@ /prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES /prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG /prop_tgt/INTERPROCEDURAL_OPTIMIZATION + /prop_tgt/IOS_INSTALL_COMBINED /prop_tgt/JOB_POOL_COMPILE /prop_tgt/JOB_POOL_LINK /prop_tgt/LABELS diff -Nru cmake-3.4.1/Help/manual/cmake-toolchains.7.rst cmake-3.5.0/Help/manual/cmake-toolchains.7.rst --- cmake-3.4.1/Help/manual/cmake-toolchains.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-toolchains.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -151,6 +151,36 @@ should be found only on the host and not on the target. This is the purpose of the ``CMAKE_FIND_ROOT_PATH_MODE_*`` variables. +.. _`Cray Cross-Compile`: + +Cross Compiling for the Cray Linux Environment +---------------------------------------------- + +Cross compiling for compute nodes in the Cray Linux Environment can be done +without needing a separate toolchain file. Specifying +``-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment`` on the CMake command line will +ensure that the appropriate build settings and search paths are configured. +The platform will pull its configuration from the current environment +variables and will configure a project to use the compiler wrappers from the +Cray Programming Environment's ``PrgEnv-*`` modules if present and loaded. + +The default configuration of the Cray Programming Environment is to only +support static libraries. This can be overridden and shared libraries +enabled by setting the ``CRAYPE_LINK_TYPE`` environment variable to +``dynamic``. + +Running CMake without specifying :variable:`CMAKE_SYSTEM_NAME` will +run the configure step in host mode assuming a standard Linux environment. +If not overridden, the ``PrgEnv-*`` compiler wrappers will end up getting used, +which if targeting the either the login node or compute node, is likely not the +desired behavior. The exception to this would be if you are building directly +on a NID instead of cross-compiling from a login node. If trying to build +software for a login node, you will need to either first unload the +currently loaded ``PrgEnv-*`` module or explicitly tell CMake to use the +system compilers in ``/usr/bin`` instead of the Cray wrappers. If instead +targeting a compute node is desired, just specify the +:variable:`CMAKE_SYSTEM_NAME` as mentioned above. + Cross Compiling using Clang --------------------------- diff -Nru cmake-3.4.1/Help/manual/cmake-variables.7.rst cmake-3.5.0/Help/manual/cmake-variables.7.rst --- cmake-3.4.1/Help/manual/cmake-variables.7.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/cmake-variables.7.rst 2016-03-08 14:36:21.000000000 +0000 @@ -118,6 +118,7 @@ /variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName /variable/CMAKE_ERROR_DEPRECATED /variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + /variable/CMAKE_EXPORT_COMPILE_COMMANDS /variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY /variable/CMAKE_SYSROOT /variable/CMAKE_FIND_APPBUNDLE @@ -257,6 +258,7 @@ /variable/CMAKE_INSTALL_NAME_DIR /variable/CMAKE_INSTALL_RPATH /variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH + /variable/CMAKE_IOS_INSTALL_COMBINED /variable/CMAKE_LANG_COMPILER_LAUNCHER /variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE /variable/CMAKE_LANG_VISIBILITY_PRESET diff -Nru cmake-3.4.1/Help/manual/OPTIONS_BUILD.txt cmake-3.5.0/Help/manual/OPTIONS_BUILD.txt --- cmake-3.4.1/Help/manual/OPTIONS_BUILD.txt 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/manual/OPTIONS_BUILD.txt 2016-03-08 14:36:21.000000000 +0000 @@ -77,10 +77,47 @@ Suppress developer warnings. Suppress warnings that are meant for the author of the - CMakeLists.txt files. + CMakeLists.txt files. By default this will also turn off + deprecation warnings. ``-Wdev`` Enable developer warnings. Enable warnings that are meant for the author of the CMakeLists.txt - files. + files. By default this will also turn on deprecation warnings. + +``-Werror=dev`` + Make developer warnings errors. + + Make warnings that are meant for the author of the CMakeLists.txt files + errors. By default this will also turn on deprecated warnings as errors. + +``-Wno-error=dev`` + Make developer warnings not errors. + + Make warnings that are meant for the author of the CMakeLists.txt files not + errors. By default this will also turn off deprecated warnings as errors. + +``-Wdeprecated`` + Enable deprecated functionality warnings. + + Enable warnings for usage of deprecated functionality, that are meant + for the author of the CMakeLists.txt files. + +``-Wno-deprecated`` + Suppress deprecated functionality warnings. + + Suppress warnings for usage of deprecated functionality, that are meant + for the author of the CMakeLists.txt files. + +``-Werror=deprecated`` + Make deprecated macro and function warnings errors. + + Make warnings for usage of deprecated macros and functions, that are meant + for the author of the CMakeLists.txt files, errors. + +``-Wno-error=deprecated`` + Make deprecated macro and function warnings not errors. + + Make warnings for usage of deprecated macros and functions, that are meant + for the author of the CMakeLists.txt files, not errors. diff -Nru cmake-3.4.1/Help/module/FindXalanC.rst cmake-3.5.0/Help/module/FindXalanC.rst --- cmake-3.4.1/Help/module/FindXalanC.rst 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Help/module/FindXalanC.rst 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/FindXalanC.cmake diff -Nru cmake-3.4.1/Help/policy/CMP0040.rst cmake-3.5.0/Help/policy/CMP0040.rst --- cmake-3.4.1/Help/policy/CMP0040.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/policy/CMP0040.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,18 +1,21 @@ CMP0040 ------- -The target in the TARGET signature of add_custom_command() must exist. +The target in the ``TARGET`` signature of :command:`add_custom_command` +must exist and must be defined in current directory. CMake 2.8.12 and lower silently ignored a custom command created with -the TARGET signature of :command:`add_custom_command` -if the target is unknown. +the ``TARGET`` signature of :command:`add_custom_command` +if the target is unknown or was defined outside the current directory. -The OLD behavior for this policy is to ignore custom commands -for unknown targets. The NEW behavior for this policy is to report an error -if the target referenced in :command:`add_custom_command` is unknown. +The ``OLD`` behavior for this policy is to ignore custom commands +for unknown targets. The ``NEW`` behavior for this policy is to report +an error if the target referenced in :command:`add_custom_command` is +unknown or was defined outside the current directory. This policy was introduced in CMake version 3.0. CMake version -|release| warns when the policy is not set and uses OLD behavior. Use -the cmake_policy command to set it to OLD or NEW explicitly. +|release| warns when the policy is not set and uses ``OLD`` behavior. +Use the :command:`cmake_policy` command to set it to ``OLD`` or +``NEW`` explicitly. .. include:: DEPRECATED.txt diff -Nru cmake-3.4.1/Help/prop_dir/CLEAN_NO_CUSTOM.rst cmake-3.5.0/Help/prop_dir/CLEAN_NO_CUSTOM.rst --- cmake-3.4.1/Help/prop_dir/CLEAN_NO_CUSTOM.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_dir/CLEAN_NO_CUSTOM.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,7 +1,6 @@ CLEAN_NO_CUSTOM --------------- -Should the output of custom commands be left. - -If this is true then the outputs of custom commands for this directory -will not be removed during the "make clean" stage. +Set to true to tell :ref:`Makefile Generators` not to remove the outputs of +custom commands for this directory during the ``make clean`` operation. +This is ignored on other generators because it is not possible to implement. diff -Nru cmake-3.4.1/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst cmake-3.5.0/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst --- cmake-3.4.1/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,19 +1,23 @@ MACOSX_PACKAGE_LOCATION ----------------------- -Place a source file inside a Mac OS X bundle, CFBundle, or framework. +Place a source file inside a Application Bundle +(:prop_tgt:`MACOSX_BUNDLE`), Core Foundation Bundle (:prop_tgt:`BUNDLE`), +or Framework Bundle (:prop_tgt:`FRAMEWORK`). It is applicable for OS X +and iOS. -Executable targets with the MACOSX_BUNDLE property set are built as -Mac OS X application bundles on Apple platforms. Shared library -targets with the FRAMEWORK property set are built as Mac OS X -frameworks on Apple platforms. Module library targets with the BUNDLE -property set are built as Mac OS X CFBundle bundles on Apple -platforms. Source files listed in the target with this property set -will be copied to a directory inside the bundle or framework content -folder specified by the property value. For bundles the content -folder is ".app/Contents". For frameworks the content folder is -".framework/Versions/". For cfbundles the content -folder is ".bundle/Contents" (unless the extension is changed). -See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target properties -for specifying files meant for Headers, PrivateHeaders, or Resources -directories. +Executable targets with the :prop_tgt:`MACOSX_BUNDLE` property set are +built as OS X or iOS application bundles on Apple platforms. Shared +library targets with the :prop_tgt:`FRAMEWORK` property set are built as +OS X or iOS frameworks on Apple platforms. Module library targets with +the :prop_tgt:`BUNDLE` property set are built as OS X ``CFBundle`` bundles +on Apple platforms. Source files listed in the target with this property +set will be copied to a directory inside the bundle or framework content +folder specified by the property value. For OS X Application Bundles the +content folder is ``.app/Contents``. For OS X Frameworks the +content folder is ``.framework/Versions/``. For OS X +CFBundles the content folder is ``.bundle/Contents`` (unless the +extension is changed). See the :prop_tgt:`PUBLIC_HEADER`, +:prop_tgt:`PRIVATE_HEADER`, and :prop_tgt:`RESOURCE` target properties for +specifying files meant for ``Headers``, ``PrivateHeaders``, or +``Resources`` directories. diff -Nru cmake-3.4.1/Help/prop_tgt/BUNDLE_EXTENSION.rst cmake-3.5.0/Help/prop_tgt/BUNDLE_EXTENSION.rst --- cmake-3.4.1/Help/prop_tgt/BUNDLE_EXTENSION.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/BUNDLE_EXTENSION.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,7 +1,7 @@ BUNDLE_EXTENSION ---------------- -The file extension used to name a BUNDLE target on the Mac. +The file extension used to name a :prop_tgt:`BUNDLE` target on the OS X and iOS. -The default value is "bundle" - you can also use "plugin" or whatever +The default value is ``bundle`` - you can also use ``plugin`` or whatever file extension is required by the host app for your bundle. diff -Nru cmake-3.4.1/Help/prop_tgt/BUNDLE.rst cmake-3.5.0/Help/prop_tgt/BUNDLE.rst --- cmake-3.4.1/Help/prop_tgt/BUNDLE.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/BUNDLE.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,9 +1,9 @@ BUNDLE ------ -This target is a CFBundle on the Mac. +This target is a ``CFBundle`` on the OS X. If a module library target has this property set to true it will be -built as a CFBundle when built on the mac. It will have the directory -structure required for a CFBundle and will be suitable to be used for +built as a ``CFBundle`` when built on the mac. It will have the directory +structure required for a ``CFBundle`` and will be suitable to be used for creating Browser Plugins or other application resources. diff -Nru cmake-3.4.1/Help/prop_tgt/ENABLE_EXPORTS.rst cmake-3.5.0/Help/prop_tgt/ENABLE_EXPORTS.rst --- cmake-3.4.1/Help/prop_tgt/ENABLE_EXPORTS.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/ENABLE_EXPORTS.rst 2016-03-08 14:36:22.000000000 +0000 @@ -12,9 +12,9 @@ For DLL platforms an import library will be created for the exported symbols and then used for linking. All Windows-based systems including Cygwin are DLL platforms. For non-DLL platforms that -require all symbols to be resolved at link time, such as Mac OS X, the +require all symbols to be resolved at link time, such as OS X, the module will "link" to the executable using a flag like -"-bundle_loader". For other non-DLL platforms the link rule is simply +``-bundle_loader``. For other non-DLL platforms the link rule is simply ignored since the dynamic loader will automatically bind symbols when the module is loaded. diff -Nru cmake-3.4.1/Help/prop_tgt/FRAMEWORK.rst cmake-3.5.0/Help/prop_tgt/FRAMEWORK.rst --- cmake-3.4.1/Help/prop_tgt/FRAMEWORK.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/FRAMEWORK.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,11 +1,31 @@ FRAMEWORK --------- -This target is a framework on the Mac. +Build ``SHARED`` library as Framework Bundle on the OS X and iOS. -If a shared library target has this property set to true it will be -built as a framework when built on the mac. It will have the +If a ``SHARED`` library target has this property set to ``TRUE`` it will be +built as a framework when built on the OS X and iOS. It will have the directory structure required for a framework and will be suitable to be used with the ``-framework`` option -See also the :prop_tgt:`FRAMEWORK_VERSION` target property. +To customize ``Info.plist`` file in the framework, use +:prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property. + +For OS X see also the :prop_tgt:`FRAMEWORK_VERSION` target property. + +Example of creation ``dynamicFramework``: + +.. code-block:: cmake + + add_library(dynamicFramework SHARED + dynamicFramework.c + dynamicFramework.h + ) + set_target_properties(dynamicFramework PROPERTIES + FRAMEWORK TRUE + FRAMEWORK_VERSION C + MACOSX_FRAMEWORK_IDENTIFIER com.cmake.dynamicFramework + MACOSX_FRAMEWORK_INFO_PLIST Info.plist + PUBLIC_HEADER dynamicFramework.h + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer" + ) diff -Nru cmake-3.4.1/Help/prop_tgt/FRAMEWORK_VERSION.rst cmake-3.5.0/Help/prop_tgt/FRAMEWORK_VERSION.rst --- cmake-3.4.1/Help/prop_tgt/FRAMEWORK_VERSION.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/FRAMEWORK_VERSION.rst 2016-03-08 14:36:22.000000000 +0000 @@ -3,3 +3,6 @@ Version of a framework created using the :prop_tgt:`FRAMEWORK` target property (e.g. ``A``). + +This property only affects OS X, as iOS doesn't have versioned +directory structure. diff -Nru cmake-3.4.1/Help/prop_tgt/IOS_INSTALL_COMBINED.rst cmake-3.5.0/Help/prop_tgt/IOS_INSTALL_COMBINED.rst --- cmake-3.4.1/Help/prop_tgt/IOS_INSTALL_COMBINED.rst 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/IOS_INSTALL_COMBINED.rst 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,11 @@ +IOS_INSTALL_COMBINED +-------------------- + +Build a combined (device and simulator) target when installing. + +When this property is set to set to false (which is the default) then it will +either be built with the device SDK or the simulator SDK depending on the SDK +set. But if this property is set to true then the target will at install time +also be built for the corresponding SDK and combined into one library. + +This feature requires at least Xcode version 6. diff -Nru cmake-3.4.1/Help/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.rst cmake-3.5.0/Help/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.rst --- cmake-3.4.1/Help/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,10 +1,10 @@ MACOSX_BUNDLE_INFO_PLIST ------------------------ -Specify a custom ``Info.plist`` template for a Mac OS X App Bundle. +Specify a custom ``Info.plist`` template for a OS X and iOS Application Bundle. An executable target with :prop_tgt:`MACOSX_BUNDLE` enabled will be built as an -application bundle on Mac OS X. By default its ``Info.plist`` file is created +application bundle on OS X. By default its ``Info.plist`` file is created by configuring a template called ``MacOSXBundleInfo.plist.in`` located in the :variable:`CMAKE_MODULE_PATH`. This property specifies an alternative template file name which may be a full path. diff -Nru cmake-3.4.1/Help/prop_tgt/MACOSX_BUNDLE.rst cmake-3.5.0/Help/prop_tgt/MACOSX_BUNDLE.rst --- cmake-3.4.1/Help/prop_tgt/MACOSX_BUNDLE.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/MACOSX_BUNDLE.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,12 +1,12 @@ MACOSX_BUNDLE ------------- -Build an executable as an application bundle on Mac OS X. +Build an executable as an Application Bundle on OS X or iOS. -When this property is set to true the executable when built on Mac OS -X will be created as an application bundle. This makes it a GUI -executable that can be launched from the Finder. See the -MACOSX_BUNDLE_INFO_PLIST target property for information about -creation of the Info.plist file for the application bundle. This -property is initialized by the value of the variable -CMAKE_MACOSX_BUNDLE if it is set when a target is created. +When this property is set to ``TRUE`` the executable when built on OS X +or iOS will be created as an application bundle. This makes it +a GUI executable that can be launched from the Finder. See the +:prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property for information about +creation of the ``Info.plist`` file for the application bundle. +This property is initialized by the value of the variable +:variable:`CMAKE_MACOSX_BUNDLE` if it is set when a target is created. diff -Nru cmake-3.4.1/Help/prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST.rst cmake-3.5.0/Help/prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST.rst --- cmake-3.4.1/Help/prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,10 +1,10 @@ MACOSX_FRAMEWORK_INFO_PLIST --------------------------- -Specify a custom ``Info.plist`` template for a Mac OS X Framework. +Specify a custom ``Info.plist`` template for a OS X and iOS Framework. A library target with :prop_tgt:`FRAMEWORK` enabled will be built as a -framework on Mac OS X. By default its ``Info.plist`` file is created by +framework on OS X. By default its ``Info.plist`` file is created by configuring a template called ``MacOSXFrameworkInfo.plist.in`` located in the :variable:`CMAKE_MODULE_PATH`. This property specifies an alternative template file name which may be a full path. diff -Nru cmake-3.4.1/Help/prop_tgt/MACOSX_RPATH.rst cmake-3.5.0/Help/prop_tgt/MACOSX_RPATH.rst --- cmake-3.4.1/Help/prop_tgt/MACOSX_RPATH.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/MACOSX_RPATH.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,18 +1,23 @@ MACOSX_RPATH ------------ -Whether to use rpaths on Mac OS X. +Whether this target on OS X or iOS is located at runtime using rpaths. + +When this property is set to ``TRUE``, the directory portion of +the ``install_name`` field of this shared library will be ``@rpath`` +unless overridden by :prop_tgt:`INSTALL_NAME_DIR`. This indicates +the shared library is to be found at runtime using runtime +paths (rpaths). -When this property is set to true, the directory portion of -the "install_name" field of shared libraries will be ``@rpath`` -unless overridden by :prop_tgt:`INSTALL_NAME_DIR`. Runtime -paths will also be embedded in binaries using this target and -can be controlled by the :prop_tgt:`INSTALL_RPATH` target property. This property is initialized by the value of the variable :variable:`CMAKE_MACOSX_RPATH` if it is set when a target is created. -Policy CMP0042 was introduced to change the default value of -MACOSX_RPATH to ON. This is because use of ``@rpath`` is a +Runtime paths will also be embedded in binaries using this target and +can be controlled by the :prop_tgt:`INSTALL_RPATH` target property on +the target linking to this target. + +Policy :policy:`CMP0042` was introduced to change the default value of +``MACOSX_RPATH`` to ``TRUE``. This is because use of ``@rpath`` is a more flexible and powerful alternative to ``@executable_path`` and ``@loader_path``. diff -Nru cmake-3.4.1/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst cmake-3.5.0/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst --- cmake-3.4.1/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,7 +1,7 @@ OSX_ARCHITECTURES_ -------------------------- -Per-configuration OS X binary architectures for a target. +Per-configuration OS X and iOS binary architectures for a target. This property is the configuration-specific version of :prop_tgt:`OSX_ARCHITECTURES`. diff -Nru cmake-3.4.1/Help/prop_tgt/PRIVATE_HEADER.rst cmake-3.5.0/Help/prop_tgt/PRIVATE_HEADER.rst --- cmake-3.4.1/Help/prop_tgt/PRIVATE_HEADER.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/PRIVATE_HEADER.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,11 +1,11 @@ PRIVATE_HEADER -------------- -Specify private header files in a FRAMEWORK shared library target. +Specify private header files in a :prop_tgt:`FRAMEWORK` shared library target. -Shared library targets marked with the FRAMEWORK property generate -frameworks on OS X and normal shared libraries on other platforms. +Shared library targets marked with the :prop_tgt:`FRAMEWORK` property generate +frameworks on OS X, iOS and normal shared libraries on other platforms. This property may be set to a list of header files to be placed in the PrivateHeaders directory inside the framework folder. On non-Apple -platforms these headers may be installed using the PRIVATE_HEADER -option to the install(TARGETS) command. +platforms these headers may be installed using the ``PRIVATE_HEADER`` +option to the ``install(TARGETS)`` command. diff -Nru cmake-3.4.1/Help/prop_tgt/PUBLIC_HEADER.rst cmake-3.5.0/Help/prop_tgt/PUBLIC_HEADER.rst --- cmake-3.4.1/Help/prop_tgt/PUBLIC_HEADER.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/PUBLIC_HEADER.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,11 +1,11 @@ PUBLIC_HEADER ------------- -Specify public header files in a FRAMEWORK shared library target. +Specify public header files in a :prop_tgt:`FRAMEWORK` shared library target. -Shared library targets marked with the FRAMEWORK property generate -frameworks on OS X and normal shared libraries on other platforms. +Shared library targets marked with the :prop_tgt:`FRAMEWORK` property generate +frameworks on OS X, iOS and normal shared libraries on other platforms. This property may be set to a list of header files to be placed in the -Headers directory inside the framework folder. On non-Apple platforms -these headers may be installed using the PUBLIC_HEADER option to the -install(TARGETS) command. +``Headers`` directory inside the framework folder. On non-Apple platforms +these headers may be installed using the ``PUBLIC_HEADER`` option to the +``install(TARGETS)`` command. diff -Nru cmake-3.4.1/Help/prop_tgt/RESOURCE.rst cmake-3.5.0/Help/prop_tgt/RESOURCE.rst --- cmake-3.4.1/Help/prop_tgt/RESOURCE.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/prop_tgt/RESOURCE.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,11 +1,61 @@ RESOURCE -------- -Specify resource files in a FRAMEWORK shared library target. +Specify resource files in a :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE`. -Shared library targets marked with the FRAMEWORK property generate -frameworks on OS X and normal shared libraries on other platforms. -This property may be set to a list of files to be placed in the -Resources directory inside the framework folder. On non-Apple -platforms these files may be installed using the RESOURCE option to -the install(TARGETS) command. +Target marked with the :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE` property +generate framework or application bundle (both OS X and iOS is supported) +or normal shared libraries on other platforms. +This property may be set to a list of files to be placed in the corresponding +directory (eg. ``Resources`` directory for OS X) inside the bundle. +On non-Apple platforms these files may be installed using the ``RESOURCE`` +option to the ``install(TARGETS)`` command. + +Following example of Application Bundle: + +.. code-block:: cmake + + add_executable(ExecutableTarget + addDemo.c + resourcefile.txt + appresourcedir/appres.txt + ) + + target_link_libraries(ExecutableTarget heymath mul) + + set(RESOURCE_FILES + resourcefile.txt + appresourcedir/appres.txt + ) + + set_target_properties(ExecutableTarget PROPERTIES + MACOSX_BUNDLE TRUE + MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget + RESOURCE "${RESOURCE_FILES}" + ) + +will produce flat structure for iOS systems:: + + ExecutableTarget.app + appres.txt + ExecutableTarget + Info.plist + resourcefile.txt + +For OS X systems it will produce following directory structure:: + + ExecutableTarget.app/ + Contents + Info.plist + MacOS + ExecutableTarget + Resources + appres.txt + resourcefile.txt + +For Linux, such cmake script produce following files:: + + ExecutableTarget + Resources + appres.txt + resourcefile.txt diff -Nru cmake-3.4.1/Help/release/3.5.rst cmake-3.5.0/Help/release/3.5.rst --- cmake-3.4.1/Help/release/3.5.rst 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Help/release/3.5.rst 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,185 @@ +CMake 3.5 Release Notes +*********************** + +.. only:: html + + .. contents:: + +Changes made since CMake 3.4 include the following. + +New Features +============ + +GUI +--- + +* The :manual:`cmake-gui(1)` gained options to control warnings about + deprecated functionality. + +* The :manual:`cmake-gui(1)` learned an option to set the toolset + to be used with VS IDE and Xcode generators, much like the + existing ``-T`` option to :manual:`cmake(1)`. + +* The :manual:`cmake-gui(1)` gained a Regular Expression Explorer which + may be used to create and evaluate regular expressions in real-time. + The explorer window is available via the ``Tools`` menu. + +Command-Line +------------ + +* The ``-Wdev`` and ``-Wno-dev`` :manual:`cmake(1)` options now also enable + and suppress the deprecated warnings output by default. + +* The suppression of developer warnings as errors can now be controlled with + the new ``-Werror=dev`` and ``-Wno-error=dev`` :manual:`cmake(1)` options. + +* The :manual:`cmake(1)` ``-E`` command-line tools ``copy``, + ``copy_if_different``, ``copy_directory``, and ``make_directory`` + learned to support multiple input files or directories. + +Commands +-------- + +* The :command:`cmake_parse_arguments` command is now implemented natively. + The :module:`CMakeParseArguments` module remains as an empty placeholder + for compatibility. + +* The :command:`install(DIRECTORY)` command learned to support + :manual:`generator expressions ` + in the list of directories. + +Variables +--------- + +* The :variable:`CMAKE_ERROR_DEPRECATED` variable can now be set using the + ``-Werror=deprecated`` and ``-Wno-error=deprecated`` :manual:`cmake(1)` + options. + +* The :variable:`CMAKE_WARN_DEPRECATED` variable can now be set using the + ``-Wdeprecated`` and ``-Wno-deprecated`` :manual:`cmake(1)` options. + +Properties +---------- + +* The :prop_tgt:`VS_GLOBAL_` target property is now implemented + for VS 2010 and above. Previously it worked only in VS 2008 and below. + +Modules +------- + +* The :module:`ExternalProject` module learned a new ``GIT_REMOTE_NAME`` + option to control the ``git clone --origin`` value. + +* The :module:`FindBoost` module now provides imported targets + such as ``Boost::boost`` and ``Boost::filesystem``. + +* The :module:`FindFLEX` module ``FLEX_TARGET`` macro learned a + new ``DEFINES_FILE`` option to specify a custom output header + to be generated. + +* The :module:`FindGTest` module now provides imported targets. + +* The :module:`FindGTK2` module, when ``GTK2_USE_IMPORTED_TARGETS`` is + enabled, now sets ``GTK2_LIBRARIES`` to contain the list of imported + targets instead of the paths to the libraries. Moreover it now sets + a new ``GTK2_TARGETS`` variable containing all the targets imported. + +* The :module:`FindOpenMP` module learned to support Clang. + +* The :module:`FindOpenSSL` module gained a new + ``OPENSSL_MSVC_STATIC_RT`` option to search for libraries using + the MSVC static runtime. + +* The :module:`FindPNG` module now provides imported targets. + +* The :module:`FindTIFF` module now provides imported targets. + +* A :module:`FindXalanC` module was introduced to find the + Apache Xalan-C++ XSL transform processing library. + +* The :module:`FindXercesC` module now provides imported targets. + +Platforms +--------- + +* Support was added for the ARM Compiler (arm.com) with compiler id ``ARMCC``. + +* A new platform file for cross-compiling in the Cray Linux Environment to + target compute nodes was added. See + :ref:`Cross Compiling for the Cray Linux Environment ` + for usage details. + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Clang compilers on Windows (MinGW). + +* When building for embedded Apple platforms like iOS CMake learned to build and + install combined targets which contain both a device and a simulator build. + This behavior can be enabled by setting the :prop_tgt:`IOS_INSTALL_COMBINED` + target property. + +CPack +----- + +* The :module:`CPackDMG` module learned new variable to specify AppleScript + file run to customize appearance of ``DragNDrop`` installer folder, + including background image setting using supplied PNG or multi-resolution + TIFF file. See the :variable:`CPACK_DMG_DS_STORE_SETUP_SCRIPT` and + :variable:`CPACK_DMG_BACKGROUND_IMAGE` variables. + +* The :module:`CPackDeb` module learned to set the optional config + file ``Source`` field using a monolithic or per-component variable. + See :variable:`CPACK_DEBIAN_PACKAGE_SOURCE`. + +* The :module:`CPackDeb` module learned to set Package, Section + and Priority control fields per-component. + See variables :variable:`CPACK_DEBIAN__PACKAGE_SECTION` and + :variable:`CPACK_DEBIAN__PACKAGE_PRIORITY`. + +* The :module:`CPack DragNDrop generator ` learned to add + multi-lingual SLAs to a DMG which is presented to the user when they try to + mount the DMG. See the :variable:`CPACK_DMG_SLA_LANGUAGES` and + :variable:`CPACK_DMG_SLA_DIR` variables for details. + +* The :module:`CPackNSIS` module learned new variables to add bitmaps to the + installer. See the :variable:`CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP` + and :variable:`CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP` variables. + +* The :module:`CPackRPM` module learned to set Name and Group + control fields per-component. + See :variable:`CPACK_RPM__PACKAGE_NAME` + and :variable:`CPACK_RPM__PACKAGE_GROUP`. + +Other +----- + +* Warnings about deprecated functionality are now enabled by default. + They may be suppressed with ``-Wno-deprecated`` or by setting the + :variable:`CMAKE_WARN_DEPRECATED` variable to false. + +Deprecated and Removed Features +=============================== + +* The :manual:`cmake(1)` ``-E time`` command now properly passes arguments + with spaces or special characters through to the child process. This + may break scripts that worked around the bug with their own extra + quoting or escaping. + +* The :generator:`Xcode` generator was fixed to escape backslashes in + strings consistently with other generators. Projects that previously + worked around the inconsistecy with an extra level of backslashes + conditioned on the Xcode generator must be updated to remove the + workaround for CMake 3.5 and greater. + +Other Changes +============= + +* The :generator:`Visual Studio 14 2015` generator learned to map the + ``/debug:fastlink`` linker flag to the ``.vcxproj`` file property. + +* The :module:`FindGTK2` module now configures the ``GTK2::sigc++`` imported + target to enable c++11 on its dependents when using sigc++ 2.5.1 or higher. + +* The precompiled Windows binary provided on ``cmake.org`` is now a + ``.msi`` package instead of an installer executable. One may need + to manually uninstall CMake versions lower than 3.5 before installing + the new package. diff -Nru cmake-3.4.1/Help/release/index.rst cmake-3.5.0/Help/release/index.rst --- cmake-3.4.1/Help/release/index.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/release/index.rst 2016-03-08 14:36:22.000000000 +0000 @@ -11,6 +11,7 @@ .. toctree:: :maxdepth: 1 + 3.5 <3.5> 3.4 <3.4> 3.3 <3.3> 3.2 <3.2> diff -Nru cmake-3.4.1/Help/variable/APPLE.rst cmake-3.5.0/Help/variable/APPLE.rst --- cmake-3.4.1/Help/variable/APPLE.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/APPLE.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,6 +1,6 @@ APPLE ----- -``True`` if running on Mac OS X. +``True`` if running on OS X. -Set to ``true`` on Mac OS X. +Set to ``true`` on OS X. diff -Nru cmake-3.4.1/Help/variable/CMAKE_BINARY_DIR.rst cmake-3.5.0/Help/variable/CMAKE_BINARY_DIR.rst --- cmake-3.4.1/Help/variable/CMAKE_BINARY_DIR.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_BINARY_DIR.rst 2016-03-08 14:36:22.000000000 +0000 @@ -6,3 +6,8 @@ This is the full path to the top level of the current CMake build tree. For an in-source build, this would be the same as :variable:`CMAKE_SOURCE_DIR`. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff -Nru cmake-3.4.1/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst cmake-3.5.0/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst --- cmake-3.4.1/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst 2016-03-08 14:36:22.000000000 +0000 @@ -8,3 +8,8 @@ create a binary directory in the build tree, and as it is being processed this variable will be set. For in-source builds this is the current source directory being processed. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff -Nru cmake-3.4.1/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst cmake-3.5.0/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst --- cmake-3.4.1/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst 2016-03-08 14:36:22.000000000 +0000 @@ -5,3 +5,8 @@ This the full path to the source directory that is currently being processed by cmake. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff -Nru cmake-3.4.1/Help/variable/CMAKE_ENABLE_EXPORTS.rst cmake-3.5.0/Help/variable/CMAKE_ENABLE_EXPORTS.rst --- cmake-3.4.1/Help/variable/CMAKE_ENABLE_EXPORTS.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_ENABLE_EXPORTS.rst 2016-03-08 14:36:22.000000000 +0000 @@ -6,15 +6,15 @@ Normally an executable does not export any symbols because it is the final program. It is possible for an executable to export symbols to be used by loadable modules. When this property is set to true CMake -will allow other targets to "link" to the executable with the +will allow other targets to ``link`` to the executable with the :command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level dependency on the executable is created for targets that link to it. For DLL platforms an import library will be created for the exported symbols and then used for linking. All Windows-based systems including Cygwin are DLL platforms. For non-DLL platforms that -require all symbols to be resolved at link time, such as Mac OS X, the -module will "link" to the executable using a flag like -"-bundle_loader". For other non-DLL platforms the link rule is simply +require all symbols to be resolved at link time, such as OS X, the +module will ``link`` to the executable using a flag like +``-bundle_loader``. For other non-DLL platforms the link rule is simply ignored since the dynamic loader will automatically bind symbols when the module is loaded. diff -Nru cmake-3.4.1/Help/variable/CMAKE_ERROR_DEPRECATED.rst cmake-3.5.0/Help/variable/CMAKE_ERROR_DEPRECATED.rst --- cmake-3.4.1/Help/variable/CMAKE_ERROR_DEPRECATED.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_ERROR_DEPRECATED.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,8 +1,7 @@ CMAKE_ERROR_DEPRECATED ---------------------- -Whether to issue deprecation errors for macros and functions. +Whether to issue errors for deprecated functionality. -If ``TRUE``, this can be used by macros and functions to issue fatal -errors when deprecated macros or functions are used. This variable is -``FALSE`` by default. +If ``TRUE``, use of deprecated functionality will issue fatal errors. +If this variable is not set, CMake behaves as if it were set to ``FALSE``. diff -Nru cmake-3.4.1/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst cmake-3.5.0/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst --- cmake-3.4.1/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,30 @@ +CMAKE_EXPORT_COMPILE_COMMANDS +----------------------------- + +Enable/Disable output of compile commands during generation. + +If enabled, generates a ``compile_commands.json`` file containing the exact +compiler calls for all translation units of the project in machine-readable +form. The format of the JSON file looks like: + +.. code-block:: javascript + + [ + { + "directory": "/home/user/development/project", + "command": "/usr/bin/c++ ... -c ../foo/foo.cc", + "file": "../foo/foo.cc" + }, + + ... + + { + "directory": "/home/user/development/project", + "command": "/usr/bin/c++ ... -c ../foo/bar.cc", + "file": "../foo/bar.cc" + } + ] + +.. note:: + This option is implemented only by :ref:`Makefile Generators` + and the :generator:`Ninja`. It is ignored on other generators. diff -Nru cmake-3.4.1/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst cmake-3.5.0/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst --- cmake-3.4.1/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst 2016-03-08 14:36:22.000000000 +0000 @@ -4,5 +4,5 @@ Name of the OS CMake is running on. On systems that have the uname command, this variable is set to the -output of ``uname -s``. ``Linux``, ``Windows``, and ``Darwin`` for Mac OS X +output of ``uname -s``. ``Linux``, ``Windows``, and ``Darwin`` for OS X are the values found on the big three operating systems. diff -Nru cmake-3.4.1/Help/variable/CMAKE_INSTALL_NAME_DIR.rst cmake-3.5.0/Help/variable/CMAKE_INSTALL_NAME_DIR.rst --- cmake-3.4.1/Help/variable/CMAKE_INSTALL_NAME_DIR.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_INSTALL_NAME_DIR.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,7 +1,7 @@ CMAKE_INSTALL_NAME_DIR ---------------------- -Mac OS X directory name for installed targets. +OS X directory name for installed targets. ``CMAKE_INSTALL_NAME_DIR`` is used to initialize the :prop_tgt:`INSTALL_NAME_DIR` property on all targets. See that target diff -Nru cmake-3.4.1/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst cmake-3.5.0/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst --- cmake-3.4.1/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,8 @@ +CMAKE_IOS_INSTALL_COMBINED +-------------------------- + +Default value for :prop_tgt:`IOS_INSTALL_COMBINED` of targets. + +This variable is used to initialize the :prop_tgt:`IOS_INSTALL_COMBINED` +property on all the targets. See that target property for additional +information. diff -Nru cmake-3.4.1/Help/variable/CMAKE_LANG_COMPILER_ID.rst cmake-3.5.0/Help/variable/CMAKE_LANG_COMPILER_ID.rst --- cmake-3.4.1/Help/variable/CMAKE_LANG_COMPILER_ID.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_LANG_COMPILER_ID.rst 2016-03-08 14:36:22.000000000 +0000 @@ -11,6 +11,7 @@ Absoft = Absoft Fortran (absoft.com) ADSP = Analog VisualDSP++ (analog.com) AppleClang = Apple Clang (apple.com) + ARMCC = ARM Compiler (arm.com) CCur = Concurrent Fortran (ccur.com) Clang = LLVM Clang (clang.llvm.org) Cray = Cray Compiler (cray.com) diff -Nru cmake-3.4.1/Help/variable/CMAKE_MACOSX_RPATH.rst cmake-3.5.0/Help/variable/CMAKE_MACOSX_RPATH.rst --- cmake-3.4.1/Help/variable/CMAKE_MACOSX_RPATH.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_MACOSX_RPATH.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,7 +1,7 @@ CMAKE_MACOSX_RPATH ------------------- -Whether to use rpaths on Mac OS X. +Whether to use rpaths on OS X and iOS. This variable is used to initialize the :prop_tgt:`MACOSX_RPATH` property on all targets. diff -Nru cmake-3.4.1/Help/variable/CMAKE_OSX_ARCHITECTURES.rst cmake-3.5.0/Help/variable/CMAKE_OSX_ARCHITECTURES.rst --- cmake-3.4.1/Help/variable/CMAKE_OSX_ARCHITECTURES.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_OSX_ARCHITECTURES.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,7 +1,7 @@ CMAKE_OSX_ARCHITECTURES ----------------------- -Target specific architectures for OS X. +Target specific architectures for OS X and iOS. This variable is used to initialize the :prop_tgt:`OSX_ARCHITECTURES` property on each target as it is creaed. See that target property diff -Nru cmake-3.4.1/Help/variable/CMAKE_SOURCE_DIR.rst cmake-3.5.0/Help/variable/CMAKE_SOURCE_DIR.rst --- cmake-3.4.1/Help/variable/CMAKE_SOURCE_DIR.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_SOURCE_DIR.rst 2016-03-08 14:36:22.000000000 +0000 @@ -6,3 +6,8 @@ This is the full path to the top level of the current CMake source tree. For an in-source build, this would be the same as :variable:`CMAKE_BINARY_DIR`. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff -Nru cmake-3.4.1/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst cmake-3.5.0/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst --- cmake-3.4.1/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst 2016-03-08 14:36:22.000000000 +0000 @@ -8,4 +8,5 @@ The :variable:`CMAKE_SYSTEM_VERSION` variable may be set to specify a version. Otherwise CMake computes a default version based on the Windows SDK versions available. The chosen Windows target version number is provided -in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``. +in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``. If no Windows 10 SDK +is available this value will be empty. diff -Nru cmake-3.4.1/Help/variable/CMAKE_WARN_DEPRECATED.rst cmake-3.5.0/Help/variable/CMAKE_WARN_DEPRECATED.rst --- cmake-3.4.1/Help/variable/CMAKE_WARN_DEPRECATED.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_WARN_DEPRECATED.rst 2016-03-08 14:36:22.000000000 +0000 @@ -1,7 +1,10 @@ CMAKE_WARN_DEPRECATED --------------------- -Whether to issue deprecation warnings for macros and functions. +Whether to issue warnings for deprecated functionality. -If ``TRUE``, this can be used by macros and functions to issue deprecation -warnings. This variable is ``FALSE`` by default. +If not ``FALSE``, use of deprecated functionality will issue warnings. +If this variable is not set, CMake behaves as if it were set to ``TRUE``. + +When running :manual:`cmake(1)`, this option can be enabled with the +``-Wdeprecated`` option, or disabled with the ``-Wno-deprecated`` option. diff -Nru cmake-3.4.1/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst cmake-3.5.0/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst --- cmake-3.4.1/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst 2016-03-08 14:36:22.000000000 +0000 @@ -8,3 +8,9 @@ See the :prop_tgt:`XCODE_ATTRIBUTE_` target property to set attributes on a specific target. + +Contents of ``CMAKE_XCODE_ATTRIBUTE_`` may use +"generator expressions" with the syntax ``$<...>``. See the +:manual:`cmake-generator-expressions(7)` manual for available +expressions. See the :manual:`cmake-buildsystem(7)` manual +for more on defining buildsystem properties. diff -Nru cmake-3.4.1/Modules/BundleUtilities.cmake cmake-3.5.0/Modules/BundleUtilities.cmake --- cmake-3.4.1/Modules/BundleUtilities.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/BundleUtilities.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -424,7 +424,9 @@ string(REGEX MATCHALL "rpath [^\n]+" load_cmds_ov "${load_cmds_ov}") string(REGEX REPLACE "rpath " "" load_cmds_ov "${load_cmds_ov}") if(load_cmds_ov) - gp_append_unique(${rpaths_var} "${load_cmds_ov}") + foreach(rpath ${load_cmds_ov}) + gp_append_unique(${rpaths_var} "${rpath}") + endforeach() endif() endif() diff -Nru cmake-3.4.1/Modules/CheckCSourceCompiles.cmake cmake-3.5.0/Modules/CheckCSourceCompiles.cmake --- cmake-3.4.1/Modules/CheckCSourceCompiles.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CheckCSourceCompiles.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -93,7 +93,7 @@ message(STATUS "Performing Test ${VAR} - Success") endif() 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} succeeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") else() diff -Nru cmake-3.4.1/Modules/CheckCSourceRuns.cmake cmake-3.5.0/Modules/CheckCSourceRuns.cmake --- cmake-3.4.1/Modules/CheckCSourceRuns.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CheckCSourceRuns.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -81,7 +81,7 @@ message(STATUS "Performing Test ${VAR} - Success") endif() 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} succeeded with the following output:\n" "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${SOURCE}\n") diff -Nru cmake-3.4.1/Modules/CheckCXXSourceCompiles.cmake cmake-3.5.0/Modules/CheckCXXSourceCompiles.cmake --- cmake-3.4.1/Modules/CheckCXXSourceCompiles.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CheckCXXSourceCompiles.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -94,7 +94,7 @@ message(STATUS "Performing Test ${VAR} - Success") endif() 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} succeeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") else() diff -Nru cmake-3.4.1/Modules/CheckCXXSourceRuns.cmake cmake-3.5.0/Modules/CheckCXXSourceRuns.cmake --- cmake-3.4.1/Modules/CheckCXXSourceRuns.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CheckCXXSourceRuns.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -82,7 +82,7 @@ message(STATUS "Performing Test ${VAR} - Success") endif() 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} succeeded with the following output:\n" "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${SOURCE}\n") diff -Nru cmake-3.4.1/Modules/CheckForPthreads.c cmake-3.5.0/Modules/CheckForPthreads.c --- cmake-3.4.1/Modules/CheckForPthreads.c 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CheckForPthreads.c 2016-03-08 14:36:22.000000000 +0000 @@ -16,8 +16,8 @@ pthread_create(&tid[0], 0, runner, (void*)1); pthread_create(&tid[1], 0, runner, (void*)2); -#if defined(__BEOS__) && !defined(__ZETA__) // (no usleep on BeOS 5.) - usleep(1); // for strange behavior on single-processor sun +#if defined(__BEOS__) && !defined(__ZETA__) /* (no usleep on BeOS 5.) */ + usleep(1); /* for strange behavior on single-processor sun */ #endif pthread_join(tid[0], 0); diff -Nru cmake-3.4.1/Modules/CheckFortranSourceCompiles.cmake cmake-3.5.0/Modules/CheckFortranSourceCompiles.cmake --- cmake-3.4.1/Modules/CheckFortranSourceCompiles.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CheckFortranSourceCompiles.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -94,7 +94,7 @@ message(STATUS "Performing Test ${VAR} - Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing Fortran SOURCE FILE Test ${VAR} succeded with the following output:\n" + "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") else() diff -Nru cmake-3.4.1/Modules/CMakeCCompiler.cmake.in cmake-3.5.0/Modules/CMakeCCompiler.cmake.in --- cmake-3.4.1/Modules/CMakeCCompiler.cmake.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeCCompiler.cmake.in 2016-03-08 14:36:22.000000000 +0000 @@ -2,6 +2,7 @@ set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@") set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@") set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") +set(CMAKE_C_COMPILER_WRAPPER "@CMAKE_C_COMPILER_WRAPPER@") set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@") set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@") diff -Nru cmake-3.4.1/Modules/CMakeCCompilerId.c.in cmake-3.5.0/Modules/CMakeCCompilerId.c.in --- cmake-3.4.1/Modules/CMakeCCompilerId.c.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeCCompilerId.c.in 2016-03-08 14:36:22.000000000 +0000 @@ -21,6 +21,10 @@ char const* qnxnto = "INFO" ":" "qnxnto[]"; #endif +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@ @CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@ @@ -55,6 +59,9 @@ #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif require += info_language_dialect_default[argc]; (void)argv; return require; diff -Nru cmake-3.4.1/Modules/CMakeCInformation.cmake cmake-3.5.0/Modules/CMakeCInformation.cmake --- cmake-3.4.1/Modules/CMakeCInformation.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeCInformation.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -18,6 +18,8 @@ # It also loads a system - compiler - processor (or target hardware) # specific file, which is mainly useful for crosscompiling and embedded systems. +include(CMakeLanguageInformation) + # some compilers use different extensions (e.g. sdcc uses .rel) # so set the extension here first so it can be overridden by the compiler specific file if(UNIX) @@ -60,6 +62,12 @@ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) endif () + +# load any compiler-wrapper specific information +if (CMAKE_C_COMPILER_WRAPPER) + __cmake_include_compiler_wrapper(C) +endif () + # We specify the compiler information in the system file for some # platforms, but this language may not have been enabled when the file # was first included. Include it again to get the language info. diff -Nru cmake-3.4.1/Modules/CMakeCompilerIdDetection.cmake cmake-3.5.0/Modules/CMakeCompilerIdDetection.cmake --- cmake-3.4.1/Modules/CMakeCompilerIdDetection.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeCompilerIdDetection.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -89,6 +89,7 @@ MSVC ADSP IAR + ARMCC ) if (lang STREQUAL C) list(APPEND ordered_compilers diff -Nru cmake-3.4.1/Modules/CMakeCXXCompiler.cmake.in cmake-3.5.0/Modules/CMakeCXXCompiler.cmake.in --- cmake-3.4.1/Modules/CMakeCXXCompiler.cmake.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeCXXCompiler.cmake.in 2016-03-08 14:36:22.000000000 +0000 @@ -2,6 +2,7 @@ set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") +set(CMAKE_CXX_COMPILER_WRAPPER "@CMAKE_CXX_COMPILER_WRAPPER@") set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@") set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@") diff -Nru cmake-3.4.1/Modules/CMakeCXXCompilerId.cpp.in cmake-3.5.0/Modules/CMakeCXXCompilerId.cpp.in --- cmake-3.4.1/Modules/CMakeCXXCompilerId.cpp.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeCXXCompilerId.cpp.in 2016-03-08 14:36:22.000000000 +0000 @@ -20,6 +20,10 @@ char const* qnxnto = "INFO" ":" "qnxnto[]"; #endif +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@ @CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@ @@ -49,6 +53,9 @@ #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif require += info_language_dialect_default[argc]; (void)argv; return require; diff -Nru cmake-3.4.1/Modules/CMakeCXXInformation.cmake cmake-3.5.0/Modules/CMakeCXXInformation.cmake --- cmake-3.4.1/Modules/CMakeCXXInformation.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeCXXInformation.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -18,6 +18,8 @@ # It also loads a system - compiler - processor (or target hardware) # specific file, which is mainly useful for crosscompiling and embedded systems. +include(CMakeLanguageInformation) + # some compilers use different extensions (e.g. sdcc uses .rel) # so set the extension here first so it can be overridden by the compiler specific file if(UNIX) @@ -59,6 +61,12 @@ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) endif () + +# load any compiler-wrapper specific information +if (CMAKE_CXX_COMPILER_WRAPPER) + __cmake_include_compiler_wrapper(CXX) +endif () + # We specify the compiler information in the system file for some # platforms, but this language may not have been enabled when the file # was first included. Include it again to get the language info. diff -Nru cmake-3.4.1/Modules/CMakeDetermineASMCompiler.cmake cmake-3.5.0/Modules/CMakeDetermineASMCompiler.cmake --- cmake-3.4.1/Modules/CMakeDetermineASMCompiler.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeDetermineASMCompiler.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -92,6 +92,10 @@ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR ) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler") + list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS ARMCC) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ARMCC ) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ARMCC "(ARM Compiler)|(ARM Assembler)") + include(CMakeDetermineCompilerId) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT}) diff -Nru cmake-3.4.1/Modules/CMakeDetermineCompilerId.cmake cmake-3.5.0/Modules/CMakeDetermineCompilerId.cmake --- cmake-3.4.1/Modules/CMakeDetermineCompilerId.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeDetermineCompilerId.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -107,6 +107,7 @@ PARENT_SCOPE) set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) + set(CMAKE_${lang}_COMPILER_WRAPPER "${CMAKE_${lang}_COMPILER_WRAPPER}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE) @@ -182,9 +183,6 @@ set(v 6) set(ext dsp) endif() - if("${id_platform}" STREQUAL "Itanium") - set(id_platform ia64) - endif() if(CMAKE_VS_PLATFORM_TOOLSET) if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") set(id_toolset "${CMAKE_VS_PLATFORM_TOOLSET}") @@ -435,6 +433,7 @@ set(HAVE_COMPILER_VERSION_MINOR 0) set(HAVE_COMPILER_VERSION_PATCH 0) set(HAVE_COMPILER_VERSION_TWEAK 0) + set(COMPILER_WRAPPER) set(DIGIT_VALUE_1 1) set(DIGIT_VALUE_2 10) set(DIGIT_VALUE_3 100) @@ -476,6 +475,9 @@ endif() endforeach() endforeach() + if("${info}" MATCHES "INFO:compiler_wrapper\\[([^]\"]*)\\]") + set(COMPILER_WRAPPER "${CMAKE_MATCH_1}") + endif() if("${info}" MATCHES "INFO:simulate\\[([^]\"]*)\\]") set(SIMULATE_ID "${CMAKE_MATCH_1}") endif() @@ -588,6 +590,7 @@ set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) + set(CMAKE_${lang}_COMPILER_WRAPPER "${COMPILER_WRAPPER}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE) diff -Nru cmake-3.4.1/Modules/CMakeDetermineFortranCompiler.cmake cmake-3.5.0/Modules/CMakeDetermineFortranCompiler.cmake --- cmake-3.4.1/Modules/CMakeDetermineFortranCompiler.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeDetermineFortranCompiler.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -54,6 +54,7 @@ if(NOT CMAKE_Fortran_COMPILER_INIT) # Known compilers: # f77/f90/f95: generic compiler names + # ftn: Cray fortran compiler wrapper # g77: GNU Fortran 77 compiler # gfortran: putative GNU Fortran 95+ compiler (in progress) # fort77: native F77 compiler under HP-UX (and some older Crays) @@ -73,6 +74,7 @@ # then 77 or older compilers, gnu is always last in the group, # so if you paid for a compiler it is picked by default. set(CMAKE_Fortran_COMPILER_LIST + ftn ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95 fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77 diff -Nru cmake-3.4.1/Modules/CMakeForceCompiler.cmake cmake-3.5.0/Modules/CMakeForceCompiler.cmake --- cmake-3.4.1/Modules/CMakeForceCompiler.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeForceCompiler.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -2,11 +2,25 @@ # CMakeForceCompiler # ------------------ # +# Discouraged. Avoid using this module if possible. It will be deprecated +# by a future version of CMake once alternatives have been provided for all +# toolchain file use cases. # +# The macros provided by this module were once intended for use by +# cross-compiling toolchain files when CMake was not able to automatically +# detect the compiler identification. Since the introduction of this module, +# CMake's compiler identification capabilities have improved and can now be +# taught to recognize any compiler. Furthermore, the suite of information +# CMake detects from a compiler is now too extensive to be provided by +# toolchain files using these macros. # -# This module defines macros intended for use by cross-compiling -# toolchain files when CMake is not able to automatically detect the -# compiler identification. +# The only known remaining use case for these macros is to write toolchain +# files for cross-compilers that cannot link binaries without special flags or +# custom linker scripts. These macros cause CMake to skip checks it normally +# performs as part of enabling a language and introspecting the toolchain. +# However, skipping these checks may limit some generation functionality. +# +# ------------------------------------------------------------------------- # # Macro CMAKE_FORCE_C_COMPILER has the following signature: # diff -Nru cmake-3.4.1/Modules/CMakeFortranCompiler.cmake.in cmake-3.5.0/Modules/CMakeFortranCompiler.cmake.in --- cmake-3.4.1/Modules/CMakeFortranCompiler.cmake.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeFortranCompiler.cmake.in 2016-03-08 14:36:22.000000000 +0000 @@ -2,6 +2,7 @@ set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@") set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@") set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@") +set(CMAKE_Fortran_COMPILER_WRAPPER "@CMAKE_Fortran_COMPILER_WRAPPER@") set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@") set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@") set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@") diff -Nru cmake-3.4.1/Modules/CMakeFortranCompilerId.F.in cmake-3.5.0/Modules/CMakeFortranCompilerId.F.in --- cmake-3.4.1/Modules/CMakeFortranCompilerId.F.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeFortranCompilerId.F.in 2016-03-08 14:36:22.000000000 +0000 @@ -110,6 +110,9 @@ # endif PRINT *, 'INFO:compiler[]' #endif +#if defined(__CRAYXE) || defined(__CRAYXC) + PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]' +#endif #if 0 ! Identify the platform diff -Nru cmake-3.4.1/Modules/CMakeFortranInformation.cmake cmake-3.5.0/Modules/CMakeFortranInformation.cmake --- cmake-3.4.1/Modules/CMakeFortranInformation.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeFortranInformation.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -12,6 +12,8 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +include(CMakeLanguageInformation) + # This file sets the basic flags for the Fortran language in CMake. # It also loads the available platform file for the system-compiler # if it exists. @@ -36,6 +38,12 @@ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) endif () + +# load any compiler-wrapper specific information +if (CMAKE_Fortran_COMPILER_WRAPPER) + __cmake_include_compiler_wrapper(Fortran) +endif () + # We specify the compiler information in the system file for some # platforms, but this language may not have been enabled when the file # was first included. Include it again to get the language info. diff -Nru cmake-3.4.1/Modules/CMakeIOSInstallCombined.cmake cmake-3.5.0/Modules/CMakeIOSInstallCombined.cmake --- cmake-3.4.1/Modules/CMakeIOSInstallCombined.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeIOSInstallCombined.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,297 @@ + +#============================================================================= +# Copyright 2014-2015 Ruslan Baratov, Gregor Jasny +# +# 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 to print messages of this module +function(_ios_install_combined_message) + message("[iOS combined] " ${ARGN}) +endfunction() + +# Get build settings for the current target/config/SDK by running +# `xcodebuild -sdk ... -showBuildSettings` and parsing it's output +function(_ios_install_combined_get_build_setting sdk variable resultvar) + if("${sdk}" STREQUAL "") + message(FATAL_ERROR "`sdk` is empty") + endif() + + if("${variable}" STREQUAL "") + message(FATAL_ERROR "`variable` is empty") + endif() + + if("${resultvar}" STREQUAL "") + message(FATAL_ERROR "`resultvar` is empty") + endif() + + set( + cmd + xcodebuild -showBuildSettings + -sdk "${sdk}" + -target "${CURRENT_TARGET}" + -config "${CURRENT_CONFIG}" + ) + + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ) + + if(NOT result EQUAL 0) + message(FATAL_ERROR "Command failed (${result}): ${cmd}") + endif() + + if(NOT output MATCHES " ${variable} = ([^\n]*)") + message(FATAL_ERROR "${variable} not found.") + endif() + + set("${resultvar}" "${CMAKE_MATCH_1}" PARENT_SCOPE) +endfunction() + +# Get architectures of given SDK (iphonesimulator/iphoneos) +function(_ios_install_combined_get_valid_archs sdk resultvar) + cmake_policy(SET CMP0007 NEW) + + if("${resultvar}" STREQUAL "") + message(FATAL_ERROR "`resultvar` is empty") + endif() + + _ios_install_combined_get_build_setting("${sdk}" "VALID_ARCHS" valid_archs) + + separate_arguments(valid_archs) + list(REMOVE_ITEM valid_archs "") # remove empty elements + list(REMOVE_DUPLICATES valid_archs) + + set("${resultvar}" "${valid_archs}" PARENT_SCOPE) +endfunction() + +# Final target can contain more architectures that specified by SDK. This +# function will run 'lipo -info' and parse output. Result will be returned +# as a CMake list. +function(_ios_install_combined_get_real_archs filename resultvar) + set(cmd "${_lipo_path}" -info "${filename}") + execute_process( + COMMAND ${cmd} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT result EQUAL 0) + message( + FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}" + ) + endif() + + if(NOT output MATCHES "(Architectures in the fat file: [^\n]+ are|Non-fat file: [^\n]+ is architecture): ([^\n]*)") + message(FATAL_ERROR "Could not detect architecture from: ${output}") + endif() + + separate_arguments(CMAKE_MATCH_2) + set(${resultvar} ${CMAKE_MATCH_2} PARENT_SCOPE) +endfunction() + +# Run build command for the given SDK +function(_ios_install_combined_build sdk) + if("${sdk}" STREQUAL "") + message(FATAL_ERROR "`sdk` is empty") + endif() + + _ios_install_combined_message("Build `${CURRENT_TARGET}` for `${sdk}`") + + execute_process( + COMMAND + "${CMAKE_COMMAND}" + --build + . + --target "${CURRENT_TARGET}" + --config ${CURRENT_CONFIG} + -- + -sdk "${sdk}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + RESULT_VARIABLE result + ) + + if(NOT result EQUAL 0) + message(FATAL_ERROR "Build failed") + endif() +endfunction() + +# Remove given architecture from file. This step needed only in rare cases +# when target was built in "unusual" way. Emit warning message. +function(_ios_install_combined_remove_arch lib arch) + _ios_install_combined_message( + "Warning! Unexpected architecture `${arch}` detected and will be removed " + "from file `${lib}`") + set(cmd "${_lipo_path}" -remove ${arch} -output ${lib} ${lib}) + execute_process( + COMMAND ${cmd} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT result EQUAL 0) + message( + FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}" + ) + endif() +endfunction() + +# Check that 'lib' contains only 'archs' architectures (remove others). +function(_ios_install_combined_keep_archs lib archs) + _ios_install_combined_get_real_archs("${lib}" real_archs) + set(archs_to_remove ${real_archs}) + list(REMOVE_ITEM archs_to_remove ${archs}) + foreach(x ${archs_to_remove}) + _ios_install_combined_remove_arch("${lib}" "${x}") + endforeach() +endfunction() + +function(_ios_install_combined_detect_sdks this_sdk_var corr_sdk_var) + cmake_policy(SET CMP0057 NEW) + + set(this_sdk "$ENV{PLATFORM_NAME}") + if("${this_sdk}" STREQUAL "") + message(FATAL_ERROR "Environment variable PLATFORM_NAME is empty") + endif() + + set(all_platforms "$ENV{SUPPORTED_PLATFORMS}") + if("${all_platforms}" STREQUAL "") + message(FATAL_ERROR "Environment variable SUPPORTED_PLATFORMS is empty") + endif() + + separate_arguments(all_platforms) + if(NOT this_sdk IN_LIST all_platforms) + message(FATAL_ERROR "`${this_sdk}` not found in `${all_platforms}`") + endif() + + list(REMOVE_ITEM all_platforms "" "${this_sdk}") + list(LENGTH all_platforms all_platforms_length) + if(NOT all_platforms_length EQUAL 1) + message(FATAL_ERROR "Expected one element: ${all_platforms}") + endif() + + set(${this_sdk_var} "${this_sdk}" PARENT_SCOPE) + set(${corr_sdk_var} "${all_platforms}" PARENT_SCOPE) +endfunction() + +# Create combined binary for the given target. +# +# Preconditions: +# * Target already installed at ${destination} +# for the ${PLATFORM_NAME} platform +# +# This function will: +# * Run build for the lacking platform, i.e. opposite to the ${PLATFORM_NAME} +# * Fuse both libraries by running lipo +function(ios_install_combined target destination) + if("${target}" STREQUAL "") + message(FATAL_ERROR "`target` is empty") + endif() + + if("${destination}" STREQUAL "") + message(FATAL_ERROR "`destination` is empty") + endif() + + if(NOT IS_ABSOLUTE "${destination}") + message(FATAL_ERROR "`destination` is not absolute: ${destination}") + endif() + + if(IS_DIRECTORY "${destination}" OR IS_SYMLINK "${destination}") + message(FATAL_ERROR "`destination` is no regular file: ${destination}") + endif() + + if("${CMAKE_BINARY_DIR}" STREQUAL "") + message(FATAL_ERROR "`CMAKE_BINARY_DIR` is empty") + endif() + + if(NOT IS_DIRECTORY "${CMAKE_BINARY_DIR}") + message(FATAL_ERROR "Is not a directory: ${CMAKE_BINARY_DIR}") + endif() + + if("${CMAKE_INSTALL_CONFIG_NAME}" STREQUAL "") + message(FATAL_ERROR "CMAKE_INSTALL_CONFIG_NAME is empty") + endif() + + set(cmd xcrun -f lipo) + execute_process( + COMMAND ${cmd} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT result EQUAL 0) + message( + FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}" + ) + endif() + set(_lipo_path ${output}) + + set(CURRENT_CONFIG "${CMAKE_INSTALL_CONFIG_NAME}") + set(CURRENT_TARGET "${target}") + + _ios_install_combined_message("Target: ${CURRENT_TARGET}") + _ios_install_combined_message("Config: ${CURRENT_CONFIG}") + _ios_install_combined_message("Destination: ${destination}") + + # Get SDKs + _ios_install_combined_detect_sdks(this_sdk corr_sdk) + + # Get architectures of the target + _ios_install_combined_get_valid_archs("${corr_sdk}" corr_valid_archs) + _ios_install_combined_get_valid_archs("${this_sdk}" this_valid_archs) + + # Return if there are no valid architectures for the SDK. + # (note that library already installed) + if("${corr_valid_archs}" STREQUAL "") + _ios_install_combined_message( + "No architectures detected for `${corr_sdk}` (skip)" + ) + return() + endif() + + # Trigger build of corresponding target + _ios_install_combined_build("${corr_sdk}") + + # Get location of the library in build directory + _ios_install_combined_get_build_setting( + "${corr_sdk}" "CONFIGURATION_BUILD_DIR" corr_build_dir) + _ios_install_combined_get_build_setting( + "${corr_sdk}" "EXECUTABLE_PATH" corr_executable_path) + set(corr "${corr_build_dir}/${corr_executable_path}") + + _ios_install_combined_keep_archs("${corr}" "${corr_valid_archs}") + _ios_install_combined_keep_archs("${destination}" "${this_valid_archs}") + + _ios_install_combined_message("Current: ${destination}") + _ios_install_combined_message("Corresponding: ${corr}") + + set(cmd "${_lipo_path}" -create ${corr} ${destination} -output ${destination}) + + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE result + ) + + if(NOT result EQUAL 0) + message(FATAL_ERROR "Command failed: ${cmd}") + endif() + + _ios_install_combined_message("Install done: ${destination}") +endfunction() diff -Nru cmake-3.4.1/Modules/CMakeLanguageInformation.cmake cmake-3.5.0/Modules/CMakeLanguageInformation.cmake --- cmake-3.4.1/Modules/CMakeLanguageInformation.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeLanguageInformation.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,37 @@ + +#============================================================================= +# Copyright 2015 Kitware, Inc. +# +# 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.) + +# This file contains common code blocks used by all the language information +# files + +# load any compiler-wrapper specific information +macro(__cmake_include_compiler_wrapper lang) + set(_INCLUDED_WRAPPER_FILE 0) + if (CMAKE_${lang}_COMPILER_ID) + include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE) + endif() + if (NOT _INCLUDED_WRAPPER_FILE) + include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE) + endif () + + # No platform - wrapper - lang information so maybe there's just wrapper - lang information + if(NOT _INCLUDED_WRAPPER_FILE) + if (CMAKE_${lang}_COMPILER_ID) + include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE) + endif() + if (NOT _INCLUDED_WRAPPER_FILE) + include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE) + endif () + endif () +endmacro () diff -Nru cmake-3.4.1/Modules/CMakeParseArguments.cmake cmake-3.5.0/Modules/CMakeParseArguments.cmake --- cmake-3.4.1/Modules/CMakeParseArguments.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CMakeParseArguments.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -2,86 +2,10 @@ # CMakeParseArguments # ------------------- # -# -# -# CMAKE_PARSE_ARGUMENTS( -# args...) -# -# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions -# for parsing the arguments given to that macro or function. It -# processes the arguments and defines a set of variables which hold the -# values of the respective options. -# -# The argument contains all options for the respective macro, -# i.e. keywords which can be used when calling the macro without any -# value following, like e.g. the OPTIONAL keyword of the install() -# command. -# -# The argument contains all keywords for this macro -# which are followed by one value, like e.g. DESTINATION keyword of the -# install() command. -# -# The argument contains all keywords for this -# macro which can be followed by more than one value, like e.g. the -# TARGETS or FILES keywords of the install() command. -# -# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the -# keywords listed in , and -# a variable composed of the given -# followed by "_" and the name of the respective keyword. These -# variables will then hold the respective value from the argument list. -# For the keywords this will be TRUE or FALSE. -# -# All remaining arguments are collected in a variable -# _UNPARSED_ARGUMENTS, this can be checked afterwards to see -# whether your macro was called with unrecognized parameters. -# -# As an example here a my_install() macro, which takes similar arguments -# as the real install() command: -# -# :: -# -# function(MY_INSTALL) -# set(options OPTIONAL FAST) -# set(oneValueArgs DESTINATION RENAME) -# set(multiValueArgs TARGETS CONFIGURATIONS) -# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" -# "${multiValueArgs}" ${ARGN} ) -# ... -# -# -# -# Assume my_install() has been called like this: -# -# :: -# -# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) -# -# -# -# After the cmake_parse_arguments() call the macro will have set the -# following variables: -# -# :: -# -# MY_INSTALL_OPTIONAL = TRUE -# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() -# MY_INSTALL_DESTINATION = "bin" -# MY_INSTALL_RENAME = "" (was not used) -# MY_INSTALL_TARGETS = "foo;bar" -# MY_INSTALL_CONFIGURATIONS = "" (was not used) -# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" -# -# -# -# You can then continue and process these variables. -# -# Keywords terminate lists of values, e.g. if directly after a -# one_value_keyword another recognized keyword follows, this is -# interpreted as the beginning of the new option. E.g. -# my_install(TARGETS foo DESTINATION OPTIONAL) would result in -# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION -# would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. +# This module once implemented the :command:`cmake_parse_arguments` command +# that is now implemented natively by CMake. It is now an empty placeholder +# for compatibility with projects that include it to get the command from +# CMake 3.4 and lower. #============================================================================= # Copyright 2010 Alexander Neundorf @@ -95,67 +19,3 @@ #============================================================================= # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) - - -if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) - return() -endif() -set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) - - -function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) - # first set all result variables to empty/FALSE - foreach(arg_name ${_singleArgNames} ${_multiArgNames}) - set(${prefix}_${arg_name}) - endforeach() - - foreach(option ${_optionNames}) - set(${prefix}_${option} FALSE) - endforeach() - - set(${prefix}_UNPARSED_ARGUMENTS) - - set(insideValues FALSE) - set(currentArgName) - - # now iterate over all arguments and fill the result variables - foreach(currentArg ${ARGN}) - list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword - - if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) - if(insideValues) - if("${insideValues}" STREQUAL "SINGLE") - set(${prefix}_${currentArgName} ${currentArg}) - set(insideValues FALSE) - elseif("${insideValues}" STREQUAL "MULTI") - list(APPEND ${prefix}_${currentArgName} ${currentArg}) - endif() - else() - list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) - endif() - else() - if(NOT ${optionIndex} EQUAL -1) - set(${prefix}_${currentArg} TRUE) - set(insideValues FALSE) - elseif(NOT ${singleArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "SINGLE") - elseif(NOT ${multiArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "MULTI") - endif() - endif() - - endforeach() - - # propagate the result variables to the caller: - foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) - set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) - endforeach() - set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) - -endfunction() diff -Nru cmake-3.4.1/Modules/Compiler/ARMCC-ASM.cmake cmake-3.5.0/Modules/Compiler/ARMCC-ASM.cmake --- cmake-3.4.1/Modules/Compiler/ARMCC-ASM.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/ARMCC-ASM.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +include(Compiler/ARMCC) + +set(CMAKE_ASM_OUTPUT_EXTENSION ".o") +set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1) + +set(CMAKE_ASM_COMPILE_OBJECT " -o ") +set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa) diff -Nru cmake-3.4.1/Modules/Compiler/ARMCC-C.cmake cmake-3.5.0/Modules/Compiler/ARMCC-C.cmake --- cmake-3.4.1/Modules/Compiler/ARMCC-C.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/ARMCC-C.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,2 @@ +include(Compiler/ARMCC) +__compiler_armcc(C) diff -Nru cmake-3.4.1/Modules/Compiler/ARMCC.cmake cmake-3.5.0/Modules/Compiler/ARMCC.cmake --- cmake-3.4.1/Modules/Compiler/ARMCC.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/ARMCC.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,36 @@ +if(_ARMCC_CMAKE_LOADED) + return() +endif() +set(_ARMCC_CMAKE_LOADED TRUE) + +# See ARM Compiler documentation at: +# http://infocenter.arm.com/help/topic/com.arm.doc.set.swdev/index.html + +get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH) +get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH) + +set(CMAKE_EXECUTABLE_SUFFIX ".elf") + +find_program(CMAKE_ARMCC_LINKER armlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" ) +find_program(CMAKE_ARMCC_AR armar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" ) + +set(CMAKE_LINKER "${CMAKE_ARMCC_LINKER}" CACHE FILEPATH "The ARMCC linker" FORCE) +mark_as_advanced(CMAKE_ARMCC_LINKER) +set(CMAKE_AR "${CMAKE_ARMCC_AR}" CACHE FILEPATH "The ARMCC archiver" FORCE) +mark_as_advanced(CMAKE_ARMCC_AR) + +macro(__compiler_armcc lang) + set(CMAKE_${lang}_FLAGS_INIT "") + set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g") + set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Ospace -DNDEBUG") + set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-Otime -DNDEBUG") + set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") + + set(CMAKE_${lang}_OUTPUT_EXTENSION ".o") + set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1) + + set(CMAKE_${lang}_LINK_EXECUTABLE " -o --list .map") + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY " --create -cr ") + + set(CMAKE_DEPFILE_FLAGS_${lang} "--depend= --depend_single_line --no_depend_system_headers") +endmacro() diff -Nru cmake-3.4.1/Modules/Compiler/ARMCC-CXX.cmake cmake-3.5.0/Modules/Compiler/ARMCC-CXX.cmake --- cmake-3.4.1/Modules/Compiler/ARMCC-CXX.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/ARMCC-CXX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,2 @@ +include(Compiler/ARMCC) +__compiler_armcc(CXX) diff -Nru cmake-3.4.1/Modules/Compiler/ARMCC-DetermineCompiler.cmake cmake-3.5.0/Modules/Compiler/ARMCC-DetermineCompiler.cmake --- cmake-3.4.1/Modules/Compiler/ARMCC-DetermineCompiler.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/ARMCC-DetermineCompiler.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,16 @@ +# ARMCC Toolchain +set(_compiler_id_pp_test "defined(__ARMCC_VERSION)") + +set(_compiler_id_version_compute " +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ARMCC_VERSION/1000000) + # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ARMCC_VERSION/10000 % 100) + # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ARMCC_VERSION/100000) + # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ARMCC_VERSION/10000 % 10) + # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ARMCC_VERSION % 10000) +#endif +") diff -Nru cmake-3.4.1/Modules/Compiler/Clang-CXX.cmake cmake-3.5.0/Modules/Compiler/Clang-CXX.cmake --- cmake-3.4.1/Modules/Compiler/Clang-CXX.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/Clang-CXX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -6,7 +6,7 @@ endif() cmake_policy(GET CMP0025 appleClangPolicy) -if(WIN32 OR (APPLE AND NOT appleClangPolicy STREQUAL NEW)) +if(APPLE AND NOT appleClangPolicy STREQUAL NEW) return() endif() @@ -49,7 +49,7 @@ endmacro() set(_result 0) - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) _get_clang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) if (_result EQUAL 0) _get_clang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-C.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-C.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-C.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-C.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,11 @@ +if(__craylinux_crayprgenv_c) + return() +endif() +set(__craylinux_crayprgenv_c 1) + +include(Compiler/CrayPrgEnv) +macro(__CrayPrgEnv_setup_C compiler_cmd link_cmd) + __CrayPrgEnv_setup(C + ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c + ${compiler_cmd} ${link_cmd}) +endmacro() diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,91 @@ +# Guard against multiple inclusions +if(__craylinux_crayprgenv) + return() +endif() +set(__craylinux_crayprgenv 1) + +macro(__cray_extract_args cmd tag_regex out_var make_absolute) + string(REGEX MATCHALL "${tag_regex}" args "${cmd}") + foreach(arg IN LISTS args) + string(REGEX REPLACE "^${tag_regex}$" "\\2" param "${arg}") + if(make_absolute) + get_filename_component(param "${param}" ABSOLUTE) + endif() + list(APPEND ${out_var} ${param}) + endforeach() +endmacro() + +function(__cray_extract_implicit src compiler_cmd link_cmd lang include_dirs_var link_dirs_var link_libs_var) + set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CrayExtractImplicit_${lang}.bin") + execute_process( + COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + if(EXISTS "${BIN}") + file(REMOVE "${BIN}") + endif() + set(include_dirs) + set(link_dirs) + set(link_libs) + string(REGEX REPLACE "\r?\n" ";" output_lines "${output}\n${error}") + foreach(line IN LISTS output_lines) + if("${line}" MATCHES "${compiler_cmd}") + __cray_extract_args("${line}" " -(I ?|isystem )([^ ]*)" include_dirs 1) + set(processed_include 1) + endif() + if("${line}" MATCHES "${link_cmd}") + __cray_extract_args("${line}" " -(L ?)([^ ]*)" link_dirs 1) + __cray_extract_args("${line}" " -(l ?)([^ ]*)" link_libs 0) + set(processed_link 1) + endif() + if(processed_include AND processed_link) + break() + endif() + endforeach() + + set(${include_dirs_var} "${include_dirs}" PARENT_SCOPE) + set(${link_dirs_var} "${link_dirs}" PARENT_SCOPE) + set(${link_libs_var} "${link_libs}" PARENT_SCOPE) + set(CRAY_${lang}_EXTRACTED_IMPLICIT 1 CACHE INTERNAL "" FORCE) +endfunction() + +macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd) + if(DEFINED ENV{CRAYPE_VERSION}) + message(STATUS "Cray Programming Environment $ENV{CRAYPE_VERSION} ${lang}") + elseif(DEFINED ENV{ASYNCPE_VERSION}) + message(STATUS "Cray XT Programming Environment $ENV{ASYNCPE_VERSION} ${lang}") + endif() + + # Flags for the Cray wrappers + set(CMAKE_STATIC_LIBRARY_LINK_${lang}_FLAGS "-static") + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-dynamic") + + # If the link type is not explicitly specified in the environment then + # the Cray wrappers assume that the code will be built staticly so + # we check the following condition(s) are NOT met + # Compiler flags are explicitly dynamic + # Env var is dynamic and compiler flags are not explicitly static + if(NOT (((CMAKE_${lang}_FLAGS MATCHES "(^| )-dynamic($| )") OR + (CMAKE_EXE_LINKER_FLAGS MATCHES "(^| )-dynamic($| )")) + OR + (("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "dynamic") AND + NOT ((CMAKE_${lang}_FLAGS MATCHES "(^| )-static($| )") OR + (CMAKE_EXE_LINKER_FLAGS MATCHES "(^| )-static($| )"))))) + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) + set(BUILD_SHARED_LIBS FALSE CACHE BOOL "") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set(CMAKE_LINK_SEARCH_START_STATIC TRUE) + endif() + if(NOT CRAY_${lang}_EXTRACTED_IMPLICIT) + __cray_extract_implicit( + ${test_src} ${compiler_cmd} ${link_cmd} ${lang} + CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES + CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES + CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES + ) + endif() +endmacro() diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Cray-C.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Cray-C.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Cray-C.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Cray-C.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_cray_c) + return() +endif() +set(__craylinux_crayprgenv_cray_c 1) + +include(Compiler/CrayPrgEnv-C) +__CrayPrgEnv_setup_C("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_cray_cxx) + return() +endif() +set(__craylinux_crayprgenv_cray_cxx 1) + +include(Compiler/CrayPrgEnv-CXX) +__CrayPrgEnv_setup_CXX("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_cray_fortran) + return() +endif() +set(__craylinux_crayprgenv_cray_fortran 1) + +include(Compiler/CrayPrgEnv-Fortran) +__CrayPrgEnv_setup_Fortran("/opt/cray/cce/.*/ftnfe" "/opt/cray/cce/.*/ld") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-CXX.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-CXX.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-CXX.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-CXX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,11 @@ +if(__craylinux_crayprgenv_cxx) + return() +endif() +set(__craylinux_crayprgenv_cxx 1) + +include(Compiler/CrayPrgEnv) +macro(__CrayPrgEnv_setup_CXX compiler_cmd link_cmd) + __CrayPrgEnv_setup(CXX + ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp + ${compiler_cmd} ${link_cmd}) +endmacro() diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Fortran.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Fortran.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Fortran.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Fortran.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,11 @@ +if(__craylinux_crayprgenv_fortran) + return() +endif() +set(__craylinux_crayprgenv_fortran 1) + +include(Compiler/CrayPrgEnv) +macro(__CrayPrgEnv_setup_Fortran compiler_cmd link_cmd) + __CrayPrgEnv_setup(Fortran + ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F + ${compiler_cmd} ${link_cmd}) +endmacro() diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-GNU-C.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-GNU-C.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-GNU-C.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-GNU-C.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_gnu_c) + return() +endif() +set(__craylinux_crayprgenv_gnu_c 1) + +include(Compiler/CrayPrgEnv-C) +__CrayPrgEnv_setup_C("/opt/gcc/.*/cc1" "/opt/gcc/.*/collect2") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_gnu_cxx) + return() +endif() +set(__craylinux_crayprgenv_gnu_cxx 1) + +include(Compiler/CrayPrgEnv-CXX) +__CrayPrgEnv_setup_CXX("/opt/gcc/.*/cc1plus" "/opt/gcc/.*/collect2") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_gnu_fortran) + return() +endif() +set(__craylinux_crayprgenv_gnu_fortran 1) + +include(Compiler/CrayPrgEnv-Fortran) +__CrayPrgEnv_setup_Fortran("/opt/gcc/.*/f951" "/opt/gcc/.*/collect2") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Intel-C.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Intel-C.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Intel-C.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Intel-C.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_intel_c) + return() +endif() +set(__craylinux_crayprgenv_intel_c 1) + +include(Compiler/CrayPrgEnv-C) +__CrayPrgEnv_setup_C("/opt/intel/.*/mcpcom" "^ld ") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_intel_cxx) + return() +endif() +set(__craylinux_crayprgenv_intel_cxx 1) + +include(Compiler/CrayPrgEnv-CXX) +__CrayPrgEnv_setup_CXX("/opt/intel/.*/mcpcom" "^ld ") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_intel_fortran) + return() +endif() +set(__craylinux_crayprgenv_intel_fortran 1) + +include(Compiler/CrayPrgEnv-Fortran) +__CrayPrgEnv_setup_Fortran("/opt/intel/.*/fortcom" "^ld ") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-PGI-C.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-PGI-C.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-PGI-C.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-PGI-C.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_pgi_c) + return() +endif() +set(__craylinux_crayprgenv_pgi_c 1) + +include(Compiler/CrayPrgEnv-C) +__CrayPrgEnv_setup_C("/opt/pgi/[^ ]*/pgc" "/usr/bin/ld") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_pgi_cxx) + return() +endif() +set(__craylinux_crayprgenv_pgi_cxx 1) + +include(Compiler/CrayPrgEnv-CXX) +__CrayPrgEnv_setup_CXX("/opt/pgi/[^ ]*/pgcpp" "/usr/bin/ld") diff -Nru cmake-3.4.1/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake cmake-3.5.0/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake --- cmake-3.4.1/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,7 @@ +if(__craylinux_crayprgenv_pgi_fortran) + return() +endif() +set(__craylinux_crayprgenv_pgi_fortran 1) + +include(Compiler/CrayPrgEnv-Fortran) +__CrayPrgEnv_setup_Fortran("/opt/pgi/[^ ]*/pgf" "/usr/bin/ld") diff -Nru cmake-3.4.1/Modules/Compiler/Embarcadero-DetermineCompiler.cmake cmake-3.5.0/Modules/Compiler/Embarcadero-DetermineCompiler.cmake --- cmake-3.4.1/Modules/Compiler/Embarcadero-DetermineCompiler.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Compiler/Embarcadero-DetermineCompiler.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -4,4 +4,4 @@ set(_compiler_id_version_compute " # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__CODEGEARC_VERSION__>>24 & 0x00FF) # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__CODEGEARC_VERSION__ & 0xFFFF)") +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__CODEGEARC_VERSION__ & 0xFFFF)") diff -Nru cmake-3.4.1/Modules/CPack.cmake cmake-3.5.0/Modules/CPack.cmake --- cmake-3.4.1/Modules/CPack.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CPack.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -586,7 +586,7 @@ # set sysroot so SDK tools can be used if(CMAKE_OSX_SYSROOT) - _cpack_set_default(CPACK_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}") + _cpack_set_default(CPACK_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_PATH}") endif() if(DEFINED CPACK_COMPONENTS_ALL) diff -Nru cmake-3.4.1/Modules/CPackDeb.cmake cmake-3.5.0/Modules/CPackDeb.cmake --- cmake-3.4.1/Modules/CPackDeb.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CPackDeb.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -8,7 +8,7 @@ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # # CPackDeb may be used to create Deb package using CPack. -# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables +# CPackDeb is a CPack generator thus it uses the ``CPACK_XXX`` variables # 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 @@ -18,7 +18,7 @@ # :code:`CPACK_DEBIAN_XXX` variables. # # :code:`CPACK_DEBIAN__XXXX` variables may be used in order to have -# **component** specific values. Note however that refers to the +# **component** specific values. Note however that ```` refers to the # **grouping name** written in upper case. It may be either a component name or # a component GROUP name. # @@ -27,11 +27,20 @@ # However as a handy reminder here comes the list of specific variables: # # .. variable:: CPACK_DEBIAN_PACKAGE_NAME +# CPACK_DEBIAN__PACKAGE_NAME # -# The Debian package summary +# Set Package control field (variable is automatically transformed to lower +# case). # # * Mandatory : YES -# * Default : :variable:`CPACK_PACKAGE_NAME` (lower case) +# * Default : +# +# - :variable:`CPACK_PACKAGE_NAME` for non-component based +# installations +# - :variable:`CPACK_DEBIAN_PACKAGE_NAME` suffixed with - +# for component-based installations. +# +# See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source # # # .. variable:: CPACK_DEBIAN_PACKAGE_VERSION @@ -100,10 +109,16 @@ # # # .. variable:: CPACK_DEBIAN_PACKAGE_SECTION +# CPACK_DEBIAN__PACKAGE_SECTION +# +# Set Section control field e.g. admin, devel, doc, ... # # * Mandatory : YES # * Default : 'devel' # +# See https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections +# +# # .. variable:: CPACK_DEBIAN_COMPRESSION_TYPE # # The compression used for creating the Debian package. @@ -114,12 +129,16 @@ # # # .. variable:: CPACK_DEBIAN_PACKAGE_PRIORITY +# CPACK_DEBIAN__PACKAGE_PRIORITY # -# The Debian package priority +# Set Priority control field e.g. required, important, standard, optional, +# extra # # * Mandatory : YES # * Default : 'optional' # +# See https://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities +# # # .. variable:: CPACK_DEBIAN_PACKAGE_HOMEPAGE # @@ -354,7 +373,28 @@ # set by Debian policy # https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners # - +# .. variable:: CPACK_DEBIAN_PACKAGE_SOURCE +# CPACK_DEBIAN__PACKAGE_SOURCE +# +# Sets the ``Source`` field of the binary Debian package. +# When the binary package name is not the same as the source package name +# (in particular when several components/binaries are generated from one +# source) the source from which the binary has been generated should be +# indicated with the field ``Source``. +# +# * Mandatory : NO +# * Default : +# +# - An empty string for non-component based installations +# - :variable:`CPACK_DEBIAN_PACKAGE_SOURCE` for component-based +# installations. +# +# See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source +# +# .. note:: +# +# This value is not interpreted. It is possible to pass an optional +# revision number of the referenced source package as well. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -554,24 +594,33 @@ ) endif() + # Source: (optional) + # in case several packages are constructed from a unique source + # (multipackaging), the source may be indicated as well. + # The source might contain a version if the generated package + # version is different from the source version + if(NOT CPACK_DEBIAN_PACKAGE_SOURCE) + set(CPACK_DEBIAN_PACKAGE_SOURCE "") + endif() + # have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES), # this returns the successful find_package() calls, maybe this can help # Depends: # You should set: DEBIAN_PACKAGE_DEPENDS # TODO: automate 'objdump -p | grep NEEDED' - # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_${dependency_type_} + # if per-component variable, overrides the global CPACK_DEBIAN_PACKAGE_${variable_type_} # automatic dependency discovery will be performed afterwards. if(CPACK_DEB_PACKAGE_COMPONENT) - foreach(dependency_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES) - set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${dependency_type_}") + foreach(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION PRIORITY NAME) + set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${value_type_}") - # if set, overrides the global dependency + # if set, overrides the global variable if(DEFINED ${_component_var}) - set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${${_component_var}}") + set(CPACK_DEBIAN_PACKAGE_${value_type_} "${${_component_var}}") if(CPACK_DEBIAN_PACKAGE_DEBUG) - message("CPackDeb Debug: component '${_local_component_name}' ${dependency_type_}" - "dependencies set to '${CPACK_DEBIAN_PACKAGE_${dependency_}}'") + message("CPackDeb Debug: component '${_local_component_name}' ${value_type_} " + "value set to '${CPACK_DEBIAN_PACKAGE_${value_type_}}'") endif() endif() endforeach() @@ -664,23 +713,25 @@ endif() endforeach() - set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}") - string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME) - else() - set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "") + if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME) + string(TOLOWER "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME) + else() + string(TOLOWER "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_DEB_PACKAGE_COMPONENT}" CPACK_DEBIAN_PACKAGE_NAME) + endif() endif() # Print out some debug information if we were asked for that if(CPACK_DEBIAN_PACKAGE_DEBUG) - message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}") - message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}") - message("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}") - message("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}") - message("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}") - message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}") - message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}") - message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") - message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION = ${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}") + message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = '${CPACK_TOPLEVEL_DIRECTORY}'") + message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = '${CPACK_TOPLEVEL_TAG}'") + message("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = '${CPACK_TEMPORARY_DIRECTORY}'") + message("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = '${CPACK_OUTPUT_FILE_NAME}'") + message("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = '${CPACK_OUTPUT_FILE_PATH}'") + message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = '${CPACK_PACKAGE_FILE_NAME}'") + message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = '${CPACK_PACKAGE_INSTALL_DIRECTORY}'") + message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = '${CPACK_TEMPORARY_PACKAGE_FILE_NAME}'") + message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION = '${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}'") + message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_SOURCE = '${CPACK_DEBIAN_PACKAGE_SOURCE}'") endif() # For debian source packages: @@ -719,6 +770,8 @@ set(GEN_CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA}" PARENT_SCOPE) set(GEN_CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION "${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}" PARENT_SCOPE) + set(GEN_CPACK_DEBIAN_PACKAGE_SOURCE + "${CPACK_DEBIAN_PACKAGE_SOURCE}" PARENT_SCOPE) set(GEN_WDIR "${WDIR}" PARENT_SCOPE) endfunction() diff -Nru cmake-3.4.1/Modules/CPackDMG.cmake cmake-3.5.0/Modules/CPackDMG.cmake --- cmake-3.4.1/Modules/CPackDMG.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CPackDMG.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -26,15 +26,56 @@ # Path to a custom DS_Store file. This .DS_Store file e.g. can be used to # specify the Finder window position/geometry and layout (such as hidden # toolbars, placement of the icons etc.). This file has to be generated by -# the Finder (either manually or through OSA-script) using a normal folder +# the Finder (either manually or through AppleScript) using a normal folder # from which the .DS_Store file can then be extracted. # +# .. variable:: CPACK_DMG_DS_STORE_SETUP_SCRIPT +# +# Path to a custom AppleScript file. This AppleScript is used to generate +# a .DS_Store file which specifies the Finder window position/geometry and +# layout (such as hidden toolbars, placement of the icons etc.). +# By specifying a custom AppleScript there is no need to use +# CPACK_DMG_DS_STORE, as the .DS_Store that is generated by the AppleScript +# will be packaged. +# # .. variable:: CPACK_DMG_BACKGROUND_IMAGE # -# Path to a background image file. This file will be used as the background -# for the Finder Window when the disk image is opened. By default no -# background image is set. The background image is applied after applying the -# custom .DS_Store file. +# Path to an image file to be used as the background. This file will be +# copied to .background/background., where ext is the original image file +# extension. The background image is installed into the image before +# CPACK_DMG_DS_STORE_SETUP_SCRIPT is executed or CPACK_DMG_DS_STORE is +# installed. By default no background image is set. +# +# .. variable:: CPACK_DMG_SLA_DIR +# +# Directory where license and menu files for different languages are stored. +# Setting this causes CPack to look for a ``.menu.txt`` and +# ``.license.txt`` file for every language defined in +# ``CPACK_DMG_SLA_LANGUAGES``. If both this variable and +# ``CPACK_RESOURCE_FILE_LICENSE`` are set, CPack will only look for the menu +# files and use the same license file for all languages. +# +# .. variable:: CPACK_DMG_SLA_LANGUAGES +# +# Languages for which a license agreement is provided when mounting the +# generated DMG. A menu file consists of 9 lines of text. The first line is +# is the name of the language itself, uppercase, in English (e.g. German). +# The other lines are translations of the following strings: +# +# - Agree +# - Disagree +# - Print +# - Save... +# - You agree to the terms of the License Agreement when you click the +# "Agree" button. +# - Software License Agreement +# - This text cannot be saved. The disk may be full or locked, or the file +# may be locked. +# - Unable to print. Make sure you have selected a printer. +# +# For every language in this list, CPack will try to find files +# ``.menu.txt`` and ``.license.txt`` in the directory +# specified by the :variable:`CPACK_DMG_SLA_DIR` variable. # # .. variable:: CPACK_COMMAND_HDIUTIL # diff -Nru cmake-3.4.1/Modules/CPackNSIS.cmake cmake-3.5.0/Modules/CPackNSIS.cmake --- cmake-3.4.1/Modules/CPackNSIS.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CPackNSIS.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -30,6 +30,14 @@ # # undocumented. # +# .. variable:: CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP +# +# The filename of a bitmap to use as the NSIS MUI_WELCOMEFINISHPAGE_BITMAP. +# +# .. variable:: CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP +# +# The filename of a bitmap to use as the NSIS MUI_UNWELCOMEFINISHPAGE_BITMAP. +# # .. variable:: CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS # # Extra NSIS commands that will be added to the beginning of the install diff -Nru cmake-3.4.1/Modules/CPackRPM.cmake cmake-3.5.0/Modules/CPackRPM.cmake --- cmake-3.4.1/Modules/CPackRPM.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CPackRPM.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -37,6 +37,7 @@ # * Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY # # .. variable:: CPACK_RPM_PACKAGE_NAME +# CPACK_RPM__PACKAGE_NAME # # The RPM package name. # @@ -81,6 +82,7 @@ # * Default : "unknown" # # .. variable:: CPACK_RPM_PACKAGE_GROUP +# CPACK_RPM__PACKAGE_GROUP # # The RPM package group. # @@ -1106,10 +1108,7 @@ # Are we packaging components ? if(CPACK_RPM_PACKAGE_COMPONENT) - set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}") string(TOUPPER ${CPACK_RPM_PACKAGE_COMPONENT} CPACK_RPM_PACKAGE_COMPONENT_UPPER) - else() - set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "") endif() set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}") @@ -1143,10 +1142,19 @@ endif() # CPACK_RPM_PACKAGE_NAME (mandatory) + if(NOT CPACK_RPM_PACKAGE_NAME) string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME) endif() + if(CPACK_RPM_PACKAGE_COMPONENT) + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME) + set(CPACK_RPM_PACKAGE_NAME ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME}) + else() + set(CPACK_RPM_PACKAGE_NAME ${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_COMPONENT}) + endif() + endif() + # CPACK_RPM_PACKAGE_VERSION (mandatory) if(NOT CPACK_RPM_PACKAGE_VERSION) if(NOT CPACK_PACKAGE_VERSION) @@ -1206,6 +1214,15 @@ endif() # CPACK_RPM_PACKAGE_GROUP + + #Check for component group first. + #If not set, it will use regular package group logic. + if(CPACK_RPM_PACKAGE_COMPONENT) + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_GROUP) + set(CPACK_RPM_PACKAGE_GROUP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_GROUP}) + endif() + endif() + if(NOT CPACK_RPM_PACKAGE_GROUP) set(CPACK_RPM_PACKAGE_GROUP "unknown") endif() @@ -1613,7 +1630,7 @@ ) # The name of the final spec file to be used by rpmbuild - set(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec") + set(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec") # Print out some debug information if we were asked for that if(CPACK_RPM_PACKAGE_DEBUG) @@ -1645,7 +1662,7 @@ "# -*- rpm-spec -*- BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@ Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@ -Name: \@CPACK_RPM_PACKAGE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_NAME\@ +Name: \@CPACK_RPM_PACKAGE_NAME\@ Version: \@CPACK_RPM_PACKAGE_VERSION\@ Release: \@CPACK_RPM_PACKAGE_RELEASE\@ License: \@CPACK_RPM_PACKAGE_LICENSE\@ @@ -1749,15 +1766,15 @@ "${CPACK_RPM_BINARY_SPECFILE}" WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT - ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err" - OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out") + ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.err" + OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.out") if(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT) - file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR) - file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT) + file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.err RPMBUILDERR) + file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.out RPMBUILDOUT) message("CPackRPM:Debug: You may consult rpmbuild logs in: ") - message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err") + message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.err") message("CPackRPM:Debug: *** ${RPMBUILDERR} ***") - message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out") + message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.out") message("CPackRPM:Debug: *** ${RPMBUILDOUT} ***") endif() else() diff -Nru cmake-3.4.1/Modules/CPackWIX.cmake cmake-3.5.0/Modules/CPackWIX.cmake --- cmake-3.4.1/Modules/CPackWIX.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/CPackWIX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -119,7 +119,8 @@ # # .. variable:: CPACK_WIX_PATCH_FILE # -# Optional XML file with fragments to be inserted into generated WiX sources +# Optional list of XML files with fragments to be inserted into +# generated WiX sources # # This optional variable can be used to specify an XML file that the # WiX generator will use to inject fragments into its generated diff -Nru cmake-3.4.1/Modules/ExternalProject.cmake cmake-3.5.0/Modules/ExternalProject.cmake --- cmake-3.4.1/Modules/ExternalProject.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/ExternalProject.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -57,6 +57,8 @@ URL of git repo ``GIT_TAG `` Git branch name, commit id or tag + ``GIT_REMOTE_NAME `` + The optional name of the remote, default to ``origin`` ``GIT_SUBMODULES ...`` Git submodules that shall be updated, all if empty ``HG_REPOSITORY `` @@ -494,7 +496,7 @@ "ExternalProject module." ) -function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_submodules src_name work_dir gitclone_infofile gitclone_stampfile) +function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules src_name work_dir gitclone_infofile gitclone_stampfile) file(WRITE ${script_filename} "if(\"${git_tag}\" STREQUAL \"\") message(FATAL_ERROR \"Tag for git checkout should not be empty.\") @@ -524,7 +526,7 @@ set(number_of_tries 0) while(error_code AND number_of_tries LESS 3) execute_process( - COMMAND \"${git_EXECUTABLE}\" clone \"${git_repository}\" \"${src_name}\" + COMMAND \"${git_EXECUTABLE}\" clone --origin \"${git_remote_name}\" \"${git_repository}\" \"${src_name}\" WORKING_DIRECTORY \"${work_dir}\" RESULT_VARIABLE error_code ) @@ -645,7 +647,7 @@ endfunction() -function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag git_submodules git_repository work_dir) +function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag git_remote_name git_submodules git_repository work_dir) if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.6) set(git_stash_save_options --all --quiet) else() @@ -687,7 +689,7 @@ set(git_remote \"\${CMAKE_MATCH_1}\") set(git_tag \"\${CMAKE_MATCH_2}\") else() - set(git_remote \"origin\") + set(git_remote \"${git_remote_name}\") set(git_tag \"${git_tag}\") endif() @@ -1228,9 +1230,24 @@ set(cmd "${CMAKE_COMMAND}") endif() set(args --build ".") - if (CMAKE_CFG_INTDIR AND NOT CMAKE_CFG_INTDIR STREQUAL ".") - list(APPEND args --config "${CMAKE_CFG_INTDIR}") - endif () + if(CMAKE_CONFIGURATION_TYPES) + if (CMAKE_CFG_INTDIR AND + NOT CMAKE_CFG_INTDIR STREQUAL "." AND + NOT CMAKE_CFG_INTDIR MATCHES "\\$") + # CMake 3.4 and below used the CMAKE_CFG_INTDIR placeholder value + # provided by multi-configuration generators. Some projects were + # taking advantage of that undocumented implementation detail to + # specify a specific configuration here. They should use + # BUILD_COMMAND to change the default command instead, but for + # compatibility honor the value. + set(config ${CMAKE_CFG_INTDIR}) + message(AUTHOR_WARNING "CMAKE_CFG_INTDIR should not be set by project code.\n" + "To get a non-default build command, use the BUILD_COMMAND option.") + else() + set(config $) + endif() + list(APPEND args --config ${config}) + endif() if(step STREQUAL "INSTALL") list(APPEND args --target install) endif() @@ -1238,6 +1255,9 @@ if("x${step}x" STREQUAL "xTESTx") string(REGEX REPLACE "^(.*/)cmake([^/]*)$" "\\1ctest\\2" cmd "${cmd}") set(args "") + if(CMAKE_CONFIGURATION_TYPES) + list(APPEND args -C ${config}) + endif() endif() endif() else() @@ -1749,6 +1769,11 @@ endif() get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES) + get_property(git_remote_name TARGET ${name} PROPERTY _EP_GIT_REMOTE_NAME) + if(NOT git_remote_name) + set(git_remote_name "origin") + endif() + # For the download step, and the git clone operation, only the repository # should be recorded in a configured RepositoryInfo file. If the repo # changes, the clone script should be run again. But if only the tag @@ -1772,7 +1797,7 @@ # The script will delete the source directory and then call git clone. # _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir} - ${GIT_EXECUTABLE} ${git_repository} ${git_tag} "${git_submodules}" ${src_name} ${work_dir} + ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" ${src_name} ${work_dir} ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt ) set(comment "Performing download step (git clone) for '${name}'") @@ -1993,9 +2018,13 @@ if(NOT git_tag) set(git_tag "master") endif() + get_property(git_remote_name TARGET ${name} PROPERTY _EP_GIT_REMOTE_NAME) + if(NOT git_remote_name) + set(git_remote_name "origin") + endif() get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES) _ep_write_gitupdate_script(${tmp_dir}/${name}-gitupdate.cmake - ${GIT_EXECUTABLE} ${git_tag} "${git_submodules}" ${git_repository} ${work_dir} + ${GIT_EXECUTABLE} ${git_tag} ${git_remote_name} "${git_submodules}" ${git_repository} ${work_dir} ) set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitupdate.cmake) set(always 1) diff -Nru cmake-3.4.1/Modules/FindBLAS.cmake cmake-3.5.0/Modules/FindBLAS.cmake --- cmake-3.4.1/Modules/FindBLAS.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindBLAS.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -494,18 +494,18 @@ list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN "mkl_blas95${BLAS_mkl_DLL_SUFFIX} mkl_intel_c${BLAS_mkl_DLL_SUFFIX}") endif() - if (BLA_VENDOR STREQUAL "Intel10_64lp*" OR BLA_VENDOR STREQUAL "All") + if (BLA_VENDOR MATCHES "^Intel10_64lp" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN "mkl_blas95_lp64${BLAS_mkl_DLL_SUFFIX} mkl_intel_lp64${BLAS_mkl_DLL_SUFFIX}") endif () # Add threading/sequential libs set(BLAS_SEARCH_LIBS_WIN_THREAD "") - if (BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All") + if (BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD "mkl_sequential${BLAS_mkl_DLL_SUFFIX}") endif() - if (NOT BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All") + if (NOT BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") # old version list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD "libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") @@ -561,14 +561,14 @@ list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN "mkl_intel_c${BLAS_mkl_DLL_SUFFIX}") endif() - if (BLA_VENDOR STREQUAL "Intel10_64lp*" OR BLA_VENDOR STREQUAL "All") + if (BLA_VENDOR MATCHES "^Intel10_64lp" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN "mkl_intel_lp64${BLAS_mkl_DLL_SUFFIX}") endif () # Add threading/sequential libs set(BLAS_SEARCH_LIBS_WIN_THREAD "") - if (NOT BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All") + if (NOT BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") # old version list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD "libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") @@ -576,7 +576,7 @@ list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD "libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") endif() - if (BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All") + if (BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD "mkl_sequential${BLAS_mkl_DLL_SUFFIX}") endif() diff -Nru cmake-3.4.1/Modules/FindBoost.cmake cmake-3.5.0/Modules/FindBoost.cmake --- cmake-3.4.1/Modules/FindBoost.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindBoost.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -54,6 +54,33 @@ # Boost__LIBRARY_DEBUG - Component library debug variant # Boost__LIBRARY_RELEASE - Component library release variant # +# The following :prop_tgt:`IMPORTED` targets are also defined:: +# +# Boost::boost - Target for header-only dependencies +# (Boost include directory) +# Boost:: - Target for specific component dependency +# (shared or static library); is lower- +# case +# Boost::diagnostic_definitions - interface target to enable diagnostic +# information about Boost's automatic linking +# during compilation (adds BOOST_LIB_DIAGNOSTIC) +# Boost::disable_autolinking - interface target to disable automatic +# linking with MSVC (adds BOOST_ALL_NO_LIB) +# Boost::dynamic_linking - interface target to enable dynamic linking +# linking with MSVC (adds BOOST_ALL_DYN_LINK) +# +# Implicit dependencies such as Boost::filesystem requiring +# Boost::system will be automatically detected and satisfied, even +# if system is not specified when using find_package and if +# Boost::system is not added to target_link_libraries. If using +# Boost::thread, then Thread::Thread will also be added automatically. +# +# It is important to note that the imported targets behave differently +# than variables created by this module: multiple calls to +# find_package(Boost) in the same directory or sub-directories with +# different options (e.g. static or shared) will not override the +# values of the targets created by the first call. +# # Users may set these hints or results as cache entries. Projects # should not read these entries directly but instead use the above # result variables. Note that some hint names start in upper-case @@ -142,6 +169,14 @@ # add_executable(foo foo.cc) # endif() # +# Example to find Boost libraries and use imported targets:: +# +# find_package(Boost 1.56 REQUIRED COMPONENTS +# date_time filesystem iostreams) +# add_executable(foo foo.cc) +# target_link_libraries(foo Boost::date_time Boost::filesystem +# Boost::iostreams) +# # Example to find Boost headers and some *static* libraries:: # # set(Boost_USE_STATIC_LIBS ON) # only find static libs @@ -472,6 +507,276 @@ endfunction() # +# Get component dependencies. Requires the dependencies to have been +# defined for the Boost release version. +# +# component - the component to check +# _ret - list of library dependencies +# +function(_Boost_COMPONENT_DEPENDENCIES component _ret) + # Note: to add a new Boost release, run + # + # % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake + # + # The output may be added in a new block below. If it's the same as + # the previous release, simply update the version range of the block + # for the previous release. + # + # This information was originally generated by running + # BoostScanDeps.cmake against every boost release to date supported + # by FindBoost: + # + # % for version in /path/to/boost/sources/* + # do + # cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake + # done + # + # The output was then updated by search and replace with these regexes: + # + # - Strip message(STATUS) prefix dashes + # s;^-- ;; + # - Indent + # s;^set(; set(;; + # - Add conditionals + # s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*); elseif(NOT Boost_VERSION VERSION_LESS \10\20\3 AND Boost_VERSION VERSION_LESS xxxx); + # + # This results in the logic seen below, but will require the xxxx + # replacing with the following Boost release version (or the next + # minor version to be released, e.g. 1.59 was the latest at the time + # of writing, making 1.60 the next, so 106000 is the needed version + # number). Identical consecutive releases were then merged together + # by updating the end range of the first block and removing the + # following redundant blocks. + # + # Running the script against all historical releases should be + # required only if the BoostScanDeps.cmake script logic is changed. + # The addition of a new release should only require it to be run + # against the new release. + set(_Boost_IMPORTED_TARGETS TRUE) + if(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500) + set(_Boost_IOSTREAMS_DEPENDENCIES regex thread) + set(_Boost_REGEX_DEPENDENCIES thread) + set(_Boost_WAVE_DEPENDENCIES filesystem thread) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 103500 AND Boost_VERSION VERSION_LESS 103600) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_WAVE_DEPENDENCIES filesystem system thread) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 103600 AND Boost_VERSION VERSION_LESS 103800) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_WAVE_DEPENDENCIES filesystem system thread) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 103800 AND Boost_VERSION VERSION_LESS 104300) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES date_time) + set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 104300 AND Boost_VERSION VERSION_LESS 104400) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES date_time) + set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 104400 AND Boost_VERSION VERSION_LESS 104500) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES date_time) + set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 104500 AND Boost_VERSION VERSION_LESS 104700) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES date_time) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 104700 AND Boost_VERSION VERSION_LESS 104800) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES date_time) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 104800 AND Boost_VERSION VERSION_LESS 105000) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES date_time) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 105000 AND Boost_VERSION VERSION_LESS 105300) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 105300 AND Boost_VERSION VERSION_LESS 105400) + set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 105400 AND Boost_VERSION VERSION_LESS 105500) + set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 105500 AND Boost_VERSION VERSION_LESS 105600) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_COROUTINE_DEPENDENCIES context system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 105600 AND Boost_VERSION VERSION_LESS 105900) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_COROUTINE_DEPENDENCIES context system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_RANDOM_DEPENDENCIES system) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 105900 AND Boost_VERSION VERSION_LESS 106000) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_COROUTINE_DEPENDENCIES context system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_RANDOM_DEPENDENCIES system) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + elseif(NOT Boost_VERSION VERSION_LESS 106000 AND Boost_VERSION VERSION_LESS 106200) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_COROUTINE_DEPENDENCIES context system) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_RANDOM_DEPENDENCIES system) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + else() + message(WARNING "Imported targets not available for Boost version ${Boost_VERSION}") + set(_Boost_IMPORTED_TARGETS FALSE) + endif() + + string(TOUPPER ${component} uppercomponent) + set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE) + set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE) + + string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}") + if (NOT _boost_DEPS_STRING) + set(_boost_DEPS_STRING "(none)") + endif() + # message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}") +endfunction() + +# +# Determine if any missing dependencies require adding to the component list. +# +# Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component, +# plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be +# defined; FALSE if dependency information is unavailable). +# +# componentvar - the component list variable name +# +# +function(_Boost_MISSING_DEPENDENCIES componentvar) + # _boost_unprocessed_components - list of components requiring processing + # _boost_processed_components - components already processed (or currently being processed) + # _boost_new_components - new components discovered for future processing + # + list(APPEND _boost_unprocessed_components ${${componentvar}}) + + while(_boost_unprocessed_components) + list(APPEND _boost_processed_components ${_boost_unprocessed_components}) + foreach(component ${_boost_unprocessed_components}) + string(TOUPPER ${component} uppercomponent) + set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE) + _Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES) + set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE) + set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE) + foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES}) + list(FIND _boost_processed_components "${componentdep}" _boost_component_found) + list(FIND _boost_new_components "${componentdep}" _boost_component_new) + if (_boost_component_found EQUAL -1 AND _boost_component_new EQUAL -1) + list(APPEND _boost_new_components ${componentdep}) + endif() + endforeach() + endforeach() + set(_boost_unprocessed_components ${_boost_new_components}) + unset(_boost_new_components) + endwhile() + set(${componentvar} ${_boost_processed_components} PARENT_SCOPE) +endfunction() + +# # End functions/macros # #------------------------------------------------------------------------------- @@ -511,8 +816,12 @@ else() # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. + # + # Note: When adding a new Boost release, also update the dependency + # information in _Boost_COMPONENT_DEPENDENCIES. See the + # instructions at the top of _Boost_COMPONENT_DEPENDENCIES. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - + "1.61.0" "1.61" "1.60.0" "1.60" "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" @@ -562,6 +871,16 @@ "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}") endif() +# Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It +# will only contain any interface definitions on WIN32, but is created +# on all platforms to keep end user code free from platform dependent +# code. Also provide convenience targets to disable autolinking and +# enable dynamic linking. +if(NOT TARGET Boost::diagnostic_definitions) + add_library(Boost::diagnostic_definitions INTERFACE IMPORTED) + add_library(Boost::disable_autolinking INTERFACE IMPORTED) + add_library(Boost::dynamic_linking INTERFACE IMPORTED) +endif() if(WIN32) # In windows, automatic linking is performed, so you do not have # to specify the libraries. If you are linking to a dynamic @@ -581,6 +900,12 @@ # code to emit a #pragma message each time a library is selected # for linking. set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC") + set_target_properties(Boost::diagnostic_definitions PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC") + set_target_properties(Boost::disable_autolinking PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB") + set_target_properties(Boost::dynamic_linking PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK") endif() _Boost_CHECK_SPELLING(Boost_ROOT) @@ -979,6 +1304,17 @@ endif() endif() +# Additional components may be required via component dependencies. +# Add any missing components to the list. +_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS) + +# If thread is required, get the thread libs as a dependency +list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS) +if(NOT _Boost_THREAD_DEPENDENCY_LIBS EQUAL -1) + include(CMakeFindDependencyMacro) + find_dependency(Threads) +endif() + # If the user changed any of our control inputs flush previous results. if(_Boost_CHANGE_LIBDIR OR _Boost_CHANGE_LIBNAME) foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED}) @@ -1221,6 +1557,70 @@ endforeach() endif() +# ------------------------------------------------------------------------ +# Add imported targets +# ------------------------------------------------------------------------ + +if(Boost_FOUND AND _Boost_IMPORTED_TARGETS) + # For header-only libraries + if(NOT TARGET Boost::boost) + add_library(Boost::boost INTERFACE IMPORTED) + if(Boost_INCLUDE_DIRS) + set_target_properties(Boost::boost PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}") + endif() + endif() + + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + if(NOT TARGET Boost::${COMPONENT}) + string(TOUPPER ${COMPONENT} UPPERCOMPONENT) + if(Boost_${UPPERCOMPONENT}_FOUND) + if(Boost_USE_STATIC_LIBS) + add_library(Boost::${COMPONENT} STATIC IMPORTED) + else() + # Even if Boost_USE_STATIC_LIBS is OFF, we might have static + # libraries as a result. + add_library(Boost::${COMPONENT} UNKNOWN IMPORTED) + endif() + if(Boost_INCLUDE_DIRS) + set_target_properties(Boost::${COMPONENT} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}") + endif() + if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}") + set_target_properties(Boost::${COMPONENT} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}") + endif() + if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}") + set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(Boost::${COMPONENT} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}") + endif() + if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}") + set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(Boost::${COMPONENT} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}") + endif() + if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES) + unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES) + foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES}) + list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep}) + endforeach() + if(COMPONENT STREQUAL "thread") + list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads) + endif() + set_target_properties(Boost::${COMPONENT} PROPERTIES + INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}") + endif() + endif() + endif() + endforeach() +endif() + # ------------------------------------------------------------------------ # Notification to end user about what was found # ------------------------------------------------------------------------ diff -Nru cmake-3.4.1/Modules/FindCUDA.cmake cmake-3.5.0/Modules/FindCUDA.cmake --- cmake-3.4.1/Modules/FindCUDA.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindCUDA.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -653,6 +653,9 @@ # Support for arm cross compilation with CUDA 5.5 if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.") +# Support for aarch64 cross compilation with CUDA 7.0 +elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux" CACHE PATH "Toolkit target location.") else() set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.") endif() @@ -764,13 +767,9 @@ if (NOT APPLE) # Here is librt that has things such as, clock_gettime, shm_open, and shm_unlink. find_library(CUDA_rt_LIBRARY rt) - find_library(CUDA_dl_LIBRARY dl) if (NOT CUDA_rt_LIBRARY) message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") endif() - if (NOT CUDA_dl_LIBRARY) - message(WARNING "Expecting to find libdl for libcudart_static, but didn't find it.") - endif() endif() endif() endif() @@ -793,13 +792,10 @@ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) if (CUDA_rt_LIBRARY) list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) endif() - if (CUDA_dl_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_dl_LIBRARY}) - endif() if(APPLE) # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that # the static cuda runtime can find it at runtime. @@ -1460,6 +1456,11 @@ set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") endif() + set(_verbatim VERBATIM) + if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + # Build the generated file and dependency file ########################## add_custom_command( OUTPUT ${generated_file} @@ -1478,6 +1479,7 @@ -P "${custom_target_script}" WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" COMMENT "${cuda_build_comment_string}" + ${_verbatim} ) # Make sure the build system knows the file is generated. @@ -1589,6 +1591,11 @@ set(do_obj_build_rule FALSE) endif() + set(_verbatim VERBATIM) + if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + if (do_obj_build_rule) add_custom_command( OUTPUT ${output_file} @@ -1596,6 +1603,7 @@ COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} ${flags} COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + ${_verbatim} ) else() get_filename_component(output_file_dir "${output_file}" DIRECTORY) @@ -1605,6 +1613,7 @@ COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + ${_verbatim} ) endif() endif() diff -Nru cmake-3.4.1/Modules/FindDCMTK.cmake cmake-3.5.0/Modules/FindDCMTK.cmake --- cmake-3.4.1/Modules/FindDCMTK.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindDCMTK.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -2,17 +2,78 @@ # FindDCMTK # --------- # -# find DCMTK libraries and applications - -# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK +# Find DCMTK libraries and applications +# +# The module defines the following variables:: +# +# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK # DCMTK_LIBRARIES - Files to link against to use DCMTK # DCMTK_FOUND - If false, don't try to use DCMTK # DCMTK_DIR - (optional) Source directory for DCMTK # -# DCMTK_DIR can be used to make it simpler to find the various include -# directories and compiled libraries if you've just compiled it in the -# source tree. Just set it to the root of the tree where you extracted -# the source (default to /usr/include/dcmtk/) +# Compatibility +# ^^^^^^^^^^^^^ +# +# This module is able to find a version of DCMTK that does or does not export +# a *DCMTKConfig.cmake* file. It applies a two step process: +# +# * Step 1: Attempt to find DCMTK version providing a *DCMTKConfig.cmake* file. +# * Step 2: If step 1 failed, rely on *FindDCMTK.cmake* to set `DCMTK_*` variables details below. +# +# +# `Recent DCMTK +# `_ +# provides a *DCMTKConfig.cmake* :manual:`package configuration file +# `. To exclusively use the package configuration file +# (recommended when possible), pass the `NO_MODULE` option to +# :command:`find_package`. For example, `find_package(DCMTK NO_MODULE)`. +# This requires official DCMTK snapshot *3.6.1_20140617* or newer. +# +# +# Until all clients update to the more recent DCMTK, build systems will need +# to support different versions of DCMTK. +# +# On any given system, the following combinations of DCMTK versions could be +# considered: +# +# +--------+---------------------+-----------------------+-------------------+ +# | | SYSTEM DCMTK | LOCAL DCMTK | Supported ? | +# +--------+---------------------+-----------------------+-------------------+ +# | Case A | NA | [ ] DCMTKConfig | YES | +# +--------+---------------------+-----------------------+-------------------+ +# | Case B | NA | [X] DCMTKConfig | YES | +# +--------+---------------------+-----------------------+-------------------+ +# | Case C | [ ] DCMTKConfig | NA | YES | +# +--------+---------------------+-----------------------+-------------------+ +# | Case D | [X] DCMTKConfig | NA | YES | +# +--------+---------------------+-----------------------+-------------------+ +# | Case E | [ ] DCMTKConfig | [ ] DCMTKConfig | YES (*) | +# +--------+---------------------+-----------------------+-------------------+ +# | Case F | [X] DCMTKConfig | [ ] DCMTKConfig | NO | +# +--------+---------------------+-----------------------+-------------------+ +# | Case G | [ ] DCMTKConfig | [X] DCMTKConfig | YES | +# +--------+---------------------+-----------------------+-------------------+ +# | Case H | [X] DCMTKConfig | [X] DCMTKConfig | YES | +# +--------+---------------------+-----------------------+-------------------+ +# +# (*) See Troubleshooting section. +# +# Legend: +# +# NA ...............: Means that no System or Local DCMTK is available +# +# [ ] DCMTKConfig ..: Means that the version of DCMTK does NOT export a DCMTKConfig.cmake file. +# +# [X] DCMTKConfig ..: Means that the version of DCMTK exports a DCMTKConfig.cmake file. +# +# +# Troubleshooting +# ^^^^^^^^^^^^^^^ +# +# What to do if my project finds a different version of DCMTK? +# +# Remove DCMTK entry from the CMake cache per :command:`find_package` +# documentation. #============================================================================= # Copyright 2004-2009 Kitware, Inc. @@ -35,50 +96,142 @@ # Modified for EasyViz by Thomas Sondergaard. # -if(NOT DCMTK_FOUND AND NOT DCMTK_DIR) - set(DCMTK_DIR - "/usr/include/dcmtk/" - CACHE - PATH - "Root of DCMTK source tree (optional).") - mark_as_advanced(DCMTK_DIR) +set(_dcmtk_dir_description "The directory of DCMTK build or install tree.") + +# Ensure that DCMTK_DIR is set to a reasonable default value +# so that DCMTK libraries can be found on a standard Unix distribution. +# It also overwrite the value of DCMTK_DIR after this one has been +# set by a successful discovery of DCMTK by the unpatched FindDCMTK.cmake module +# distributed with CMake (as of 0167cea) +if(NOT DCMTK_DIR OR DCMTK_DIR STREQUAL "/usr/include/dcmtk") + set(DCMTK_DIR "/usr" CACHE PATH ${_dcmtk_dir_description} FORCE) +endif() + +set(_SAVED_DCMTK_DIR ${DCMTK_DIR}) + +# +# Step1: Attempt to find a version of DCMTK providing a DCMTKConfig.cmake file. +# +if(NOT DCMTK_FIND_QUIETLY) + message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake") +endif() +find_package(DCMTK QUIET NO_MODULE) +if(DCMTK_FOUND + AND NOT "x" STREQUAL "x${DCMTK_LIBRARIES}" + AND NOT "x" STREQUAL "x${DCMTK_INCLUDE_DIRS}") + + if(NOT DCMTK_FIND_QUIETLY) + message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - ok") + endif() + return() +else() + if(NOT DCMTK_FIND_QUIETLY) + message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - failed") + endif() endif() +if(NOT DCMTK_FIND_QUIETLY) + message(STATUS "Trying to find DCMTK relying on FindDCMTK.cmake") +endif() + +# Restore the value reset by the previous call to 'find_package(DCMTK QUIET NO_MODULE)' +set(DCMTK_DIR ${_SAVED_DCMTK_DIR} CACHE PATH ${_dcmtk_dir_description} FORCE) + + +# +# Step2: Attempt to find a version of DCMTK that does NOT provide a DCMTKConfig.cmake file. +# + +# prefer DCMTK_DIR over default system paths like /usr/lib +if(DCMTK_DIR) + set(CMAKE_PREFIX_PATH ${DCMTK_DIR}/lib ${CMAKE_PREFIX_PATH}) # this is given to FIND_LIBRARY or FIND_PATH +endif() +# Find all libraries, store debug and release separately foreach(lib - dcmdata - dcmimage - dcmimgle - dcmjpeg - dcmnet dcmpstat - dcmqrdb - dcmsign dcmsr + dcmsign dcmtls + dcmqrdb + dcmnet + dcmjpeg + dcmimage + dcmimgle + dcmdata + oflog + ofstd ijg12 ijg16 ijg8 - ofstd) + ) - find_library(DCMTK_${lib}_LIBRARY + # Find Release libraries + find_library(DCMTK_${lib}_LIBRARY_RELEASE ${lib} PATHS ${DCMTK_DIR}/${lib}/libsrc ${DCMTK_DIR}/${lib}/libsrc/Release - ${DCMTK_DIR}/${lib}/libsrc/Debug ${DCMTK_DIR}/${lib}/Release + ${DCMTK_DIR}/lib + ${DCMTK_DIR}/lib/Release + ${DCMTK_DIR}/dcmjpeg/lib${lib}/Release + NO_DEFAULT_PATH + ) + + # Find Debug libraries + find_library(DCMTK_${lib}_LIBRARY_DEBUG + ${lib}${DCMTK_CMAKE_DEBUG_POSTFIX} + PATHS + ${DCMTK_DIR}/${lib}/libsrc + ${DCMTK_DIR}/${lib}/libsrc/Debug ${DCMTK_DIR}/${lib}/Debug - ${DCMTK_DIR}/lib) + ${DCMTK_DIR}/lib + ${DCMTK_DIR}/lib/Debug + ${DCMTK_DIR}/dcmjpeg/lib${lib}/Debug + NO_DEFAULT_PATH + ) - mark_as_advanced(DCMTK_${lib}_LIBRARY) + mark_as_advanced(DCMTK_${lib}_LIBRARY_RELEASE) + mark_as_advanced(DCMTK_${lib}_LIBRARY_DEBUG) - if(DCMTK_${lib}_LIBRARY) - list(APPEND DCMTK_LIBRARIES ${DCMTK_${lib}_LIBRARY}) + # Add libraries to variable according to build type + if(DCMTK_${lib}_LIBRARY_RELEASE) + list(APPEND DCMTK_LIBRARIES optimized ${DCMTK_${lib}_LIBRARY_RELEASE}) + endif() + + if(DCMTK_${lib}_LIBRARY_DEBUG) + list(APPEND DCMTK_LIBRARIES debug ${DCMTK_${lib}_LIBRARY_DEBUG}) endif() endforeach() +set(CMAKE_THREAD_LIBS_INIT) +if(DCMTK_oflog_LIBRARY_RELEASE OR DCMTK_oflog_LIBRARY_DEBUG) + # Hack - Not having a DCMTKConfig.cmake file to read the settings from, we will attempt to + # find the library in all cases. + # Ideally, pthread library should be discovered only if DCMTK_WITH_THREADS is enabled. + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + find_package(Threads) +endif() + +if(CMAKE_THREAD_LIBS_INIT) + list(APPEND DCMTK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) +endif() + +# +# SPECIFIC CASE FOR DCMTK BUILD DIR as DCMTK_DIR +# (as opposed to a DCMTK install dir) +# Have to find the source directory. +if(EXISTS ${DCMTK_DIR}/CMakeCache.txt) + load_cache(${DCMTK_DIR} READ_WITH_PREFIX "EXT" + DCMTK_SOURCE_DIR) + if(NOT EXISTS ${EXTDCMTK_SOURCE_DIR}) + message(FATAL_ERROR + "DCMTK build directory references +nonexistant DCMTK source directory ${EXTDCMTK_SOURCE_DIR}") + endif() +endif() set(DCMTK_config_TEST_HEADER osconfig.h) set(DCMTK_dcmdata_TEST_HEADER dctypes.h) @@ -92,6 +245,10 @@ set(DCMTK_dcmsr_TEST_HEADER dsrtree.h) set(DCMTK_dcmtls_TEST_HEADER tlslayer.h) set(DCMTK_ofstd_TEST_HEADER ofstdinc.h) +set(DCMTK_oflog_TEST_HEADER oflog.h) +set(DCMTK_dcmjpls_TEST_HEADER djlsutil.h) + +set(DCMTK_INCLUDE_DIR_NAMES) foreach(dir config @@ -99,31 +256,47 @@ dcmimage dcmimgle dcmjpeg + dcmjpls dcmnet dcmpstat dcmqrdb dcmsign dcmsr dcmtls - ofstd) + ofstd + oflog) + if(EXTDCMTK_SOURCE_DIR) + set(SOURCE_DIR_PATH + ${EXTDCMTK_SOURCE_DIR}/${dir}/include/dcmtk/${dir}) + endif() find_path(DCMTK_${dir}_INCLUDE_DIR ${DCMTK_${dir}_TEST_HEADER} PATHS ${DCMTK_DIR}/${dir}/include ${DCMTK_DIR}/${dir} - ${DCMTK_DIR}/include/${dir} ${DCMTK_DIR}/include/dcmtk/${dir} ${DCMTK_DIR}/${dir}/include/dcmtk/${dir} + ${DCMTK_DIR}/include/${dir} + ${SOURCE_DIR_PATH} ) mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR) + list(APPEND DCMTK_INCLUDE_DIR_NAMES DCMTK_${dir}_INCLUDE_DIR) if(DCMTK_${dir}_INCLUDE_DIR) + # add the 'include' path so eg + #include "dcmtk/dcmimgle/dcmimage.h" + # works + get_filename_component(_include ${DCMTK_${dir}_INCLUDE_DIR} PATH) + get_filename_component(_include ${_include} PATH) list(APPEND DCMTK_INCLUDE_DIRS - ${DCMTK_${dir}_INCLUDE_DIR}) + ${DCMTK_${dir}_INCLUDE_DIR} + ${_include}) endif() endforeach() +list(APPEND DCMTK_INCLUDE_DIRS ${DCMTK_DIR}/include) + if(WIN32) list(APPEND DCMTK_LIBRARIES netapi32 wsock32) endif() @@ -137,21 +310,31 @@ mark_as_advanced(DCMTK_dcmtk_INCLUDE_DIR) endif() -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(DCMTK DEFAULT_MSG - DCMTK_config_INCLUDE_DIR - DCMTK_ofstd_INCLUDE_DIR - DCMTK_ofstd_LIBRARY - DCMTK_dcmdata_INCLUDE_DIR - DCMTK_dcmdata_LIBRARY - DCMTK_dcmimgle_INCLUDE_DIR - DCMTK_dcmimgle_LIBRARY) - # Compatibility: This variable is deprecated set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS}) -foreach(executable dcmdump dcmdjpeg dcmdrle) - string(TOUPPER ${executable} EXECUTABLE) - find_program(DCMTK_${EXECUTABLE}_EXECUTABLE ${executable} ${DCMTK_DIR}/bin) - mark_as_advanced(DCMTK_${EXECUTABLE}_EXECUTABLE) -endforeach() +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(DCMTK + REQUIRED_VARS ${DCMTK_INCLUDE_DIR_NAMES} DCMTK_LIBRARIES + FAIL_MESSAGE "Please set DCMTK_DIR and re-run configure") + +# Workaround bug in packaging of DCMTK 3.6.0 on Debian. +# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637687 +if(DCMTK_FOUND AND UNIX AND NOT APPLE) + include(CheckCXXSourceCompiles) + set(CMAKE_REQUIRED_FLAGS ) + set(CMAKE_REQUIRED_DEFINITIONS ) + set(CMAKE_REQUIRED_INCLUDES ${DCMTK_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${DCMTK_LIBRARIES}) + set(CMAKE_REQUIRED_QUIET ${DCMTK_FIND_QUIETLY}) + check_cxx_source_compiles("#include \n#include \nint main(int,char*[]){return 0;}" + DCMTK_HAVE_CONFIG_H_OPTIONAL + ) + if(NOT DCMTK_HAVE_CONFIG_H_OPTIONAL) + set(DCMTK_DEFINITIONS "HAVE_CONFIG_H") + endif() +endif() + +if(NOT DCMTK_FIND_QUIETLY) + message(STATUS "Trying to find DCMTK relying on FindDCMTK.cmake - ok") +endif() diff -Nru cmake-3.4.1/Modules/FindFLEX.cmake cmake-3.5.0/Modules/FindFLEX.cmake --- cmake-3.4.1/Modules/FindFLEX.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindFLEX.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -27,13 +27,17 @@ # # :: # -# FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS ]) +# FLEX_TARGET(Name FlexInput FlexOutput +# [COMPILE_FLAGS ] +# [DEFINES_FILE ] +# ) # # which creates a custom command to generate the file from # the file. If COMPILE_FLAGS option is specified, the next -# parameter is added to the flex command line. Name is an alias used to -# get details of this custom command. Indeed the macro defines the -# following variables: +# parameter is added to the flex command line. If flex is configured to +# output a header file, the DEFINES_FILE option may be used to specify its +# name. Name is an alias used to get details of this custom command. +# Indeed the macro defines the following variables: # # :: # @@ -41,6 +45,7 @@ # FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an # alias for FlexOutput # FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput} +# FLEX_${Name}_OUTPUT_HEADER - the header flex output, if any. # # # @@ -113,6 +118,8 @@ mark_as_advanced(FL_LIBRARY FLEX_INCLUDE_DIR) +include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake) + set(FLEX_INCLUDE_DIRS ${FLEX_INCLUDE_DIR}) set(FLEX_LIBRARIES ${FL_LIBRARY}) @@ -145,31 +152,55 @@ #============================================================ # macro(FLEX_TARGET Name Input Output) - set(FLEX_TARGET_usage "FLEX_TARGET( [COMPILE_FLAGS ]") - if(${ARGC} GREATER 3) - if(${ARGC} EQUAL 5) - if("${ARGV3}" STREQUAL "COMPILE_FLAGS") - set(FLEX_EXECUTABLE_opts "${ARGV4}") - separate_arguments(FLEX_EXECUTABLE_opts) - else() - message(SEND_ERROR ${FLEX_TARGET_usage}) - endif() + set(FLEX_TARGET_outputs "${Output}") + set(FLEX_EXECUTABLE_opts "") + + set(FLEX_TARGET_PARAM_OPTIONS) + set(FLEX_TARGET_PARAM_ONE_VALUE_KEYWORDS + COMPILE_FLAGS + DEFINES_FILE + ) + set(FLEX_TARGET_PARAM_MULTI_VALUE_KEYWORDS) + + cmake_parse_arguments( + FLEX_TARGET_ARG + "${FLEX_TARGET_PARAM_OPTIONS}" + "${FLEX_TARGET_PARAM_ONE_VALUE_KEYWORDS}" + "${FLEX_TARGET_MULTI_VALUE_KEYWORDS}" + ${ARGN} + ) + + set(FLEX_TARGET_usage "FLEX_TARGET( [COMPILE_FLAGS ] [DEFINES_FILE ]") + + if(NOT "${FLEX_TARGET_ARG_UNPARSED_ARGUMENTS}" STREQUAL "") + message(SEND_ERROR ${FLEX_TARGET_usage}) + else() + if(NOT "${FLEX_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "") + set(FLEX_EXECUTABLE_opts "${FLEX_TARGET_ARG_COMPILE_FLAGS}") + separate_arguments(FLEX_EXECUTABLE_opts) + endif() + if(NOT "${FLEX_TARGET_ARG_DEFINES_FILE}" STREQUAL "") + list(APPEND FLEX_TARGET_outputs "${FLEX_TARGET_ARG_DEFINES_FILE}") + list(APPEND FLEX_EXECUTABLE_opts --header-file=${FLEX_TARGET_ARG_DEFINES_FILE}) + endif() + + add_custom_command(OUTPUT ${FLEX_TARGET_outputs} + COMMAND ${FLEX_EXECUTABLE} + ARGS ${FLEX_EXECUTABLE_opts} -o${Output} ${Input} + DEPENDS ${Input} + COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + + set(FLEX_${Name}_DEFINED TRUE) + set(FLEX_${Name}_OUTPUTS ${Output}) + set(FLEX_${Name}_INPUT ${Input}) + set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts}) + if("${FLEX_TARGET_ARG_DEFINES_FILE}" STREQUAL "") + set(FLEX_${Name}_OUTPUT_HEADER "") else() - message(SEND_ERROR ${FLEX_TARGET_usage}) + set(FLEX_${Name}_OUTPUT_HEADER ${FLEX_TARGET_ARG_DEFINES_FILE}) endif() endif() - - add_custom_command(OUTPUT ${Output} - COMMAND ${FLEX_EXECUTABLE} - ARGS ${FLEX_EXECUTABLE_opts} -o${Output} ${Input} - DEPENDS ${Input} - COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - - set(FLEX_${Name}_DEFINED TRUE) - set(FLEX_${Name}_OUTPUTS ${Output}) - set(FLEX_${Name}_INPUT ${Input}) - set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts}) endmacro() #============================================================ @@ -181,11 +212,11 @@ macro(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget) if(NOT FLEX_${FlexTarget}_OUTPUTS) - message(SEND_ERROR "Flex target `${FlexTarget}' does not exists.") + message(SEND_ERROR "Flex target `${FlexTarget}' does not exist.") endif() if(NOT BISON_${BisonTarget}_OUTPUT_HEADER) - message(SEND_ERROR "Bison target `${BisonTarget}' does not exists.") + message(SEND_ERROR "Bison target `${BisonTarget}' does not exist.") endif() set_source_files_properties(${FLEX_${FlexTarget}_OUTPUTS} diff -Nru cmake-3.4.1/Modules/FindGit.cmake cmake-3.5.0/Modules/FindGit.cmake --- cmake-3.4.1/Modules/FindGit.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindGit.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -2,27 +2,26 @@ # FindGit # ------- # -# -# # The module defines the following variables: # -# :: -# -# GIT_EXECUTABLE - path to git command line client -# GIT_FOUND - true if the command line client was found -# GIT_VERSION_STRING - the version of git found (since CMake 2.8.8) +# ``GIT_EXECUTABLE`` +# Path to Git command-line client. +# ``Git_FOUND``, ``GIT_FOUND`` +# True if the Git command-line client was found. +# ``GIT_VERSION_STRING`` +# The version of Git found. # # Example usage: # -# :: +# .. code-block:: cmake # # find_package(Git) -# if(GIT_FOUND) -# message("git found: ${GIT_EXECUTABLE}") +# if(Git_FOUND) +# message("Git found: ${GIT_EXECUTABLE}") # endif() #============================================================================= -# Copyright 2010 Kitware, Inc. +# Copyright 2010-2016 Kitware, Inc. # Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); @@ -48,17 +47,22 @@ # GitHub search path for Windows set(github_path "$ENV{LOCALAPPDATA}/Github/PortableGit*/bin") file(GLOB github_path "${github_path}") + # SourceTree search path for Windows + set(_git_sourcetree_path "$ENV{LOCALAPPDATA}/Atlassian/SourceTree/git_local/bin") endif() endif() find_program(GIT_EXECUTABLE NAMES ${git_names} - PATHS ${github_path} + PATHS ${github_path} ${_git_sourcetree_path} PATH_SUFFIXES Git/cmd Git/bin - DOC "git command line client" + DOC "Git command line client" ) mark_as_advanced(GIT_EXECUTABLE) +unset(git_names) +unset(_git_sourcetree_path) + if(GIT_EXECUTABLE) execute_process(COMMAND ${GIT_EXECUTABLE} --version OUTPUT_VARIABLE git_version @@ -70,7 +74,7 @@ unset(git_version) endif() -# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if +# Handle the QUIETLY and REQUIRED arguments and set Git_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff -Nru cmake-3.4.1/Modules/FindGTest.cmake cmake-3.5.0/Modules/FindGTest.cmake --- cmake-3.4.1/Modules/FindGTest.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindGTest.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -4,88 +4,89 @@ # # Locate the Google C++ Testing Framework. # -# Defines the following variables: +# Imported targets +# ^^^^^^^^^^^^^^^^ # -# :: -# -# GTEST_FOUND - Found the Google Testing framework -# GTEST_INCLUDE_DIRS - Include directories -# -# -# -# Also defines the library variables below as normal variables. These -# contain debug/optimized keywords when a debugging library is found. -# -# :: +# This module defines the following :prop_tgt:`IMPORTED` targets: # -# GTEST_BOTH_LIBRARIES - Both libgtest & libgtest-main -# GTEST_LIBRARIES - libgtest -# GTEST_MAIN_LIBRARIES - libgtest-main +# ``GTest::GTest`` +# The Google Test ``gtest`` library, if found; adds Thread::Thread +# automatically +# ``GTest::Main`` +# The Google Test ``gtest_main`` library, if found # # +# Result variables +# ^^^^^^^^^^^^^^^^ # -# Accepts the following variables as input: -# -# :: +# This module will set the following variables in your project: # -# GTEST_ROOT - (as a CMake or environment variable) -# The root directory of the gtest install prefix +# ``GTEST_FOUND`` +# Found the Google Testing framework +# ``GTEST_INCLUDE_DIRS`` +# the directory containing the Google Test headers # +# The library variables below are set as normal variables. These +# contain debug/optimized keywords when a debugging library is found. # -# -# :: -# -# GTEST_MSVC_SEARCH - If compiling with MSVC, this variable can be set to -# "MD" or "MT" to enable searching a GTest build tree -# (defaults: "MD") -# +# ``GTEST_LIBRARIES`` +# The Google Test ``gtest`` library; note it also requires linking +# with an appropriate thread library +# ``GTEST_MAIN_LIBRARIES`` +# The Google Test ``gtest_main`` library +# ``GTEST_BOTH_LIBRARIES`` +# Both ``gtest`` and ``gtest_main`` +# +# Cache variables +# ^^^^^^^^^^^^^^^ +# +# The following cache variables may also be set: +# +# ``GTEST_ROOT`` +# The root directory of the Google Test installation (may also be +# set as an environment variable) +# ``GTEST_MSVC_SEARCH`` +# If compiling with MSVC, this variable can be set to ``MD`` or +# ``MT`` (the default) to enable searching a GTest build tree # # -# Example Usage: +# Example usage +# ^^^^^^^^^^^^^ # # :: # # enable_testing() # find_package(GTest REQUIRED) -# include_directories(${GTEST_INCLUDE_DIRS}) -# -# -# -# :: # # add_executable(foo foo.cc) -# target_link_libraries(foo ${GTEST_BOTH_LIBRARIES}) -# -# -# -# :: +# target_link_libraries(foo GTest::GTest GTest::Main) # # add_test(AllTestsInFoo foo) # # -# -# +# Deeper integration with CTest +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # # If you would like each Google test to show up in CTest as a test you -# may use the following macro. NOTE: It will slow down your tests by -# running an executable for each test and test fixture. You will also -# have to rerun CMake after adding or removing tests or test fixtures. -# -# GTEST_ADD_TESTS(executable extra_args ARGN) -# -# :: +# may use the following macro:: # -# executable = The path to the test executable -# extra_args = Pass a list of extra arguments to be passed to -# executable enclosed in quotes (or "" for none) -# ARGN = A list of source files to search for tests & test -# fixtures. Or AUTO to find them from executable target. +# GTEST_ADD_TESTS(executable extra_args files...) # +# ``executable`` +# the path to the test executable +# ``extra_args`` +# a list of extra arguments to be passed to executable enclosed in +# quotes (or ``""`` for none) +# ``files...`` +# a list of source files to search for tests and test fixtures. Or +# ``AUTO`` to find them from executable target +# +# However, note that this macro will slow down your tests by running +# an executable for each test and test fixture. You will also have to +# re-run CMake after adding or removing tests or test fixtures. # +# Example usage:: # -# :: -# -# Example: # set(FooTestArgs --foo 1 --bar 2) # add_executable(FooTest FooUnitTest.cc) # GTEST_ADD_TESTS(FooTest "${FooTestArgs}" AUTO) @@ -208,5 +209,60 @@ _gtest_append_debugs(GTEST_LIBRARIES GTEST_LIBRARY) _gtest_append_debugs(GTEST_MAIN_LIBRARIES GTEST_MAIN_LIBRARY) set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) -endif() + include(CMakeFindDependencyMacro) + find_dependency(Threads) + + if(NOT TARGET GTest::GTest) + add_library(GTest::GTest UNKNOWN IMPORTED) + set_target_properties(GTest::GTest PROPERTIES + INTERFACE_LINK_LIBRARIES "Threads::Threads") + if(GTEST_INCLUDE_DIRS) + set_target_properties(GTest::GTest PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}") + endif() + if(EXISTS "${GTEST_LIBRARY}") + set_target_properties(GTest::GTest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GTEST_LIBRARY}") + endif() + if(EXISTS "${GTEST_LIBRARY_DEBUG}") + set_property(TARGET GTest::GTest APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(GTest::GTest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${GTEST_LIBRARY_DEBUG}") + endif() + if(EXISTS "${GTEST_LIBRARY_RELEASE}") + set_property(TARGET GTest::GTest APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(GTest::GTest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${GTEST_LIBRARY_RELEASE}") + endif() + endif() + if(NOT TARGET GTest::Main) + add_library(GTest::Main UNKNOWN IMPORTED) + set_target_properties(GTest::Main PROPERTIES + INTERFACE_LINK_LIBRARIES "GTest::GTest") + if(EXISTS "${GTEST_MAIN_LIBRARY}") + set_target_properties(GTest::Main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GTEST_MAIN_LIBRARY}") + endif() + if(EXISTS "${GTEST_MAIN_LIBRARY_DEBUG}") + set_property(TARGET GTest::Main APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(GTest::Main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${GTEST_MAIN_LIBRARY_DEBUG}") + endif() + if(EXISTS "${GTEST_MAIN_LIBRARY_RELEASE}") + set_property(TARGET GTest::Main APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(GTest::Main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${GTEST_MAIN_LIBRARY_RELEASE}") + endif() + endif() +endif() diff -Nru cmake-3.4.1/Modules/FindGTK2.cmake cmake-3.5.0/Modules/FindGTK2.cmake --- cmake-3.4.1/Modules/FindGTK2.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindGTK2.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -34,6 +34,7 @@ # GTK2_FOUND - Were all of your specified components found? # GTK2_INCLUDE_DIRS - All include directories # GTK2_LIBRARIES - All libraries +# GTK2_TARGETS - All imported targets # GTK2_DEFINITIONS - Additional compiler flags # # @@ -202,6 +203,43 @@ endif() endfunction() + +#============================================================= +# _GTK2_SIGCXX_GET_VERSION +# Internal function to parse the version number in +# sigc++config.h +# _OUT_major = Major version number +# _OUT_minor = Minor version number +# _OUT_micro = Micro version number +# _sigcxxversion_hdr = Header file to parse +#============================================================= + +function(_GTK2_SIGCXX_GET_VERSION _OUT_major _OUT_minor _OUT_micro _sigcxxversion_hdr) + file(STRINGS ${_sigcxxversion_hdr} _contents REGEX "#define SIGCXX_M[A-Z]+_VERSION[ \t]+") + if(_contents) + string(REGEX REPLACE ".*#define SIGCXX_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_major} "${_contents}") + string(REGEX REPLACE ".*#define SIGCXX_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_minor} "${_contents}") + string(REGEX REPLACE ".*#define SIGCXX_MICRO_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_micro} "${_contents}") + + if(NOT ${_OUT_major} MATCHES "[0-9]+") + message(FATAL_ERROR "Version parsing failed for SIGCXX_MAJOR_VERSION!") + endif() + if(NOT ${_OUT_minor} MATCHES "[0-9]+") + message(FATAL_ERROR "Version parsing failed for SIGCXX_MINOR_VERSION!") + endif() + if(NOT ${_OUT_micro} MATCHES "[0-9]+") + message(FATAL_ERROR "Version parsing failed for SIGCXX_MICRO_VERSION!") + endif() + + set(${_OUT_major} ${${_OUT_major}} PARENT_SCOPE) + set(${_OUT_minor} ${${_OUT_minor}} PARENT_SCOPE) + set(${_OUT_micro} ${${_OUT_micro}} PARENT_SCOPE) + else() + message(FATAL_ERROR "Include file ${_gtkversion_hdr} does not exist") + endif() +endfunction() + + #============================================================= # _GTK2_FIND_INCLUDE_DIR # Internal function to find the GTK include directories @@ -513,6 +551,9 @@ add_library(GTK2::${_basename} UNKNOWN IMPORTED) + set(GTK2_TARGETS ${GTK2_TARGETS} GTK2::${_basename}) + set(GTK2_TARGETS ${GTK2_TARGETS} PARENT_SCOPE) + if(GTK2_${_var}_LIBRARY_RELEASE) set_property(TARGET GTK2::${_basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_property(TARGET GTK2::${_basename} PROPERTY IMPORTED_LOCATION_RELEASE "${GTK2_${_var}_LIBRARY_RELEASE}" ) @@ -565,6 +606,7 @@ set(GTK2_FOUND) set(GTK2_INCLUDE_DIRS) set(GTK2_LIBRARIES) +set(GTK2_TARGETS) set(GTK2_DEFINITIONS) if(NOT GTK2_FIND_COMPONENTS) @@ -734,6 +776,27 @@ _GTK2_FIND_INCLUDE_DIR(SIGC++CONFIG sigc++config.h) _GTK2_FIND_LIBRARY (SIGC++ sigc true true) _GTK2_ADD_TARGET (SIGC++) + # Since sigc++ 2.5.1 c++11 support is required + if(GTK2_SIGC++CONFIG_INCLUDE_DIR) + _GTK2_SIGCXX_GET_VERSION(GTK2_SIGC++_VERSION_MAJOR + GTK2_SIGC++_VERSION_MINOR + GTK2_SIGC++_VERSION_MICRO + ${GTK2_SIGC++CONFIG_INCLUDE_DIR}/sigc++config.h) + if(NOT ${GTK2_SIGC++_VERSION_MAJOR}.${GTK2_SIGC++_VERSION_MINOR}.${GTK2_SIGC++_VERSION_MICRO} VERSION_LESS 2.5.1) + # These are the features needed by clients in order to include the + # project headers: + set_property(TARGET GTK2::sigc++ + PROPERTY INTERFACE_COMPILE_FEATURES cxx_alias_templates + cxx_auto_type + cxx_decltype + cxx_deleted_functions + cxx_noexcept + cxx_nullptr + cxx_right_angle_brackets + cxx_rvalue_references + cxx_variadic_templates) + endif() + endif() _GTK2_FIND_INCLUDE_DIR(GLIBMM glibmm.h) _GTK2_FIND_INCLUDE_DIR(GLIBMMCONFIG glibmmconfig.h) @@ -882,6 +945,11 @@ endif() endforeach() +if(GTK2_USE_IMPORTED_TARGETS) + set(GTK2_LIBRARIES ${GTK2_TARGETS}) +endif() + + if(_GTK2_did_we_find_everything AND NOT GTK2_VERSION_CHECK_FAILED) set(GTK2_FOUND true) else() @@ -893,6 +961,7 @@ set(GTK2_VERSION_PATCH) set(GTK2_INCLUDE_DIRS) set(GTK2_LIBRARIES) + set(GTK2_TARGETS) set(GTK2_DEFINITIONS) endif() diff -Nru cmake-3.4.1/Modules/FindJava.cmake cmake-3.5.0/Modules/FindJava.cmake --- cmake-3.4.1/Modules/FindJava.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindJava.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -228,12 +228,12 @@ endif() elseif(component STREQUAL "IdlJ") list(APPEND _JAVA_REQUIRED_VARS Java_IDLJ_EXECUTABLE) - if(Java_IdlJ_EXECUTABLE) - set(Java_Extra_FOUND TRUE) + if(Java_IDLJ_EXECUTABLE) + set(Java_IdlJ_FOUND TRUE) endif() elseif(component STREQUAL "JarSigner") list(APPEND _JAVA_REQUIRED_VARS Java_JARSIGNER_EXECUTABLE) - if(Java_IDLJ_EXECUTABLE) + if(Java_JARSIGNER_EXECUTABLE) set(Java_JarSigner_FOUND TRUE) endif() else() diff -Nru cmake-3.4.1/Modules/FindJNI.cmake cmake-3.5.0/Modules/FindJNI.cmake --- cmake-3.4.1/Modules/FindJNI.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindJNI.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -63,7 +63,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") set(_java_libarch "ppc64" "ppc") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") - set(_java_libarch "ppc") + set(_java_libarch "ppc" "ppc64") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc") # Both flavours can run on the same processor set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9") @@ -271,7 +271,8 @@ ${JAVA_AWT_INCLUDE_DIRECTORIES} ) -find_path(JAVA_INCLUDE_PATH2 jni_md.h +find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h + PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/darwin ${JAVA_INCLUDE_PATH}/win32 @@ -281,6 +282,7 @@ ${JAVA_INCLUDE_PATH}/solaris ${JAVA_INCLUDE_PATH}/hp-ux ${JAVA_INCLUDE_PATH}/alpha + ${JAVA_INCLUDE_PATH}/aix ) find_path(JAVA_AWT_INCLUDE_PATH jawt.h diff -Nru cmake-3.4.1/Modules/FindOpenAL.cmake cmake-3.5.0/Modules/FindOpenAL.cmake --- cmake-3.4.1/Modules/FindOpenAL.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindOpenAL.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -79,11 +79,17 @@ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] ) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(_OpenAL_ARCH_DIR libs/Win64) +else() + set(_OpenAL_ARCH_DIR libs/Win32) +endif() + find_library(OPENAL_LIBRARY NAMES OpenAL al openal OpenAL32 HINTS ENV OPENALDIR - PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 + PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR} PATHS ~/Library/Frameworks /Library/Frameworks @@ -94,6 +100,7 @@ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] ) +unset(_OpenAL_ARCH_DIR) # handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if # all listed variables are TRUE diff -Nru cmake-3.4.1/Modules/FindOpenGL.cmake cmake-3.5.0/Modules/FindOpenGL.cmake --- cmake-3.4.1/Modules/FindOpenGL.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindOpenGL.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -71,9 +71,11 @@ elseif (APPLE) - find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX") - find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX") - find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") + # The OpenGL.framework provides both gl and glu + find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X") + find_library(OPENGL_glu_LIBRARY OpenGL DOC + "GLU library for OS X (usually same as OpenGL library)") + find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X") list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR) else() @@ -149,7 +151,9 @@ set( OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES}) if(OPENGL_glu_LIBRARY) set( OPENGL_GLU_FOUND "YES" ) - set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} ) + if(NOT "${OPENGL_glu_LIBRARY}" STREQUAL "${OPENGL_gl_LIBRARY}") + set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} ) + endif() else() set( OPENGL_GLU_FOUND "NO" ) endif() diff -Nru cmake-3.4.1/Modules/FindOpenMP.cmake cmake-3.5.0/Modules/FindOpenMP.cmake --- cmake-3.4.1/Modules/FindOpenMP.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindOpenMP.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -50,6 +50,8 @@ " " #GNU "-fopenmp" + #Clang + "-fopenmp=libomp" #Microsoft Visual Studio "/openmp" #Intel windows @@ -67,6 +69,7 @@ ) set(OMP_FLAG_GNU "-fopenmp") + set(OMP_FLAG_Clang "-fopenmp=libomp") set(OMP_FLAG_HP "+Oopenmp") if(WIN32) set(OMP_FLAG_Intel "-Qopenmp") diff -Nru cmake-3.4.1/Modules/FindOpenSSL.cmake cmake-3.5.0/Modules/FindOpenSSL.cmake --- cmake-3.4.1/Modules/FindOpenSSL.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindOpenSSL.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -37,6 +37,7 @@ # # Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation. # Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries. +# Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib. #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -113,7 +114,7 @@ # /MD and /MDd are the standard values - if someone wants to use # others, the libnames have to change here too # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b - # TODO: handle /MT and static lib + # enable OPENSSL_MSVC_STATIC_RT to get the libs build /MT (Multithreaded no-DLL) # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix: # * MD for dynamic-release # * MDd for dynamic-debug @@ -126,6 +127,12 @@ # ssleay32MD.lib is identical to ../ssleay32.lib # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static + if (OPENSSL_MSVC_STATIC_RT) + set(_OPENSSL_MSVC_RT_MODE "MT") + else () + set(_OPENSSL_MSVC_RT_MODE "MD") + endif () + if(OPENSSL_USE_STATIC_LIBS) set(_OPENSSL_PATH_SUFFIXES "lib" @@ -142,7 +149,7 @@ find_library(LIB_EAY_DEBUG NAMES - libeay32MDd + libeay32${_OPENSSL_MSVC_RT_MODE}d libeay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -151,7 +158,7 @@ find_library(LIB_EAY_RELEASE NAMES - libeay32MD + libeay32${_OPENSSL_MSVC_RT_MODE} libeay32 ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -160,7 +167,7 @@ find_library(SSL_EAY_DEBUG NAMES - ssleay32MDd + ssleay32${_OPENSSL_MSVC_RT_MODE}d ssleay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -169,7 +176,7 @@ find_library(SSL_EAY_RELEASE NAMES - ssleay32MD + ssleay32${_OPENSSL_MSVC_RT_MODE} ssleay32 ssl ${_OPENSSL_ROOT_HINTS_AND_PATHS} @@ -193,12 +200,8 @@ set(OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} ) elseif(MINGW) # same player, for MinGW - set(LIB_EAY_NAMES libeay32) - set(SSL_EAY_NAMES ssleay32) - if(CMAKE_CROSSCOMPILING) - list(APPEND LIB_EAY_NAMES crypto) - list(APPEND SSL_EAY_NAMES ssl) - endif() + set(LIB_EAY_NAMES crypto libeay32) + set(SSL_EAY_NAMES ssl ssleay32) find_library(LIB_EAY NAMES ${LIB_EAY_NAMES} @@ -318,7 +321,7 @@ if (OPENSSL_INCLUDE_DIR) if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str - REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") # The version number is encoded as 0xMNNFFPPS: major minor fix patch status # The status gives if this is a developer or prerelease and is ignored here. diff -Nru cmake-3.4.1/Modules/FindPkgConfig.cmake cmake-3.5.0/Modules/FindPkgConfig.cmake --- cmake-3.4.1/Modules/FindPkgConfig.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindPkgConfig.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -238,8 +238,8 @@ 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}) + 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() @@ -263,6 +263,7 @@ endif() endif() list(APPEND _lib_dirs "lib/pkgconfig") + list(APPEND _lib_dirs "share/pkgconfig") # Check if directories exist and eventually append them to the # pkgconfig path list @@ -284,7 +285,7 @@ string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}") string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}") endif() - set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path}) + set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path}") endif() # Unset variables @@ -328,7 +329,7 @@ if (_pkg_check_modules_pkg_op) list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}") else() - list(APPEND _pkg_check_modules_exist_query --exists) + list(APPEND _pkg_check_modules_exist_query --exists --print-errors --short-errors) endif() _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION) @@ -342,12 +343,14 @@ # execute the query execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query} - RESULT_VARIABLE _pkgconfig_retval) + RESULT_VARIABLE _pkgconfig_retval + ERROR_VARIABLE _pkgconfig_error + ERROR_STRIP_TRAILING_WHITESPACE) # evaluate result and tell failures if (_pkgconfig_retval) if(NOT ${_is_silent}) - message(STATUS " Package '${_pkg_check_modules_pkg}' not found") + message(STATUS " ${_pkgconfig_error}") endif() set(_pkg_check_modules_failed 1) @@ -379,6 +382,9 @@ pkg_get_variable("${_pkg_check_prefix}_PREFIX" ${_pkg_check_modules_pkg} "prefix") pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir") pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir") + foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR) + _pkgconfig_set("${_pkg_check_modules_pkg}_${variable}" "${${_pkg_check_modules_pkg}_${variable}}") + endforeach () if (NOT ${_is_silent}) message(STATUS " Found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}") @@ -398,7 +404,7 @@ if(NOT "${_extra_paths}" STREQUAL "") # Restore the environment variable - set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path}) + set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path_old}") endif() unset(_extra_paths) diff -Nru cmake-3.4.1/Modules/FindPNG.cmake cmake-3.5.0/Modules/FindPNG.cmake --- cmake-3.4.1/Modules/FindPNG.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindPNG.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -2,13 +2,20 @@ # FindPNG # ------- # -# Find the native PNG includes and library +# Find libpng, the official reference library for the PNG image format. # +# Imported targets +# ^^^^^^^^^^^^^^^^ # +# This module defines the following :prop_tgt:`IMPORTED` target: # -# This module searches libpng, the library for working with PNG images. +# ``PNG::PNG`` +# The libpng library, if found. # -# It defines the following variables +# Result variables +# ^^^^^^^^^^^^^^^^ +# +# This module will set the following variables in your project: # # ``PNG_INCLUDE_DIRS`` # where to find png.h, etc. @@ -22,19 +29,22 @@ # ``PNG_VERSION_STRING`` # the version of the PNG library found (since CMake 2.8.8) # -# Also defined, but not for general use are +# Obsolete variables +# ^^^^^^^^^^^^^^^^^^ +# +# The following variables may also be set, for backwards compatibility: # # ``PNG_LIBRARY`` # where to find the PNG library. -# -# For backward compatiblity the variable PNG_INCLUDE_DIR is also set. -# It has the same value as PNG_INCLUDE_DIRS. +# ``PNG_INCLUDE_DIR`` +# where to find the PNG headers (same as PNG_INCLUDE_DIRS) # # Since PNG depends on the ZLib compression library, none of the above # will be defined unless ZLib can be found. #============================================================================= # Copyright 2002-2009 Kitware, Inc. +# Copyright 2016 Raumfeld # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -105,6 +115,32 @@ endif() endif () + if(NOT TARGET PNG::PNG) + add_library(PNG::PNG UNKNOWN IMPORTED) + set_target_properties(PNG::PNG PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${PNG_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) + if(EXISTS "${PNG_LIBRARY}") + set_target_properties(PNG::PNG PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${PNG_LIBRARY}") + endif() + if(EXISTS "${PNG_LIBRARY_DEBUG}") + set_property(TARGET PNG::PNG APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(PNG::PNG PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}") + endif() + if(EXISTS "${PNG_LIBRARY_RELEASE}") + set_property(TARGET PNG::PNG APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(PNG::PNG PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION_RELEASE "${PNG_LIBRARY_RELEASE}") + endif() + endif() endif () if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h") diff -Nru cmake-3.4.1/Modules/FindProtobuf.cmake cmake-3.5.0/Modules/FindProtobuf.cmake --- cmake-3.4.1/Modules/FindProtobuf.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindProtobuf.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -305,7 +305,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROTOBUF DEFAULT_MSG +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf DEFAULT_MSG PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR) if(PROTOBUF_FOUND) diff -Nru cmake-3.4.1/Modules/FindPythonInterp.cmake cmake-3.5.0/Modules/FindPythonInterp.cmake --- cmake-3.4.1/Modules/FindPythonInterp.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindPythonInterp.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -28,9 +28,10 @@ # for Python. You need to set this variable before calling # 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. +# If calling both ``find_package(PythonInterp)`` and +# ``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. diff -Nru cmake-3.4.1/Modules/FindPythonLibs.cmake cmake-3.5.0/Modules/FindPythonLibs.cmake --- cmake-3.4.1/Modules/FindPythonLibs.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindPythonLibs.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -32,9 +32,10 @@ # PYTHON_LIBRARY - path to the python library # 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. +# If calling both ``find_package(PythonInterp)`` and +# ``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 2001-2009 Kitware, Inc. diff -Nru cmake-3.4.1/Modules/FindTIFF.cmake cmake-3.5.0/Modules/FindTIFF.cmake --- cmake-3.4.1/Modules/FindTIFF.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindTIFF.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -2,24 +2,43 @@ # FindTIFF # -------- # -# Find TIFF library +# Find the TIFF library (libtiff). # -# Find the native TIFF includes and library This module defines +# Imported targets +# ^^^^^^^^^^^^^^^^ # -# :: +# This module defines the following :prop_tgt:`IMPORTED` targets: # -# TIFF_INCLUDE_DIR, where to find tiff.h, etc. -# TIFF_LIBRARIES, libraries to link against to use TIFF. -# TIFF_FOUND, If false, do not try to use TIFF. +# ``TIFF::TIFF`` +# The TIFF library, if found. # -# also defined, but not for general use are +# Result variables +# ^^^^^^^^^^^^^^^^ # -# :: +# This module will set the following variables in your project: # -# TIFF_LIBRARY, where to find the TIFF library. +# ``TIFF_FOUND`` +# true if the TIFF headers and libraries were found +# ``TIFF_INCLUDE_DIR`` +# the directory containing the TIFF headers +# ``TIFF_INCLUDE_DIRS`` +# the directory containing the TIFF headers +# ``TIFF_LIBRARIES`` +# TIFF libraries to be linked +# +# Cache variables +# ^^^^^^^^^^^^^^^ +# +# The following cache variables may also be set: +# +# ``TIFF_INCLUDE_DIR`` +# the directory containing the TIFF headers +# ``TIFF_LIBRARY`` +# the path to the TIFF library #============================================================================= # Copyright 2002-2009 Kitware, Inc. +# Copyright 2015 University of Dundee # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -65,7 +84,35 @@ VERSION_VAR TIFF_VERSION_STRING) if(TIFF_FOUND) - set( TIFF_LIBRARIES ${TIFF_LIBRARY} ) + set(TIFF_LIBRARIES ${TIFF_LIBRARY}) + set(TIFF_INCLUDE_DIRS "${TIFF_INCLUDE_DIR}") + + if(NOT TARGET TIFF::TIFF) + add_library(TIFF::TIFF UNKNOWN IMPORTED) + if(TIFF_INCLUDE_DIRS) + set_target_properties(TIFF::TIFF PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${TIFF_INCLUDE_DIRS}") + endif() + if(EXISTS "${TIFF_LIBRARY}") + set_target_properties(TIFF::TIFF PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${TIFF_LIBRARY}") + endif() + if(EXISTS "${TIFF_LIBRARY_DEBUG}") + set_property(TARGET TIFF::TIFF APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(TIFF::TIFF PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${TIFF_LIBRARY_DEBUG}") + endif() + if(EXISTS "${TIFF_LIBRARY_RELEASE}") + set_property(TARGET TIFF::TIFF APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(TIFF::TIFF PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION_RELEASE "${TIFF_LIBRARY_RELEASE}") + endif() + endif() endif() mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY) diff -Nru cmake-3.4.1/Modules/FindwxWidgets.cmake cmake-3.5.0/Modules/FindwxWidgets.cmake --- cmake-3.4.1/Modules/FindwxWidgets.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindwxWidgets.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -188,18 +188,6 @@ set(wxWidgets_LIBRARY_DIRS "") set(wxWidgets_CXX_FLAGS "") -# Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on -# the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM -# to prevent UsewxWidgets.cmake from using SYSTEM. -# -# See cmake mailing list discussions for more info: -# 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) -endif() - # DEPRECATED: This is a patch to support the DEPRECATED use of # wxWidgets_USE_LIBS. # diff -Nru cmake-3.4.1/Modules/FindXalanC.cmake cmake-3.5.0/Modules/FindXalanC.cmake --- cmake-3.4.1/Modules/FindXalanC.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/FindXalanC.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,162 @@ +#.rst: +# FindXalanC +# ----------- +# +# Find the Apache Xalan-C++ XSL transform processor headers and libraries. +# +# Imported targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines the following :prop_tgt:`IMPORTED` targets: +# +# ``XalanC::XalanC`` +# The Xalan-C++ ``xalan-c`` library, if found. +# +# Result variables +# ^^^^^^^^^^^^^^^^ +# +# This module will set the following variables in your project: +# +# ``XalanC_FOUND`` +# true if the Xalan headers and libraries were found +# ``XalanC_VERSION`` +# Xalan release version +# ``XalanC_INCLUDE_DIRS`` +# the directory containing the Xalan headers; note +# ``XercesC_INCLUDE_DIRS`` is also required +# ``XalanC_LIBRARIES`` +# Xalan libraries to be linked; note ``XercesC_LIBRARIES`` is also +# required +# +# Cache variables +# ^^^^^^^^^^^^^^^ +# +# The following cache variables may also be set: +# +# ``XalanC_INCLUDE_DIR`` +# the directory containing the Xalan headers +# ``XalanC_LIBRARY`` +# the Xalan library + +# Written by Roger Leigh + +#============================================================================= +# Copyright 2016 University of Dundee +# +# 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(_XalanC_GET_VERSION version_hdr) + file(STRINGS ${version_hdr} _contents REGEX "^[ \t]*#define XALAN_VERSION_.*") + if(_contents) + string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" XalanC_MAJOR "${_contents}") + string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" XalanC_MINOR "${_contents}") + string(REGEX REPLACE "[^*]*#define XALAN_VERSION_REVISION[ \t]+([0-9]+).*" "\\1" XalanC_PATCH "${_contents}") + + if(NOT XalanC_MAJOR MATCHES "^[0-9]+$") + message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_MAJOR!") + endif() + if(NOT XalanC_MINOR MATCHES "^[0-9]+$") + message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_MINOR!") + endif() + if(NOT XalanC_PATCH MATCHES "^[0-9]+$") + message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_REVISION!") + endif() + + set(XalanC_VERSION "${XalanC_MAJOR}.${XalanC_MINOR}.${XalanC_PATCH}" PARENT_SCOPE) + set(XalanC_VERSION_MAJOR "${XalanC_MAJOR}" PARENT_SCOPE) + set(XalanC_VERSION_MINOR "${XalanC_MINOR}" PARENT_SCOPE) + set(XalanC_VERSION_PATCH "${XalanC_PATCH}" PARENT_SCOPE) + else() + message(FATAL_ERROR "Include file ${version_hdr} does not exist or does not contain expected version information") + endif() +endfunction() + +# Find include directory +find_path(XalanC_INCLUDE_DIR + NAMES "xalanc/XalanTransformer/XalanTransformer.hpp" + DOC "Xalan-C++ include directory") +mark_as_advanced(XalanC_INCLUDE_DIR) + +if(XalanC_INCLUDE_DIR) + _XalanC_GET_VERSION("${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp") +endif() + +if(NOT XalanC_LIBRARY) + # Find all XalanC libraries + find_library(XalanC_LIBRARY_RELEASE + NAMES "Xalan-C" "xalan-c" + "Xalan-C_${XalanC_VERSION_MAJOR}" + "Xalan-C_${XalanC_VERSION_MAJOR}_${XalanC_VERSION_MINOR}" + DOC "Xalan-C++ libraries (release)") + find_library(XalanC_LIBRARY_DEBUG + NAMES "Xalan-CD" "xalan-cd" + "Xalan-C_${XalanC_VERSION_MAJOR}D" + "Xalan-C_${XalanC_VERSION_MAJOR}_${XalanC_VERSION_MINOR}D" + DOC "Xalan-C++ libraries (debug)") + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(XalanC) + mark_as_advanced(XalanC_LIBRARY_RELEASE XalanC_LIBRARY_DEBUG) +endif() + +unset(XalanC_VERSION_MAJOR) +unset(XalanC_VERSION_MINOR) +unset(XalanC_VERSION_PATCH) + +unset(XalanC_XERCESC_REQUIRED) +if(XalanC_FIND_REQUIRED) + set(XalanC_XERCESC_REQUIRED REQUIRED) +endif() +find_package(XercesC ${XalanC_XERCESC_REQUIRED}) +unset(XalanC_XERCESC_REQUIRED) + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(XalanC + FOUND_VAR XalanC_FOUND + REQUIRED_VARS XalanC_LIBRARY + XalanC_INCLUDE_DIR + XalanC_VERSION + XercesC_FOUND + VERSION_VAR XalanC_VERSION + FAIL_MESSAGE "Failed to find XalanC") + +if(XalanC_FOUND) + set(XalanC_INCLUDE_DIRS "${XalanC_INCLUDE_DIR}" ${XercesC_INCLUDE_DIRS}) + set(XalanC_LIBRARIES "${XalanC_LIBRARY}" ${XercesC_LIBRARIES}) + + # For header-only libraries + if(NOT TARGET XalanC::XalanC) + add_library(XalanC::XalanC UNKNOWN IMPORTED) + if(XalanC_INCLUDE_DIRS) + set_target_properties(XalanC::XalanC PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${XalanC_INCLUDE_DIRS}") + endif() + if(EXISTS "${XalanC_LIBRARY}") + set_target_properties(XalanC::XalanC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${XalanC_LIBRARY}") + endif() + if(EXISTS "${XalanC_LIBRARY_DEBUG}") + set_property(TARGET XalanC::XalanC APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(XalanC::XalanC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${XalanC_LIBRARY_DEBUG}") + endif() + if(EXISTS "${XalanC_LIBRARY_RELEASE}") + set_property(TARGET XalanC::XalanC APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(XalanC::XalanC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${XalanC_LIBRARY_RELEASE}") + endif() + set_target_properties(XalanC::XalanC PROPERTIES INTERFACE_LINK_LIBRARIES XercesC::XercesC) + endif() +endif() diff -Nru cmake-3.4.1/Modules/FindXercesC.cmake cmake-3.5.0/Modules/FindXercesC.cmake --- cmake-3.4.1/Modules/FindXercesC.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/FindXercesC.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -4,23 +4,42 @@ # # Find the Apache Xerces-C++ validating XML parser headers and libraries. # -# This module reports information about the Xerces installation in -# several variables. General variables:: +# Imported targets +# ^^^^^^^^^^^^^^^^ # -# XercesC_FOUND - true if the Xerces headers and libraries were found -# XercesC_VERSION - Xerces release version -# XercesC_INCLUDE_DIRS - the directory containing the Xerces headers -# XercesC_LIBRARIES - Xerces libraries to be linked +# This module defines the following :prop_tgt:`IMPORTED` targets: # -# The following cache variables may also be set:: +# ``XercesC::XercesC`` +# The Xerces-C++ ``xerces-c`` library, if found. # -# XercesC_INCLUDE_DIR - the directory containing the Xerces headers -# XercesC_LIBRARY - the Xerces library +# Result variables +# ^^^^^^^^^^^^^^^^ +# +# This module will set the following variables in your project: +# +# ``XercesC_FOUND`` +# true if the Xerces headers and libraries were found +# ``XercesC_VERSION`` +# Xerces release version +# ``XercesC_INCLUDE_DIRS`` +# the directory containing the Xerces headers +# ``XercesC_LIBRARIES`` +# Xerces libraries to be linked +# +# Cache variables +# ^^^^^^^^^^^^^^^ +# +# The following cache variables may also be set: +# +# ``XercesC_INCLUDE_DIR`` +# the directory containing the Xerces headers +# ``XercesC_LIBRARY`` +# the Xerces library # Written by Roger Leigh #============================================================================= -# Copyright 2014 University of Dundee +# Copyright 2014-2015 University of Dundee # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -90,4 +109,32 @@ if(XercesC_FOUND) set(XercesC_INCLUDE_DIRS "${XercesC_INCLUDE_DIR}") set(XercesC_LIBRARIES "${XercesC_LIBRARY}") + + # For header-only libraries + if(NOT TARGET XercesC::XercesC) + add_library(XercesC::XercesC UNKNOWN IMPORTED) + if(XercesC_INCLUDE_DIRS) + set_target_properties(XercesC::XercesC PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${XercesC_INCLUDE_DIRS}") + endif() + if(EXISTS "${XercesC_LIBRARY}") + set_target_properties(XercesC::XercesC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${XercesC_LIBRARY}") + endif() + if(EXISTS "${XercesC_LIBRARY_DEBUG}") + set_property(TARGET XercesC::XercesC APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(XercesC::XercesC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${XercesC_LIBRARY_DEBUG}") + endif() + if(EXISTS "${XercesC_LIBRARY_RELEASE}") + set_property(TARGET XercesC::XercesC APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(XercesC::XercesC PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${XercesC_LIBRARY_RELEASE}") + endif() + endif() endif() diff -Nru cmake-3.4.1/Modules/GenerateExportHeader.cmake cmake-3.5.0/Modules/GenerateExportHeader.cmake --- cmake-3.4.1/Modules/GenerateExportHeader.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/GenerateExportHeader.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -230,7 +230,11 @@ endmacro() macro(_test_compiler_has_deprecated) + # NOTE: Some Embarcadero compilers silently compile __declspec(deprecated) + # without error, but this is not a documented feature and the attribute does + # not actually generate any warnings. if(CMAKE_CXX_COMPILER_ID MATCHES Borland + OR CMAKE_CXX_COMPILER_ID MATCHES Embarcadero OR CMAKE_CXX_COMPILER_ID MATCHES HP OR GCC_TOO_OLD OR CMAKE_CXX_COMPILER_ID MATCHES PGI diff -Nru cmake-3.4.1/Modules/GetPrerequisites.cmake cmake-3.5.0/Modules/GetPrerequisites.cmake --- cmake-3.4.1/Modules/GetPrerequisites.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/GetPrerequisites.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -538,7 +538,7 @@ string(TOLOWER "$ENV{windir}" windir) file(TO_CMAKE_PATH "${windir}" windir) - if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)") + if(lower MATCHES "^(api-ms-win-|${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)") set(is_system 1) endif() @@ -566,7 +566,7 @@ string(TOLOWER "${env_windir}" windir) string(TOLOWER "${env_sysdir}" sysroot) - if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)") + if(lower MATCHES "^(api-ms-win-|${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)") set(is_system 1) endif() endif() diff -Nru cmake-3.4.1/Modules/NSIS.template.in cmake-3.5.0/Modules/NSIS.template.in --- cmake-3.4.1/Modules/NSIS.template.in 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/NSIS.template.in 2016-03-08 14:36:22.000000000 +0000 @@ -542,6 +542,8 @@ ; Define some macro setting for the gui @CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ @CPACK_NSIS_INSTALLER_ICON_CODE@ +@CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE@ +@CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE@ @CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ @CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@ diff -Nru cmake-3.4.1/Modules/Platform/AIX-GNU.cmake cmake-3.5.0/Modules/Platform/AIX-GNU.cmake --- cmake-3.4.1/Modules/Platform/AIX-GNU.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/AIX-GNU.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -18,10 +18,20 @@ endif() set(__AIX_COMPILER_GNU 1) +# +# By default, runtime linking is enabled. All shared objects specified on the command line +# will be listed, even if there are no symbols referenced, in the output file. +set (CMAKE_SHARED_LINKER_FLAGS_INIT "-Wl,-brtl") +set (CMAKE_MODULE_LINKER_FLAGS_INIT "-Wl,-brtl") +set (CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-brtl") + + macro(__aix_compiler_gnu lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G,-bnoipath") - set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1) + + set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath") endmacro() diff -Nru cmake-3.4.1/Modules/Platform/AIX-XL.cmake cmake-3.5.0/Modules/Platform/AIX-XL.cmake --- cmake-3.4.1/Modules/Platform/AIX-XL.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/AIX-XL.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -18,11 +18,21 @@ endif() set(__AIX_COMPILER_XL 1) +# +# By default, runtime linking is enabled. All shared objects specified on the command line +# will be listed, even if there are no symbols referenced, in the output file. +set(CMAKE_SHARED_LINKER_FLAGS_INIT "-Wl,-brtl") +set(CMAKE_MODULE_LINKER_FLAGS_INIT "-Wl,-brtl") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-brtl") + + macro(__aix_compiler_xl lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-bnoipath") # -shared - set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ") set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ") + + set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath") endmacro() diff -Nru cmake-3.4.1/Modules/Platform/CrayLinuxEnvironment.cmake cmake-3.5.0/Modules/Platform/CrayLinuxEnvironment.cmake --- cmake-3.4.1/Modules/Platform/CrayLinuxEnvironment.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/CrayLinuxEnvironment.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,143 @@ +# Compute Node Linux doesn't quite work the same as native Linux so all of this +# needs to be custom. We use the variables defined through Cray's environment +# modules to set up the right paths for things. + +set(UNIX 1) + +if(DEFINED ENV{CRAYOS_VERSION}) + set(CMAKE_SYSTEM_VERSION "$ENV{CRAYOS_VERSION}") +elseif(DEFINED ENV{XTOS_VERSION}) + set(CMAKE_SYSTEM_VERSION "$ENV{XTOS_VERSION}") +else() + message(FATAL_ERROR "Neither the CRAYOS_VERSION or XTOS_VERSION environment variables are defined. This platform file should be used inside the Cray Linux Environment for targeting compute nodes (NIDs)") +endif() + +# Guard against multiple messages +if(NOT __CrayLinuxEnvironment_message) + set(__CrayLinuxEnvironment_message 1) + message(STATUS "Cray Linux Environment ${CMAKE_SYSTEM_VERSION}") +endif() + +# All cray systems are x86 CPUs and have been for quite some time +# Note: this may need to change in the future with 64-bit ARM +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_SHARED_LIBRARY_PREFIX "lib") +set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") +set(CMAKE_STATIC_LIBRARY_PREFIX "lib") +set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") + +set(CMAKE_FIND_LIBRARY_PREFIXES "lib") + +# Don't override shared lib support if it's already been set and possibly +# overridden elsewhere by the CrayPrgEnv module +if(NOT CMAKE_FIND_LIBRARY_SUFFIXES) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a") + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) +endif() + +set(CMAKE_DL_LIBS dl) + +# Note: Much of this is pulled from UnixPaths.cmake but adjusted to the Cray +# environment accordingly + +# Get the install directory of the running cmake to the search directories +# CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels up +get_filename_component(__cmake_install_dir "${CMAKE_ROOT}" PATH) +get_filename_component(__cmake_install_dir "${__cmake_install_dir}" PATH) + +# Note: Some Cray's have the SYSROOT_DIR variable defined, pointing to a copy +# of the NIDs userland. If so, then we'll use it. Otherwise, just assume +# the userland from the login node is ok + +# List common installation prefixes. These will be used for all +# search types. +list(APPEND CMAKE_SYSTEM_PREFIX_PATH + # Standard + $ENV{SYSROOT_DIR}/usr/local $ENV{SYSROOT_DIR}/usr $ENV{SYSROOT_DIR}/ + + # CMake install location + "${__cmake_install_dir}" + ) +if (NOT CMAKE_FIND_NO_INSTALL_PREFIX) + list(APPEND CMAKE_SYSTEM_PREFIX_PATH + # Project install destination. + "${CMAKE_INSTALL_PREFIX}" + ) + if(CMAKE_STAGING_PREFIX) + list(APPEND CMAKE_SYSTEM_PREFIX_PATH + # User-supplied staging prefix. + "${CMAKE_STAGING_PREFIX}" + ) + endif() +endif() + +list(APPEND CMAKE_SYSTEM_INCLUDE_PATH + $ENV{SYSROOT_DIR}/usr/include + $ENV{SYSROOT_DIR}/usr/include/X11 +) +list(APPEND CMAKE_SYSTEM_LIBRARY_PATH + $ENV{SYSROOT_DIR}/usr/local/lib64 + $ENV{SYSROOT_DIR}/usr/lib64 + $ENV{SYSROOT_DIR}/lib64 +) +list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + $ENV{SYSROOT_DIR}/usr/local/lib64 + $ENV{SYSROOT_DIR}/usr/lib64 + $ENV{SYSROOT_DIR}/lib64 +) + +# Compute the intersection of several lists +function(__cray_list_intersect OUTPUT INPUT0) + if(ARGC EQUAL 2) + list(APPEND ${OUTPUT} ${${INPUT0}}) + else() + foreach(I IN LISTS ${INPUT0}) + set(__is_common 1) + foreach(L IN LISTS ARGN) + list(FIND ${L} "${I}" __idx) + if(__idx EQUAL -1) + set(__is_common 0) + break() + endif() + endforeach() + if(__is_common) + list(APPEND ${OUTPUT} "${I}") + endif() + endforeach() + endif() + set(${OUTPUT} ${${OUTPUT}} PARENT_SCOPE) +endfunction() + +macro(__list_clean_dupes var) + if(${var}) + list(REMOVE_DUPLICATES ${var}) + endif() +endmacro() + +get_property(__langs GLOBAL PROPERTY ENABLED_LANGUAGES) +set(__cray_inc_path_vars) +set(__cray_lib_path_vars) +foreach(__lang IN LISTS __langs) + list(APPEND __cray_inc_path_vars CMAKE_${__lang}_IMPLICIT_INCLUDE_DIRECTORIES) + list(APPEND __cray_lib_path_vars CMAKE_${__lang}_IMPLICIT_LINK_DIRECTORIES) +endforeach() +if(__cray_inc_path_vars) + __cray_list_intersect(__cray_implicit_include_dirs ${__cray_inc_path_vars}) + if(__cray_implicit_include_dirs) + list(INSERT CMAKE_SYSTEM_INCLUDE_PATH 0 ${__cray_implicit_include_dirs}) + endif() +endif() +if(__cray_lib_path_vars) + __cray_list_intersect(__cray_implicit_library_dirs ${__cray_lib_path_vars}) + if(__cray_implicit_library_dirs) + list(INSERT CMAKE_SYSTEM_LIBRARY_PATH 0 ${__cray_implicit_library_dirs}) + endif() +endif() +__list_clean_dupes(CMAKE_SYSTEM_PREFIX_PATH) +__list_clean_dupes(CMAKE_SYSTEM_INCLUDE_PATH) +__list_clean_dupes(CMAKE_SYSTEM_LIBRARY_PATH) +__list_clean_dupes(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + +# Enable use of lib64 search path variants by default. +set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) diff -Nru cmake-3.4.1/Modules/Platform/HP-UX-GNU.cmake cmake-3.5.0/Modules/Platform/HP-UX-GNU.cmake --- cmake-3.4.1/Modules/Platform/HP-UX-GNU.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/HP-UX-GNU.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -20,8 +20,10 @@ macro(__hpux_compiler_gnu lang) set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-E,-b,+nodefaultrpath") - set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,+s,-E,+nodefaultrpath") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-E") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,+b") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,+h") + + set(CMAKE_${lang}_LINK_FLAGS "-Wl,+s,+nodefaultrpath") endmacro() diff -Nru cmake-3.4.1/Modules/Platform/HP-UX-HP.cmake cmake-3.5.0/Modules/Platform/HP-UX-HP.cmake --- cmake-3.4.1/Modules/Platform/HP-UX-HP.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/HP-UX-HP.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -22,10 +22,12 @@ set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "+Z") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "+Z") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-Wl,-E,+nodefaultrpath -b -L/usr/lib") - set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,+s,-E,+nodefaultrpath") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-E") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,+b") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,+h") set(CMAKE_${lang}_FLAGS_INIT "") + + set(CMAKE_${lang}_LINK_FLAGS "-Wl,+s,+nodefaultrpath") endmacro() diff -Nru cmake-3.4.1/Modules/Platform/SunOS.cmake cmake-3.5.0/Modules/Platform/SunOS.cmake --- cmake-3.4.1/Modules/Platform/SunOS.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/SunOS.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -9,12 +9,6 @@ include(Platform/UnixPaths) -# Add the compiler's implicit link directories. -if("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro) - list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - /opt/SUNWspro/lib /opt/SUNWspro/prod/lib /usr/ccs/lib) -endif() - # The Sun linker needs to find transitive shared library dependencies # in the -L path. set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1) diff -Nru cmake-3.4.1/Modules/Platform/Windows-Embarcadero.cmake cmake-3.5.0/Modules/Platform/Windows-Embarcadero.cmake --- cmake-3.4.1/Modules/Platform/Windows-Embarcadero.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/Windows-Embarcadero.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -78,7 +78,11 @@ # invocations within a single working directory. if(NOT DEFINED CMAKE_JOB_POOL_LINK) set(CMAKE_JOB_POOL_LINK BCC32LinkPool) - set_property(GLOBAL APPEND PROPERTY JOB_POOLS BCC32LinkPool=1) + get_property(_bccjp GLOBAL PROPERTY JOB_POOLS) + if(NOT _bccjp MATCHES "BCC32LinkPool=") + set_property(GLOBAL APPEND PROPERTY JOB_POOLS BCC32LinkPool=1) + endif() + unset(_bccjp) endif() macro(__embarcadero_language lang) diff -Nru cmake-3.4.1/Modules/Platform/Windows-MSVC.cmake cmake-3.5.0/Modules/Platform/Windows-MSVC.cmake --- cmake-3.4.1/Modules/Platform/Windows-MSVC.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/Windows-MSVC.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -302,6 +302,7 @@ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG") set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON) + set(CMAKE_NINJA_DEPTYPE_${lang} msvc) if(NOT CMAKE_RC_COMPILER_INIT) set(CMAKE_RC_COMPILER_INIT rc) @@ -311,4 +312,5 @@ endif() enable_language(RC) + set(CMAKE_NINJA_CMCLDEPS_RC 1) endmacro() diff -Nru cmake-3.4.1/Modules/Platform/WindowsPaths.cmake cmake-3.5.0/Modules/Platform/WindowsPaths.cmake --- cmake-3.4.1/Modules/Platform/WindowsPaths.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/Platform/WindowsPaths.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -28,46 +28,32 @@ # Windows 64-bit Binary: # ENV{ProgramFiles(x86)} = [C:\Program Files (x86)] # ENV{ProgramFiles} = [C:\Program Files] -# ENV{ProgramW6432} = -# (executed from cygwin): -# ENV{ProgramFiles(x86)} = -# ENV{ProgramFiles} = [C:\Program Files] -# ENV{ProgramW6432} = +# ENV{ProgramW6432} = [C:\Program Files] or # -# Windows 32-bit Binary: +# Windows 32-bit Binary on 64-bit Windows: # ENV{ProgramFiles(x86)} = [C:\Program Files (x86)] # ENV{ProgramFiles} = [C:\Program Files (x86)] # ENV{ProgramW6432} = [C:\Program Files] -# (executed from cygwin): -# ENV{ProgramFiles(x86)} = -# ENV{ProgramFiles} = [C:\Program Files (x86)] -# ENV{ProgramW6432} = [C:\Program Files] -if(DEFINED "ENV{ProgramW6432}") - # 32-bit binary on 64-bit windows. - # The 64-bit program files are in ProgramW6432. - list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramW6432}") - - # The 32-bit program files are in ProgramFiles. - if(DEFINED "ENV{ProgramFiles}") - list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}") +set(_programfiles "") +foreach(v "ProgramW6432" "ProgramFiles" "ProgramFiles(x86)") + if(DEFINED "ENV{${v}}") + file(TO_CMAKE_PATH "$ENV{${v}}" _env_programfiles) + list(APPEND _programfiles "${_env_programfiles}") + unset(_env_programfiles) endif() -else() - # 64-bit binary, or 32-bit binary on 32-bit windows. - if(DEFINED "ENV{ProgramFiles}") - list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}") - endif() - set(programfilesx86 "ProgramFiles(x86)") - if(DEFINED "ENV{${programfilesx86}}") - # 64-bit binary. 32-bit program files are in ProgramFiles(x86). - list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{${programfilesx86}}") - elseif(DEFINED "ENV{SystemDrive}") - # Guess the 32-bit program files location. - if(EXISTS "$ENV{SystemDrive}/Program Files (x86)") - list(APPEND CMAKE_SYSTEM_PREFIX_PATH - "$ENV{SystemDrive}/Program Files (x86)") +endforeach() +if(DEFINED "ENV{SystemDrive}") + foreach(d "Program Files" "Program Files (x86)") + if(EXISTS "$ENV{SystemDrive}/${d}") + list(APPEND _programfiles "$ENV{SystemDrive}/${d}") endif() - endif() + endforeach() +endif() +if(_programfiles) + list(REMOVE_DUPLICATES _programfiles) + list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_programfiles}) endif() +unset(_programfiles) # Add the CMake install location. get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH) diff -Nru cmake-3.4.1/Modules/UseJava.cmake cmake-3.5.0/Modules/UseJava.cmake --- cmake-3.4.1/Modules/UseJava.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Modules/UseJava.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -184,7 +184,7 @@ # This is used by install_jni_symlink(). # JAR_FILE The location of the jar file so that you can include # it. -# CLASS_DIR The directory where the class files can be found. For +# CLASSDIR The directory where the class files can be found. For # example to use them with javah. # # :: @@ -444,7 +444,7 @@ if (_add_jar_MANIFEST) set(_MANIFEST_OPTION m) - set(_MANIFEST_VALUE ${_add_jar_MANIFEST}) + get_filename_component (_MANIFEST_VALUE "${_add_jar_MANIFEST}" ABSOLUTE) endif () if (LIBRARY_OUTPUT_PATH) @@ -1212,7 +1212,7 @@ set (_output_files) if (WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") - set(_classpath_sep ";") + set(_classpath_sep "$") else () set(_classpath_sep ":") endif() @@ -1242,7 +1242,7 @@ endif() endforeach() string (REPLACE ";" "${_classpath_sep}" _classpath "${_classpath}") - list (APPEND _javah_options -classpath ${_classpath}) + list (APPEND _javah_options -classpath "${_classpath}") endif() if (_create_javah_OUTPUT_DIR) Binary files /tmp/tmpCtkH2B/le7ar7zt9D/cmake-3.4.1/Packaging/CMakeDMGBackground.tif and /tmp/tmpCtkH2B/pMJNAxVsWV/cmake-3.5.0/Packaging/CMakeDMGBackground.tif differ diff -Nru cmake-3.4.1/Packaging/CMakeDMGSetup.scpt cmake-3.5.0/Packaging/CMakeDMGSetup.scpt --- cmake-3.4.1/Packaging/CMakeDMGSetup.scpt 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Packaging/CMakeDMGSetup.scpt 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,42 @@ +on run argv + set image_name to item 1 of argv + + tell application "Finder" + tell disk image_name + + -- open the image the first time and save a DS_Store with just + -- background and icon setup + open + set current view of container window to icon view + set theViewOptions to the icon view options of container window + set background picture of theViewOptions to file ".background:background.tif" + set arrangement of theViewOptions to not arranged + set icon size of theViewOptions to 128 + delay 1 + close + + -- next setup the position of the app and Applications symlink + -- plus hide all the window decoration + open + update without registering applications + tell container window + set sidebar width to 0 + set statusbar visible to false + set toolbar visible to false + set the bounds to { 400, 100, 900, 465 } + set position of item "CMake.app" to { 133, 200 } + set position of item "Applications" to { 378, 200 } + end tell + update without registering applications + delay 1 + close + + -- one last open and close so you can see everything looks correct + open + delay 5 + close + + end tell + delay 1 +end tell +end run diff -Nru cmake-3.4.1/README.rst cmake-3.5.0/README.rst --- cmake-3.4.1/README.rst 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/README.rst 2016-03-08 14:36:22.000000000 +0000 @@ -46,7 +46,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You need to have a compiler and a make installed. -Run the ``bootstrap`` script you find the in the source directory of CMake. +Run the ``bootstrap`` script you find in the source directory of CMake. You can use the ``--help`` option to see the supported options. You may use the ``--prefix=`` option to specify a custom installation directory for CMake. You can run the ``bootstrap`` script from diff -Nru cmake-3.4.1/Source/bindexplib.cxx cmake-3.5.0/Source/bindexplib.cxx --- cmake-3.4.1/Source/bindexplib.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/bindexplib.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -70,7 +70,7 @@ * Author: Valery Fine 16/09/96 (E-mail: fine@vxcern.cern.ch) *---------------------------------------------------------------------- */ - +#include "bindexplib.h" #include #include #include @@ -173,15 +173,17 @@ */ DumpSymbols(ObjectHeaderType* ih, - FILE* fout, bool is64) { + std::set& symbols, + std::set& dataSymbols, + bool is64) + :Symbols(symbols), DataSymbols(dataSymbols) + { this->ObjectImageHeader = ih; this->SymbolTable = (SymbolTableType*) ((DWORD_PTR)this->ObjectImageHeader + this->ObjectImageHeader->PointerToSymbolTable); - this->FileOut = fout; this->SectionHeaders = GetSectionHeaderOffset(this->ObjectImageHeader); - this->ImportFlag = true; this->SymbolCount = this->ObjectImageHeader->NumberOfSymbols; this->Is64Bit = is64; } @@ -296,10 +298,6 @@ symbol.erase(0,1); } } - if (this->ImportFlag) { - this->ImportFlag = false; - fprintf(this->FileOut,"EXPORTS \n"); - } /* Check whether it is "Scalar deleting destructor" and "Vector deleting destructor" @@ -319,11 +317,11 @@ SectionHeaders[pSymbolTable->SectionNumber-1].Characteristics; if (!pSymbolTable->Type && (SectChar & IMAGE_SCN_MEM_WRITE)) { // Read only (i.e. constants) must be excluded - fprintf(this->FileOut, "\t%s \t DATA\n", symbol.c_str()); + this->DataSymbols.insert(symbol); } else { if ( pSymbolTable->Type || !(SectChar & IMAGE_SCN_MEM_READ)) { - fprintf(this->FileOut, "\t%s\n", symbol.c_str()); + this->Symbols.insert(symbol); } else { // printf(" strange symbol: %s \n",symbol.c_str()); } @@ -340,11 +338,7 @@ symbol = stringTable + pSymbolTable->N.Name.Long; while (isspace(symbol[0])) symbol.erase(0,1); if (symbol[0] == '_') symbol.erase(0,1); - if (!this->ImportFlag) { - this->ImportFlag = true; - fprintf(this->FileOut,"IMPORTS \n"); - } - fprintf(this->FileOut, "\t%s DATA \n", symbol.c_str()+1); + this->DataSymbols.insert(symbol); } } @@ -357,8 +351,8 @@ } } private: - bool ImportFlag; - FILE* FileOut; + std::set& Symbols; + std::set& DataSymbols; DWORD_PTR SymbolCount; PIMAGE_SECTION_HEADER SectionHeaders; ObjectHeaderType* ObjectImageHeader; @@ -367,7 +361,9 @@ }; bool -DumpFile(const char* filename, FILE *fout) +DumpFile(const char* filename, + std::set& symbols, + std::set& dataSymbols) { HANDLE hFile; HANDLE hFileMapping; @@ -415,7 +411,7 @@ * and IMAGE_FILE_HEADER.SizeOfOptionalHeader == 0; */ DumpSymbols - symbolDumper((PIMAGE_FILE_HEADER) lpFileBase, fout, + symbolDumper((PIMAGE_FILE_HEADER) lpFileBase, symbols, dataSymbols, (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64)); symbolDumper.DumpObjFile(); } else { @@ -424,7 +420,8 @@ (cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase; if(h->Sig1 == 0x0 && h->Sig2 == 0xffff) { DumpSymbols - symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase, fout, + symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase, symbols, + dataSymbols, (h->Machine == IMAGE_FILE_MACHINE_AMD64)); symbolDumper.DumpObjFile(); } else { @@ -437,3 +434,27 @@ CloseHandle(hFile); return true; } + +bool bindexplib::AddObjectFile(const char* filename) +{ + if(!DumpFile(filename, this->Symbols, this->DataSymbols)) + { + return false; + } + return true; +} + +void bindexplib::WriteFile(FILE* file) +{ + fprintf(file,"EXPORTS \n"); + for(std::set::const_iterator i = this->DataSymbols.begin(); + i!= this->DataSymbols.end(); ++i) + { + fprintf(file, "\t%s \t DATA\n", i->c_str()); + } + for(std::set::const_iterator i = this->Symbols.begin(); + i!= this->Symbols.end(); ++i) + { + fprintf(file, "\t%s\n", i->c_str()); + } +} diff -Nru cmake-3.4.1/Source/bindexplib.h cmake-3.5.0/Source/bindexplib.h --- cmake-3.4.1/Source/bindexplib.h 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.0/Source/bindexplib.h 2016-03-08 14:36:22.000000000 +0000 @@ -0,0 +1,29 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium + + 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. +============================================================================*/ + +#ifndef bindexplib_h +#define bindexplib_h + +#include "cmStandardIncludes.h" + + +class bindexplib +{ +public: + bindexplib() {} + bool AddObjectFile(const char* filename); + void WriteFile(FILE* file); +private: + std::set Symbols; + std::set DataSymbols; +}; +#endif diff -Nru cmake-3.4.1/Source/cmAddDependenciesCommand.cxx cmake-3.5.0/Source/cmAddDependenciesCommand.cxx --- cmake-3.4.1/Source/cmAddDependenciesCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmAddDependenciesCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmAddDependenciesCommand.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" // cmDependenciesCommand diff -Nru cmake-3.4.1/Source/cmAddExecutableCommand.cxx cmake-3.5.0/Source/cmAddExecutableCommand.cxx --- cmake-3.4.1/Source/cmAddExecutableCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmAddExecutableCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -174,8 +174,8 @@ this->SetError(e.str()); return false; } - cmTarget::TargetType type = aliasedTarget->GetType(); - if(type != cmTarget::EXECUTABLE) + cmState::TargetType type = aliasedTarget->GetType(); + if(type != cmState::EXECUTABLE) { std::ostringstream e; e << "cannot create ALIAS target \"" << exename @@ -192,7 +192,7 @@ this->SetError(e.str()); return false; } - this->Makefile->AddAlias(exename, aliasedTarget); + this->Makefile->AddAlias(exename, aliasedName); return true; } @@ -210,7 +210,7 @@ } // Create the imported target. - this->Makefile->AddImportedTarget(exename, cmTarget::EXECUTABLE, + this->Makefile->AddImportedTarget(exename, cmState::EXECUTABLE, importGlobal); return true; } diff -Nru cmake-3.4.1/Source/cmAddLibraryCommand.cxx cmake-3.5.0/Source/cmAddLibraryCommand.cxx --- cmake-3.4.1/Source/cmAddLibraryCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmAddLibraryCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -25,10 +25,10 @@ } // Library type defaults to value of BUILD_SHARED_LIBS, if it exists, // otherwise it defaults to static library. - cmTarget::TargetType type = cmTarget::SHARED_LIBRARY; + cmState::TargetType type = cmState::SHARED_LIBRARY; if (cmSystemTools::IsOff(this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) { - type = cmTarget::STATIC_LIBRARY; + type = cmState::STATIC_LIBRARY; } bool excludeFromAll = false; bool importTarget = false; @@ -50,7 +50,7 @@ std::string libType = *s; if(libType == "STATIC") { - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting STATIC type."; @@ -58,12 +58,12 @@ return false; } ++s; - type = cmTarget::STATIC_LIBRARY; + type = cmState::STATIC_LIBRARY; haveSpecifiedType = true; } else if(libType == "SHARED") { - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting SHARED type."; @@ -71,12 +71,12 @@ return false; } ++s; - type = cmTarget::SHARED_LIBRARY; + type = cmState::SHARED_LIBRARY; haveSpecifiedType = true; } else if(libType == "MODULE") { - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting MODULE type."; @@ -84,12 +84,12 @@ return false; } ++s; - type = cmTarget::MODULE_LIBRARY; + type = cmState::MODULE_LIBRARY; haveSpecifiedType = true; } else if(libType == "OBJECT") { - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting OBJECT type."; @@ -97,12 +97,12 @@ return false; } ++s; - type = cmTarget::OBJECT_LIBRARY; + type = cmState::OBJECT_LIBRARY; haveSpecifiedType = true; } else if(libType == "UNKNOWN") { - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting UNKNOWN type."; @@ -110,12 +110,12 @@ return false; } ++s; - type = cmTarget::UNKNOWN_LIBRARY; + type = cmState::UNKNOWN_LIBRARY; haveSpecifiedType = true; } else if(libType == "ALIAS") { - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; @@ -149,12 +149,12 @@ return false; } ++s; - type = cmTarget::INTERFACE_LIBRARY; + type = cmState::INTERFACE_LIBRARY; haveSpecifiedType = true; } else if(*s == "EXCLUDE_FROM_ALL") { - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; @@ -174,7 +174,7 @@ ++s; importGlobal = true; } - else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL") + else if(type == cmState::INTERFACE_LIBRARY && *s == "GLOBAL") { std::ostringstream e; e << "GLOBAL option may only be used with IMPORTED libraries."; @@ -187,7 +187,7 @@ } } - if (type == cmTarget::INTERFACE_LIBRARY) + if (type == cmState::INTERFACE_LIBRARY) { if (s != args.end()) { @@ -220,7 +220,7 @@ switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { case cmPolicies::WARN: - if(type != cmTarget::INTERFACE_LIBRARY) + if(type != cmState::INTERFACE_LIBRARY) { e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0037) << "\n"; issueMessage = true; @@ -293,12 +293,12 @@ this->SetError(e.str()); return false; } - cmTarget::TargetType aliasedType = aliasedTarget->GetType(); - if(aliasedType != cmTarget::SHARED_LIBRARY - && aliasedType != cmTarget::STATIC_LIBRARY - && aliasedType != cmTarget::MODULE_LIBRARY - && aliasedType != cmTarget::OBJECT_LIBRARY - && aliasedType != cmTarget::INTERFACE_LIBRARY) + cmState::TargetType aliasedType = aliasedTarget->GetType(); + if(aliasedType != cmState::SHARED_LIBRARY + && aliasedType != cmState::STATIC_LIBRARY + && aliasedType != cmState::MODULE_LIBRARY + && aliasedType != cmState::OBJECT_LIBRARY + && aliasedType != cmState::INTERFACE_LIBRARY) { std::ostringstream e; e << "cannot create ALIAS target \"" << libName @@ -314,7 +314,7 @@ this->SetError(e.str()); return false; } - this->Makefile->AddAlias(libName, aliasedTarget); + this->Makefile->AddAlias(libName, aliasedName); return true; } @@ -328,19 +328,19 @@ CMAKE_${LANG}_CREATE_SHARED_LIBRARY is defined and if not default to STATIC. But at this point we know only the name of the target, but not yet its linker language. */ - if ((type == cmTarget::SHARED_LIBRARY || - type == cmTarget::MODULE_LIBRARY) && + if ((type == cmState::SHARED_LIBRARY || + type == cmState::MODULE_LIBRARY) && (this->Makefile->GetState()->GetGlobalPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { std::ostringstream w; w << "ADD_LIBRARY called with " << - (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") << + (type==cmState::SHARED_LIBRARY ? "SHARED" : "MODULE") << " option but the target platform does not support dynamic linking. " "Building a STATIC library instead. This may lead to problems."; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); - type = cmTarget::STATIC_LIBRARY; + type = cmState::STATIC_LIBRARY; } // Handle imported target creation. @@ -352,7 +352,7 @@ this->SetError("called with IMPORTED argument but no library type."); return false; } - if(type == cmTarget::OBJECT_LIBRARY) + if(type == cmState::OBJECT_LIBRARY) { this->Makefile->IssueMessage( cmake::FATAL_ERROR, @@ -360,7 +360,7 @@ ); return true; } - if(type == cmTarget::INTERFACE_LIBRARY) + if(type == cmState::INTERFACE_LIBRARY) { if (!cmGeneratorExpression::IsValidTargetName(libName)) { @@ -387,7 +387,7 @@ } // A non-imported target may not have UNKNOWN type. - if(type == cmTarget::UNKNOWN_LIBRARY) + if(type == cmState::UNKNOWN_LIBRARY) { this->Makefile->IssueMessage( cmake::FATAL_ERROR, @@ -408,7 +408,7 @@ std::vector srclists; - if(type == cmTarget::INTERFACE_LIBRARY) + if(type == cmState::INTERFACE_LIBRARY) { if (!cmGeneratorExpression::IsValidTargetName(libName) || libName.find("::") != std::string::npos) diff -Nru cmake-3.4.1/Source/cmake.cxx cmake-3.5.0/Source/cmake.cxx --- cmake-3.4.1/Source/cmake.cxx 2015-12-02 15:43:22.000000000 +0000 +++ cmake-3.5.0/Source/cmake.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmake.h" -#include "cmCacheManager.h" #include "cmMakefile.h" #include "cmLocalGenerator.h" #include "cmExternalMakefileProjectGenerator.h" @@ -128,14 +127,12 @@ this->WarnUnused = false; this->WarnUnusedCli = true; this->CheckSystemVars = false; - this->SuppressDevWarnings = false; - this->DoSuppressDevWarnings = false; this->DebugOutput = false; this->DebugTryCompile = false; this->ClearBuildSystem = false; this->FileComparison = new cmFileTimeComparison; - this->State = new cmState(this); + this->State = new cmState; this->CurrentSnapshot = this->State->CreateBaseSnapshot(); #ifdef __APPLE__ @@ -151,7 +148,6 @@ #endif this->Verbose = false; - this->CacheManager = new cmCacheManager(this); this->GlobalGenerator = 0; this->ProgressCallback = 0; this->ProgressCallbackClientData = 0; @@ -167,11 +163,34 @@ // Make sure we can capture the build tool output. cmSystemTools::EnableVSConsoleOutput(); + + // Set up a list of source and header extensions + // these are used to find files when the extension + // is not given + // The "c" extension MUST precede the "C" extension. + this->SourceFileExtensions.push_back( "c" ); + this->SourceFileExtensions.push_back( "C" ); + + this->SourceFileExtensions.push_back( "c++" ); + this->SourceFileExtensions.push_back( "cc" ); + this->SourceFileExtensions.push_back( "cpp" ); + this->SourceFileExtensions.push_back( "cxx" ); + this->SourceFileExtensions.push_back( "m" ); + this->SourceFileExtensions.push_back( "M" ); + this->SourceFileExtensions.push_back( "mm" ); + + this->HeaderFileExtensions.push_back( "h" ); + this->HeaderFileExtensions.push_back( "hh" ); + this->HeaderFileExtensions.push_back( "h++" ); + this->HeaderFileExtensions.push_back( "hm" ); + this->HeaderFileExtensions.push_back( "hpp" ); + this->HeaderFileExtensions.push_back( "hxx" ); + this->HeaderFileExtensions.push_back( "in" ); + this->HeaderFileExtensions.push_back( "txx" ); } cmake::~cmake() { - delete this->CacheManager; delete this->State; if (this->GlobalGenerator) { @@ -189,6 +208,7 @@ { this->CurrentSnapshot = this->State->Reset(); this->State->RemoveUserDefinedCommands(); + this->CurrentSnapshot.SetDefaultDefinitions(); } // Parse the args @@ -216,7 +236,7 @@ } std::string var, value; cmState::CacheEntryType type = cmState::UNINITIALIZED; - if(cmCacheManager::ParseEntry(entry, var, value, type)) + if(cmState::ParseCacheEntry(entry, var, value, type)) { // The value is transformed if it is a filepath for example, so // we can't compare whether the value is already in the cache until @@ -232,7 +252,7 @@ } } - this->State->AddCacheEntry(var, value.c_str(), + this->AddCacheEntry(var, value.c_str(), "No help, variable specified on the command line.", type); if(this->WarnUnusedCli) @@ -252,15 +272,69 @@ return false; } } - else if(arg.find("-Wno-dev",0) == 0) - { - this->SuppressDevWarnings = true; - this->DoSuppressDevWarnings = true; - } - else if(arg.find("-Wdev",0) == 0) + else if(cmHasLiteralPrefix(arg, "-W")) { - this->SuppressDevWarnings = false; - this->DoSuppressDevWarnings = true; + std::string entry = arg.substr(2); + if (entry.empty()) + { + ++i; + if (i < args.size()) + { + entry = args[i]; + } + else + { + cmSystemTools::Error("-W must be followed with [no-]."); + return false; + } + } + + std::string name; + bool foundNo = false; + bool foundError = false; + unsigned int nameStartPosition = 0; + + if (entry.find("no-", nameStartPosition) == 0) + { + foundNo = true; + nameStartPosition += 3; + } + + if (entry.find("error=", nameStartPosition) == 0) + { + foundError = true; + nameStartPosition += 6; + } + + name = entry.substr(nameStartPosition); + if (name.empty()) + { + cmSystemTools::Error("No warning name provided."); + return false; + } + + if (!foundNo && !foundError) + { + // -W + this->DiagLevels[name] = std::max(this->DiagLevels[name], + DIAG_WARN); + } + else if (foundNo && !foundError) + { + // -Wno + this->DiagLevels[name] = DIAG_IGNORE; + } + else if (!foundNo && foundError) + { + // -Werror= + this->DiagLevels[name] = DIAG_ERROR; + } + else + { + // -Wno-error= + this->DiagLevels[name] = std::min(this->DiagLevels[name], + DIAG_WARN); + } } else if(arg.find("-U",0) == 0) { @@ -377,21 +451,21 @@ this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory()); cmState::Snapshot snapshot = this->GetCurrentSnapshot(); - cmsys::auto_ptr mf(new cmMakefile(gg, snapshot)); - cmsys::auto_ptr lg(gg->CreateLocalGenerator(mf.get())); - lg->GetMakefile()->SetCurrentBinaryDirectory + snapshot.GetDirectory().SetCurrentBinary (cmSystemTools::GetCurrentWorkingDirectory()); - lg->GetMakefile()->SetCurrentSourceDirectory + snapshot.GetDirectory().SetCurrentSource (cmSystemTools::GetCurrentWorkingDirectory()); + snapshot.SetDefaultDefinitions(); + cmsys::auto_ptr mf(new cmMakefile(gg, snapshot)); if (this->GetWorkingMode() != NORMAL_MODE) { std::string file(cmSystemTools::CollapseFullPath(path)); cmSystemTools::ConvertToUnixSlashes(file); - lg->GetMakefile()->SetScriptModeFile(file.c_str()); + mf->SetScriptModeFile(file.c_str()); - lg->GetMakefile()->SetArgcArgv(args); + mf->SetArgcArgv(args); } - if (!lg->GetMakefile()->ReadListFile(path)) + if (!mf->ReadListFile(path)) { cmSystemTools::Error("Error processing file: ", path); } @@ -419,13 +493,14 @@ this->SetGlobalGenerator(gg); cmState::Snapshot snapshot = this->GetCurrentSnapshot(); - // read in the list file to fill the cache - cmsys::auto_ptr mf(new cmMakefile(gg, snapshot)); - cmsys::auto_ptr lg(gg->CreateLocalGenerator(mf.get())); - mf->SetCurrentBinaryDirectory + snapshot.GetDirectory().SetCurrentBinary (cmSystemTools::GetCurrentWorkingDirectory()); - mf->SetCurrentSourceDirectory + snapshot.GetDirectory().SetCurrentSource (cmSystemTools::GetCurrentWorkingDirectory()); + // read in the list file to fill the cache + snapshot.SetDefaultDefinitions(); + cmMakefile* mf = new cmMakefile(gg, snapshot); + gg->AddMakefile(mf); mf->SetArgcArgv(args); @@ -458,6 +533,8 @@ std::vector includeDirs; cmSystemTools::ExpandListArgument(includes, includeDirs); + gg->CreateGenerationObjects(); + cmLocalGenerator* lg = gg->LocalGenerators[0]; std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0, language); std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS"); @@ -478,7 +555,7 @@ ++libIt) { mf->AddLinkLibraryForTarget(targetName, *libIt, - cmTarget::GENERAL); + GENERAL_LibraryType); } @@ -487,8 +564,9 @@ std::string linkPath; std::string flags; std::string linkFlags; - gg->CreateGeneratorTargets(cmGlobalGenerator::AllTargets, lg.get()); - cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt); + gg->CreateGenerationObjects(); + cmGeneratorTarget *gtgt = gg->FindGeneratorTarget(tgt->GetName()); + cmLocalGenerator* lg = gtgt->GetLocalGenerator(); lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags, gtgt, false); linkLibs = frameworkPath + linkPath + linkLibs; @@ -592,11 +670,7 @@ // skip for now i++; } - else if(arg.find("-Wno-dev",0) == 0) - { - // skip for now - } - else if(arg.find("-Wdev",0) == 0) + else if(arg.find("-W",0) == 0) { // skip for now } @@ -849,14 +923,14 @@ int cmake::AddCMakePaths() { // Save the value in the cache - this->CacheManager->AddCacheEntry + this->AddCacheEntry ("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand().c_str(), "Path to CMake executable.", cmState::INTERNAL); #ifdef CMAKE_BUILD_WITH_CMAKE - this->CacheManager->AddCacheEntry + this->AddCacheEntry ("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(), "Path to ctest program executable.", cmState::INTERNAL); - this->CacheManager->AddCacheEntry + this->AddCacheEntry ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), "Path to cpack program executable.", cmState::INTERNAL); #endif @@ -870,7 +944,7 @@ cmSystemTools::GetCMakeRoot().c_str()); return 0; } - this->CacheManager->AddCacheEntry + this->AddCacheEntry ("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(), "Path to CMake installation.", cmState::INTERNAL); @@ -931,18 +1005,32 @@ //---------------------------------------------------------------------------- -void cmake::GetRegisteredGenerators(std::vector& names) +void cmake::GetRegisteredGenerators(std::vector& generators) { - for(RegisteredGeneratorsVector::const_iterator i = this->Generators.begin(); - i != this->Generators.end(); ++i) + for (RegisteredGeneratorsVector::const_iterator + i = this->Generators.begin(), e = this->Generators.end(); + i != e; ++i) { + std::vector names; (*i)->GetGenerators(names); + + for (size_t j = 0; j < names.size(); ++j) + { + GeneratorInfo info; + info.supportsToolset = (*i)->SupportsToolset(); + info.name = names[j]; + generators.push_back(info); + } } - for(RegisteredExtraGeneratorsMap::const_iterator - i = this->ExtraGenerators.begin(); - i != this->ExtraGenerators.end(); ++i) + + for (RegisteredExtraGeneratorsMap::const_iterator + i = this->ExtraGenerators.begin(), e = this->ExtraGenerators.end(); + i != e; ++i) { - names.push_back(i->first); + GeneratorInfo info; + info.name = i->first; + info.supportsToolset = false; + generators.push_back(info); } } @@ -984,6 +1072,10 @@ void cmake::SetHomeDirectory(const std::string& dir) { this->State->SetSourceDirectory(dir); + if (this->CurrentSnapshot.IsValid()) + { + this->CurrentSnapshot.SetDefinition("CMAKE_SOURCE_DIR", dir); + } } const char* cmake::GetHomeDirectory() const @@ -994,6 +1086,10 @@ void cmake::SetHomeOutputDirectory(const std::string& dir) { this->State->SetBinaryDirectory(dir); + if (this->CurrentSnapshot.IsValid()) + { + this->CurrentSnapshot.SetDefinition("CMAKE_BINARY_DIR", dir); + } } const char* cmake::GetHomeOutputDirectory() const @@ -1087,10 +1183,10 @@ } // do a sanity check on some values - if(this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) + if(this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) { std::string cacheStart = - this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"); + this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"); cacheStart += "/CMakeLists.txt"; std::string currentStart = this->GetHomeDirectory(); currentStart += "/CMakeLists.txt"; @@ -1147,12 +1243,12 @@ save.value = *i; warning << *i << "\n"; const char* existingValue = - this->CacheManager->GetCacheEntryValue(save.key); + this->State->GetCacheEntryValue(save.key); if(existingValue) { - save.type = this->CacheManager->GetCacheEntryType(save.key); + save.type = this->State->GetCacheEntryType(save.key); if(const char* help = - this->CacheManager->GetCacheEntryProperty(save.key, "HELPSTRING")) + this->State->GetCacheEntryProperty(save.key, "HELPSTRING")) { save.help = help; } @@ -1161,7 +1257,7 @@ } // remove the cache - this->CacheManager->DeleteCache(this->GetHomeOutputDirectory()); + this->DeleteCache(this->GetHomeOutputDirectory()); // load the empty cache this->LoadCache(); // restore the changed compilers @@ -1183,25 +1279,80 @@ int cmake::Configure() { - if(this->DoSuppressDevWarnings) + DiagLevel diagLevel; + + if (this->DiagLevels.count("deprecated") == 1) { - if(this->SuppressDevWarnings) + + diagLevel = this->DiagLevels["deprecated"]; + if (diagLevel == DIAG_IGNORE) { - this->CacheManager-> - AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", - "Suppress Warnings that are meant for" - " the author of the CMakeLists.txt files.", - cmState::INTERNAL); + this->SetSuppressDeprecatedWarnings(true); + this->SetDeprecatedWarningsAsErrors(false); } - else + else if (diagLevel == DIAG_WARN) { - this->CacheManager-> - AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", - "Suppress Warnings that are meant for" - " the author of the CMakeLists.txt files.", - cmState::INTERNAL); + this->SetSuppressDeprecatedWarnings(false); + this->SetDeprecatedWarningsAsErrors(false); + } + else if (diagLevel == DIAG_ERROR) + { + this->SetSuppressDeprecatedWarnings(false); + this->SetDeprecatedWarningsAsErrors(true); } } + + if (this->DiagLevels.count("dev") == 1) + { + bool setDeprecatedVariables = false; + + const char* cachedWarnDeprecated = + this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED"); + const char* cachedErrorDeprecated = + this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED"); + + // don't overwrite deprecated warning setting from a previous invocation + if (!cachedWarnDeprecated && !cachedErrorDeprecated) + { + setDeprecatedVariables = true; + } + + diagLevel = this->DiagLevels["dev"]; + if (diagLevel == DIAG_IGNORE) + { + this->SetSuppressDevWarnings(true); + this->SetDevWarningsAsErrors(false); + + if (setDeprecatedVariables) + { + this->SetSuppressDeprecatedWarnings(true); + this->SetDeprecatedWarningsAsErrors(false); + } + } + else if (diagLevel == DIAG_WARN) + { + this->SetSuppressDevWarnings(false); + this->SetDevWarningsAsErrors(false); + + if (setDeprecatedVariables) + { + this->SetSuppressDeprecatedWarnings(false); + this->SetDeprecatedWarningsAsErrors(false); + } + } + else if (diagLevel == DIAG_ERROR) + { + this->SetSuppressDevWarnings(false); + this->SetDevWarningsAsErrors(true); + + if (setDeprecatedVariables) + { + this->SetSuppressDeprecatedWarnings(false); + this->SetDeprecatedWarningsAsErrors(true); + } + } + } + int ret = this->ActualConfigure(); const char* delCacheVars = this->State ->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); @@ -1230,7 +1381,7 @@ } if ( !res ) { - this->CacheManager->AddCacheEntry + this->AddCacheEntry ("CMAKE_HOME_DIRECTORY", this->GetHomeDirectory(), "Source directory with the top level CMakeLists.txt file for this " @@ -1242,9 +1393,9 @@ if(!this->GlobalGenerator) { const char* genName = - this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR"); + this->State->GetInitializedCacheValue("CMAKE_GENERATOR"); const char* extraGenName = - this->CacheManager->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); + this->State->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); if(genName) { std::string fullName = cmExternalMakefileProjectGenerator:: @@ -1322,7 +1473,7 @@ } } - const char* genName = this->CacheManager + const char* genName = this->State ->GetInitializedCacheValue("CMAKE_GENERATOR"); if(genName) { @@ -1339,20 +1490,20 @@ return -2; } } - if(!this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR")) + if(!this->State->GetInitializedCacheValue("CMAKE_GENERATOR")) { - this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", + this->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), "Name of generator.", cmState::INTERNAL); - this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR", + this->AddCacheEntry("CMAKE_EXTRA_GENERATOR", this->GlobalGenerator->GetExtraGeneratorName().c_str(), "Name of external makefile project generator.", cmState::INTERNAL); } if(const char* platformName = - this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) + this->State->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) { if(this->GeneratorPlatform.empty()) { @@ -1373,14 +1524,14 @@ } else { - this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", + this->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", this->GeneratorPlatform.c_str(), "Name of generator platform.", cmState::INTERNAL); } if(const char* tsName = - this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) + this->State->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) { if(this->GeneratorToolset.empty()) { @@ -1401,7 +1552,7 @@ } else { - this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", + this->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", this->GeneratorToolset.c_str(), "Name of generator toolset.", cmState::INTERNAL); @@ -1435,7 +1586,7 @@ { if(!this->State->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { - this->State->AddCacheEntry + this->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmState::PATH); @@ -1443,7 +1594,7 @@ if(!this->State ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { - this->State->AddCacheEntry + this->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", cmState::PATH); @@ -1463,7 +1614,7 @@ // only save the cache if there were no fatal errors if ( this->GetWorkingMode() == NORMAL_MODE ) { - this->CacheManager->SaveCache(this->GetHomeOutputDirectory()); + this->SaveCache(this->GetHomeOutputDirectory()); } if(cmSystemTools::GetErrorOccuredFlag()) { @@ -1532,6 +1683,7 @@ { this->AddCMakePaths(); } + // Add any cache args if ( !this->SetCacheArgs(args) ) { @@ -1633,7 +1785,7 @@ // for the Visual Studio and Xcode generators.) if ( this->GetWorkingMode() == NORMAL_MODE ) { - this->CacheManager->SaveCache(this->GetHomeOutputDirectory()); + this->SaveCache(this->GetHomeOutputDirectory()); } return 0; } @@ -1642,14 +1794,15 @@ const char* helpString, int type) { - this->CacheManager->AddCacheEntry(key, value, + this->State->AddCacheEntry(key, value, helpString, cmState::CacheEntryType(type)); + this->UnwatchUnusedCli(key); } const char* cmake::GetCacheDefinition(const std::string& name) const { - return this->CacheManager->GetInitializedCacheValue(name); + return this->State->GetInitializedCacheValue(name); } void cmake::AddDefaultCommands() @@ -1722,7 +1875,7 @@ std::string& value, cmState::CacheEntryType& type) { - return cmCacheManager::ParseEntry(entry, var, value, type); + return cmState::ParseCacheEntry(entry, var, value, type); } int cmake::LoadCache() @@ -1753,24 +1906,43 @@ bool cmake::LoadCache(const std::string& path) { - return this->CacheManager->LoadCache(path); + std::set emptySet; + return this->LoadCache(path, true, emptySet, emptySet); } bool cmake::LoadCache(const std::string& path, bool internal, std::set& excludes, std::set& includes) { - return this->CacheManager->LoadCache(path, internal, excludes, includes); + bool result = this->State->LoadCache(path, internal, excludes, includes); + static const char* entries[] = {"CMAKE_CACHE_MAJOR_VERSION", + "CMAKE_CACHE_MINOR_VERSION"}; + for (const char* const* nameIt = cmArrayBegin(entries); + nameIt != cmArrayEnd(entries); ++nameIt) + { + this->UnwatchUnusedCli(*nameIt); + } + return result; } bool cmake::SaveCache(const std::string& path) { - return this->CacheManager->SaveCache(path); + bool result = this->State->SaveCache(path); + static const char* entries[] = {"CMAKE_CACHE_MAJOR_VERSION", + "CMAKE_CACHE_MINOR_VERSION", + "CMAKE_CACHE_PATCH_VERSION", + "CMAKE_CACHEFILE_DIR"}; + for (const char* const* nameIt = cmArrayBegin(entries); + nameIt != cmArrayEnd(entries); ++nameIt) + { + this->UnwatchUnusedCli(*nameIt); + } + return result; } bool cmake::DeleteCache(const std::string& path) { - return this->CacheManager->DeleteCache(path); + return this->State->DeleteCache(path); } void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) @@ -1835,7 +2007,7 @@ { // Update the path conversion table with any specified file: const char* tablepath = - this->CacheManager + this->State ->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE"); if(tablepath) @@ -1904,9 +2076,9 @@ cmake cm; cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); + cm.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator gg(&cm); cmsys::auto_ptr mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); - cmsys::auto_ptr lg(gg.CreateLocalGenerator(mf.get())); if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { @@ -1935,6 +2107,7 @@ ggd(this->CreateGlobalGenerator(genName)); if(ggd.get()) { + cm.GetCurrentSnapshot().SetDefaultDefinitions(); cmsys::auto_ptr mfd(new cmMakefile(ggd.get(), cm.GetCurrentSnapshot())); cmsys::auto_ptr lgd( @@ -2416,6 +2589,74 @@ return true; } +cmake::MessageType cmake::ConvertMessageType(cmake::MessageType t) +{ + bool warningsAsErrors; + + if (t == cmake::AUTHOR_WARNING || t == cmake::AUTHOR_ERROR) + { + warningsAsErrors = this->GetDevWarningsAsErrors(); + if (warningsAsErrors && t == cmake::AUTHOR_WARNING) + { + t = cmake::AUTHOR_ERROR; + } + else if (!warningsAsErrors && t == cmake::AUTHOR_ERROR) + { + t = cmake::AUTHOR_WARNING; + } + } + else if (t == cmake::DEPRECATION_WARNING || t == cmake::DEPRECATION_ERROR) + { + warningsAsErrors = this->GetDeprecatedWarningsAsErrors(); + if (warningsAsErrors && t == cmake::DEPRECATION_WARNING) + { + t = cmake::DEPRECATION_ERROR; + } + else if (!warningsAsErrors && t == cmake::DEPRECATION_ERROR) + { + t = cmake::DEPRECATION_WARNING; + } + } + + return t; +} + +bool cmake::IsMessageTypeVisible(cmake::MessageType t) +{ + bool isVisible = true; + + if(t == cmake::DEPRECATION_ERROR) + { + if(!this->GetDeprecatedWarningsAsErrors()) + { + isVisible = false; + } + } + else if (t == cmake::DEPRECATION_WARNING) + { + if (this->GetSuppressDeprecatedWarnings()) + { + isVisible = false; + } + } + else if (t == cmake::AUTHOR_ERROR) + { + if (!this->GetDevWarningsAsErrors()) + { + isVisible = false; + } + } + else if (t == cmake::AUTHOR_WARNING) + { + if (this->GetSuppressDevWarnings()) + { + isVisible = false; + } + } + + return isVisible; +} + bool cmake::PrintMessagePreamble(cmake::MessageType t, std::ostream& msg) { // Construct the message header. @@ -2439,20 +2680,17 @@ { msg << "CMake Deprecation Warning"; } + else if (t == cmake::AUTHOR_WARNING) + { + msg << "CMake Warning (dev)"; + } + else if (t == cmake::AUTHOR_ERROR) + { + msg << "CMake Error (dev)"; + } else { msg << "CMake Warning"; - if(t == cmake::AUTHOR_WARNING) - { - // Allow suppression of these warnings. - const char* suppress = this->State->GetCacheEntryValue( - "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); - if(suppress && cmSystemTools::IsOn(suppress)) - { - return false; - } - msg << " (dev)"; - } } return true; } @@ -2474,6 +2712,12 @@ msg << "This warning is for project developers. Use -Wno-dev to suppress it."; } + else if (t == cmake::AUTHOR_ERROR) + { + msg << + "This error is for project developers. Use -Wno-error=dev to suppress " + "it."; + } // Add a terminating blank line. msg << "\n"; @@ -2497,7 +2741,8 @@ // Output the message. if(t == cmake::FATAL_ERROR || t == cmake::INTERNAL_ERROR - || t == cmake::DEPRECATION_ERROR) + || t == cmake::DEPRECATION_ERROR + || t == cmake::AUTHOR_ERROR) { cmSystemTools::SetErrorOccured(); cmSystemTools::Message(msg.str().c_str(), "Error"); @@ -2510,10 +2755,27 @@ //---------------------------------------------------------------------------- void cmake::IssueMessage(cmake::MessageType t, std::string const& text, - cmListFileBacktrace const& bt) + cmListFileBacktrace const& bt, + bool force) { cmListFileBacktrace backtrace = bt; + if (!force) + { + // override the message type, if needed, for warnings and errors + cmake::MessageType override = this->ConvertMessageType(t); + if (override != t) + { + t = override; + force = true; + } + } + + if (!force && !this->IsMessageTypeVisible(t)) + { + return; + } + std::ostringstream msg; if (!this->PrintMessagePreamble(t, msg)) { @@ -2533,8 +2795,25 @@ //---------------------------------------------------------------------------- void cmake::IssueMessage(cmake::MessageType t, std::string const& text, - cmListFileContext const& lfc) + cmListFileContext const& lfc, + bool force) { + if (!force) + { + // override the message type, if needed, for warnings and errors + cmake::MessageType override = this->ConvertMessageType(t); + if (override != t) + { + t = override; + force = true; + } + } + + if (!force && !this->IsMessageTypeVisible(t)) + { + return; + } + std::ostringstream msg; if (!this->PrintMessagePreamble(t, msg)) { @@ -2694,3 +2973,153 @@ } #endif } + +bool cmake::GetSuppressDevWarnings(cmMakefile const* mf) +{ + /* + * The suppression CMake variable may be set in the CMake configuration file + * itself, so we have to check what its set to in the makefile if we can. + */ + if (mf) + { + return mf->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + } + else + { + const char* cacheEntryValue = this->State->GetCacheEntryValue( + "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + return cmSystemTools::IsOn(cacheEntryValue); + } +} + +void cmake::SetSuppressDevWarnings(bool b) +{ + std::string value; + + // equivalent to -Wno-dev + if (b) + { + value = "TRUE"; + } + // equivalent to -Wdev + else + { + value = "FALSE"; + } + + this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", value.c_str(), + "Suppress Warnings that are meant for" + " the author of the CMakeLists.txt files.", + cmState::INTERNAL); +} + +bool cmake::GetSuppressDeprecatedWarnings(cmMakefile const* mf) +{ + /* + * The suppression CMake variable may be set in the CMake configuration file + * itself, so we have to check what its set to in the makefile if we can. + */ + if (mf) + { + return (mf->IsSet("CMAKE_WARN_DEPRECATED") && + !mf->IsOn("CMAKE_WARN_DEPRECATED")); + } + else + { + const char* cacheEntryValue = this->State->GetCacheEntryValue( + "CMAKE_WARN_DEPRECATED"); + return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue); + } +} + +void cmake::SetSuppressDeprecatedWarnings(bool b) +{ + std::string value; + + // equivalent to -Wno-deprecated + if (b) + { + value = "FALSE"; + } + // equivalent to -Wdeprecated + else + { + value = "TRUE"; + } + + this->AddCacheEntry("CMAKE_WARN_DEPRECATED", value.c_str(), + "Whether to issue warnings for deprecated " + "functionality.", + cmState::INTERNAL); +} + +bool cmake::GetDevWarningsAsErrors(cmMakefile const* mf) +{ + if (mf) + { + return (mf->IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") && + !mf->IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS")); + } + else + { + const char* cacheEntryValue = this->State->GetCacheEntryValue( + "CMAKE_SUPPRESS_DEVELOPER_ERRORS"); + return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue); + } +} + +void cmake::SetDevWarningsAsErrors(bool b) +{ + std::string value; + + // equivalent to -Werror=dev + if (b) + { + value = "FALSE"; + } + // equivalent to -Wno-error=dev + else + { + value = "TRUE"; + } + + this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_ERRORS", value.c_str(), + "Suppress errors that are meant for" + " the author of the CMakeLists.txt files.", + cmState::INTERNAL); +} + +bool cmake::GetDeprecatedWarningsAsErrors(cmMakefile const* mf) +{ + if (mf) + { + return mf->IsOn("CMAKE_ERROR_DEPRECATED"); + } + else + { + const char* cacheEntryValue = this->State->GetCacheEntryValue( + "CMAKE_ERROR_DEPRECATED"); + return cmSystemTools::IsOn(cacheEntryValue); + } +} + +void cmake::SetDeprecatedWarningsAsErrors(bool b) +{ + std::string value; + + // equivalent to -Werror=deprecated + if (b) + { + value = "TRUE"; + } + // equivalent to -Wno-error=deprecated + else + { + value = "FALSE"; + } + + this->AddCacheEntry("CMAKE_ERROR_DEPRECATED", value.c_str(), + "Whether to issue deprecation errors for macros" + " and functions.", + cmState::INTERNAL); +} diff -Nru cmake-3.4.1/Source/cmake.h cmake-3.5.0/Source/cmake.h --- cmake-3.4.1/Source/cmake.h 2015-12-02 15:43:22.000000000 +0000 +++ cmake-3.5.0/Source/cmake.h 2016-03-08 14:36:22.000000000 +0000 @@ -59,6 +59,7 @@ public: enum MessageType { AUTHOR_WARNING, + AUTHOR_ERROR, FATAL_ERROR, INTERNAL_ERROR, MESSAGE, @@ -68,6 +69,12 @@ DEPRECATION_WARNING }; + enum DiagLevel + { + DIAG_IGNORE, + DIAG_WARN, + DIAG_ERROR + }; /** \brief Describes the working modes of cmake */ enum WorkingMode @@ -89,6 +96,13 @@ */ FIND_PACKAGE_MODE }; + + struct GeneratorInfo + { + std::string name; + bool supportsToolset; + }; + typedef std::map InstalledFilesMap; /// Default constructor @@ -161,7 +175,7 @@ void SetGlobalGenerator(cmGlobalGenerator *); ///! Get the names of the current registered generators - void GetRegisteredGenerators(std::vector& names); + void GetRegisteredGenerators(std::vector& generators); ///! Set the name of the selected generator-specific platform. void SetGeneratorPlatform(std::string const& ts) @@ -182,6 +196,11 @@ ///! get the cmCachemManager used by this invocation of cmake cmCacheManager *GetCacheManager() { return this->CacheManager; } + const std::vector& GetSourceExtensions() const + {return this->SourceFileExtensions;} + const std::vector& GetHeaderExtensions() const + {return this->HeaderFileExtensions;} + /** * Given a variable name, return its value (as a string). */ @@ -291,17 +310,57 @@ std::string const& GetCMakeEditCommand() const { return this->CMakeEditCommand; } - void SetSuppressDevWarnings(bool v) - { - this->SuppressDevWarnings = v; - this->DoSuppressDevWarnings = true; - } + /* + * Get the state of the suppression of developer (author) warnings. + * Returns false, by default, if developer warnings should be shown, true + * otherwise. + */ + bool GetSuppressDevWarnings(cmMakefile const* mf = NULL); + /* + * Set the state of the suppression of developer (author) warnings. + */ + void SetSuppressDevWarnings(bool v); + + /* + * Get the state of the suppression of deprecated warnings. + * Returns false, by default, if deprecated warnings should be shown, true + * otherwise. + */ + bool GetSuppressDeprecatedWarnings(cmMakefile const* mf = NULL); + /* + * Set the state of the suppression of deprecated warnings. + */ + void SetSuppressDeprecatedWarnings(bool v); + + /* + * Get the state of treating developer (author) warnings as errors. + * Returns false, by default, if warnings should not be treated as errors, + * true otherwise. + */ + bool GetDevWarningsAsErrors(cmMakefile const* mf = NULL); + /** + * Set the state of treating developer (author) warnings as errors. + */ + void SetDevWarningsAsErrors(bool v); + + /* + * Get the state of treating deprecated warnings as errors. + * Returns false, by default, if warnings should not be treated as errors, + * true otherwise. + */ + bool GetDeprecatedWarningsAsErrors(cmMakefile const* mf = NULL); + /** + * Set the state of treating developer (author) warnings as errors. + */ + void SetDeprecatedWarningsAsErrors(bool v); /** Display a message to the user. */ void IssueMessage(cmake::MessageType t, std::string const& text, - cmListFileBacktrace const& backtrace = cmListFileBacktrace()); + cmListFileBacktrace const& backtrace = cmListFileBacktrace(), + bool force = false); void IssueMessage(cmake::MessageType t, std::string const& text, - cmListFileContext const& lfc); + cmListFileContext const& lfc, + bool force = false); ///! run the --build option int Build(const std::string& dir, @@ -339,8 +398,7 @@ cmGlobalGenerator *GlobalGenerator; cmCacheManager *CacheManager; - bool SuppressDevWarnings; - bool DoSuppressDevWarnings; + std::map DiagLevels; std::string GeneratorPlatform; std::string GeneratorToolset; @@ -391,6 +449,8 @@ std::string CheckStampFile; std::string CheckStampList; std::string VSSolutionFile; + std::vector SourceFileExtensions; + std::vector HeaderFileExtensions; bool ClearBuildSystem; bool DebugTryCompile; cmFileTimeComparison* FileComparison; @@ -405,6 +465,18 @@ // Print a list of valid generators to stderr. void PrintGeneratorList(); + /** + * Convert a message type between a warning and an error, based on the state + * of the error output CMake variables, in the cache. + */ + cmake::MessageType ConvertMessageType(cmake::MessageType t); + + /* + * Check if messages of this type should be output, based on the state of the + * warning and error output CMake variables, in the cache. + */ + bool IsMessageTypeVisible(cmake::MessageType t); + bool PrintMessagePreamble(cmake::MessageType t, std::ostream& msg); }; @@ -415,8 +487,16 @@ {"-G ", "Specify a build system generator."},\ {"-T ", "Specify toolset name if supported by generator."}, \ {"-A ", "Specify platform name if supported by generator."}, \ + {"-Wdev", "Enable developer warnings."},\ {"-Wno-dev", "Suppress developer warnings."},\ - {"-Wdev", "Enable developer warnings."} + {"-Werror=dev", "Make developer warnings errors."},\ + {"-Wno-error=dev", "Make developer warnings not errors."},\ + {"-Wdeprecated", "Enable deprecation warnings."},\ + {"-Wno-deprecated", "Suppress deprecation warnings."},\ + {"-Werror=deprecated", "Make deprecated macro and function warnings " \ + "errors."},\ + {"-Wno-error=deprecated", "Make deprecated macro and function warnings " \ + "not errors."} #define FOR_EACH_C_FEATURE(F) \ F(c_function_prototypes) \ diff -Nru cmake-3.4.1/Source/CMakeInstallDestinations.cmake cmake-3.5.0/Source/CMakeInstallDestinations.cmake --- cmake-3.4.1/Source/CMakeInstallDestinations.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/CMakeInstallDestinations.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -3,24 +3,29 @@ set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU + set(CMAKE_XDGDATA_DIR_DEFAULT "share") # HAIKU elseif(CYGWIN) set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # CYGWIN set(CMAKE_DOC_DIR_DEFAULT "share/doc/cmake-${CMake_VERSION}") # CYGWIN set(CMAKE_MAN_DIR_DEFAULT "share/man") # CYGWIN + set(CMAKE_XDGDATA_DIR_DEFAULT "share") # CYGWIN else() set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER + set(CMAKE_XDGDATA_DIR_DEFAULT "share") # OTHER endif() set(CMAKE_DATA_DIR_DESC "data") set(CMAKE_DOC_DIR_DESC "docs") set(CMAKE_MAN_DIR_DESC "man pages") +set(CMAKE_XDGDATA_DIR_DESC "XDG specific files") foreach(v CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR + CMAKE_XDGDATA_DIR ) # Populate the cache with empty values so we know when the user sets them. set(${v} "" CACHE STRING "") diff -Nru cmake-3.4.1/Source/CMakeLists.txt cmake-3.5.0/Source/CMakeLists.txt --- cmake-3.4.1/Source/CMakeLists.txt 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/CMakeLists.txt 2016-03-08 14:36:22.000000000 +0000 @@ -299,8 +299,6 @@ cmLocalUnixMakefileGenerator3.cxx cmLocale.h ${MACH_SRCS} - cmMakeDepend.cxx - cmMakeDepend.h cmMakefile.cxx cmMakefile.h cmMakefileTargetGenerator.cxx @@ -548,6 +546,19 @@ endif() endforeach() +foreach(check + STAT_HAS_ST_MTIM + STAT_HAS_ST_MTIMESPEC + ) + if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry + set(CMake_${check} 1) + else() + set(CMake_${check} 0) + endif() + set_property(SOURCE cmFileTimeComparison.cxx APPEND PROPERTY + COMPILE_DEFINITIONS CMake_${check}=${CMake_${check}}) +endforeach() + # create a library used by the command line and the GUI add_library(CMakeLib ${SRCS}) target_link_libraries(CMakeLib cmsys @@ -555,6 +566,7 @@ ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES} ${CMAKE_CURL_LIBRARIES} ${CMAKE_JSONCPP_LIBRARIES} + ${CMake_KWIML_LIBRARIES} ) # On Apple we need CoreFoundation @@ -715,6 +727,9 @@ # Build CPackLib add_library(CPackLib ${CPACK_SRCS}) target_link_libraries(CPackLib CMakeLib) +if(APPLE) + target_link_libraries(CPackLib "-framework Carbon") +endif() if(APPLE) add_executable(cmakexbuild cmakexbuild.cxx) diff -Nru cmake-3.4.1/Source/CMakeVersion.cmake cmake-3.5.0/Source/CMakeVersion.cmake --- cmake-3.4.1/Source/CMakeVersion.cmake 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/CMakeVersion.cmake 2016-03-08 14:36:22.000000000 +0000 @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) -set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 1) +set(CMake_VERSION_MINOR 5) +set(CMake_VERSION_PATCH 0) #set(CMake_VERSION_RC 0) diff -Nru cmake-3.4.1/Source/cmAlgorithms.h cmake-3.5.0/Source/cmAlgorithms.h --- cmake-3.4.1/Source/cmAlgorithms.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmAlgorithms.h 2016-03-08 14:36:22.000000000 +0000 @@ -52,13 +52,13 @@ size_t cmArraySize(const T (&)[N]) { return N; } template -bool cmHasLiteralPrefix(T str1, const char (&str2)[N]) +bool cmHasLiteralPrefix(const T& str1, const char (&str2)[N]) { return cmHasLiteralPrefixImpl(str1, str2, N - 1); } template -bool cmHasLiteralSuffix(T str1, const char (&str2)[N]) +bool cmHasLiteralSuffix(const T& str1, const char (&str2)[N]) { return cmHasLiteralSuffixImpl(str1, str2, N - 1); } @@ -162,13 +162,13 @@ const_iterator end() const { return End; } bool empty() const { return std::distance(Begin, End) == 0; } difference_type size() const { return std::distance(Begin, End); } - cmRange& advance(cmIML_INT_intptr_t amount) + cmRange& advance(KWIML_INT_intptr_t amount) { std::advance(Begin, amount); return *this; } - cmRange& retreat(cmIML_INT_intptr_t amount) + cmRange& retreat(KWIML_INT_intptr_t amount) { std::advance(End, -amount); return *this; @@ -230,7 +230,7 @@ std::string cmJoin(Range const& r, std::string delimiter) { return cmJoin(r, delimiter.c_str()); -}; +} template typename Range::const_iterator cmRemoveN(Range& r, size_t n) diff -Nru cmake-3.4.1/Source/cmArchiveWrite.cxx cmake-3.5.0/Source/cmArchiveWrite.cxx --- cmake-3.4.1/Source/cmArchiveWrite.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmArchiveWrite.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -18,6 +18,10 @@ #include #include "cm_get_date.h" +#ifndef __LA_SSIZE_T +# define __LA_SSIZE_T la_ssize_t +#endif + //---------------------------------------------------------------------------- static std::string cm_archive_error_string(struct archive* a) { diff -Nru cmake-3.4.1/Source/cmAuxSourceDirectoryCommand.cxx cmake-3.5.0/Source/cmAuxSourceDirectoryCommand.cxx --- cmake-3.4.1/Source/cmAuxSourceDirectoryCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmAuxSourceDirectoryCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -60,10 +60,10 @@ std::string ext = file.substr(dotpos+1); std::string base = file.substr(0, dotpos); // Process only source files - if(!base.empty() - && std::find( this->Makefile->GetSourceExtensions().begin(), - this->Makefile->GetSourceExtensions().end(), ext ) - != this->Makefile->GetSourceExtensions().end() ) + std::vector srcExts = + this->Makefile->GetCMakeInstance()->GetSourceExtensions(); + if(!base.empty() && + std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end()) { std::string fullname = templateDirectory; fullname += "/"; diff -Nru cmake-3.4.1/Source/cmBootstrapCommands1.cxx cmake-3.5.0/Source/cmBootstrapCommands1.cxx --- cmake-3.4.1/Source/cmBootstrapCommands1.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmBootstrapCommands1.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -54,6 +54,7 @@ #include "cmFunctionCommand.cxx" #include "cmPathLabel.cxx" #include "cmSearchPath.cxx" +#include "cmParseArgumentsCommand.cxx" void GetBootstrapCommands1(std::vector& commands) { @@ -91,4 +92,5 @@ commands.push_back(new cmFindProgramCommand); commands.push_back(new cmForEachCommand); commands.push_back(new cmFunctionCommand); + commands.push_back(new cmParseArgumentsCommand); } diff -Nru cmake-3.4.1/Source/cmBuildCommand.cxx cmake-3.5.0/Source/cmBuildCommand.cxx --- cmake-3.4.1/Source/cmBuildCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmBuildCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmBuildCommand.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" //---------------------------------------------------------------------- diff -Nru cmake-3.4.1/Source/cmCacheManager.cxx cmake-3.5.0/Source/cmCacheManager.cxx --- cmake-3.4.1/Source/cmCacheManager.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCacheManager.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -13,7 +13,6 @@ #include "cmCacheManager.h" #include "cmSystemTools.h" #include "cmGeneratedFileStream.h" -#include "cmMakefile.h" #include "cmake.h" #include "cmVersion.h" @@ -22,101 +21,10 @@ #include #include -cmCacheManager::cmCacheManager(cmake* cm) +cmCacheManager::cmCacheManager() { this->CacheMajorVersion = 0; this->CacheMinorVersion = 0; - this->CMakeInstance = cm; -} - -bool cmCacheManager::LoadCache(const std::string& path) -{ - std::set emptySet; - return this->LoadCache(path, true, emptySet, emptySet); -} - -static bool ParseEntryWithoutType(const std::string& entry, - std::string& var, - std::string& value) -{ - // input line is: key=value - static cmsys::RegularExpression reg( - "^([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); - // input line is: "key"=value - static cmsys::RegularExpression regQuoted( - "^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); - bool flag = false; - if(regQuoted.find(entry)) - { - var = regQuoted.match(1); - value = regQuoted.match(2); - flag = true; - } - else if (reg.find(entry)) - { - var = reg.match(1); - value = reg.match(2); - flag = true; - } - - // if value is enclosed in single quotes ('foo') then remove them - // it is used to enclose trailing space or tab - if (flag && - value.size() >= 2 && - value[0] == '\'' && - value[value.size() - 1] == '\'') - { - value = value.substr(1, - value.size() - 2); - } - - return flag; -} - -bool cmCacheManager::ParseEntry(const std::string& entry, - std::string& var, - std::string& value, - cmState::CacheEntryType& type) -{ - // input line is: key:type=value - static cmsys::RegularExpression reg( - "^([^=:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); - // input line is: "key":type=value - static cmsys::RegularExpression regQuoted( - "^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); - bool flag = false; - if(regQuoted.find(entry)) - { - var = regQuoted.match(1); - type = cmState::StringToCacheEntryType(regQuoted.match(2).c_str()); - value = regQuoted.match(3); - flag = true; - } - else if (reg.find(entry)) - { - var = reg.match(1); - type = cmState::StringToCacheEntryType(reg.match(2).c_str()); - value = reg.match(3); - flag = true; - } - - // if value is enclosed in single quotes ('foo') then remove them - // it is used to enclose trailing space or tab - if (flag && - value.size() >= 2 && - value[0] == '\'' && - value[value.size() - 1] == '\'') - { - value = value.substr(1, - value.size() - 2); - } - - if (!flag) - { - return ParseEntryWithoutType(entry, var, value); - } - - return flag; } void cmCacheManager::CleanCMakeFiles(const std::string& path) @@ -156,12 +64,14 @@ const char *realbuffer; std::string buffer; std::string entryKey; + unsigned int lineno = 0; while(fin) { // Format is key:type=value std::string helpString; CacheEntry e; cmSystemTools::GetLineFromStream(fin, buffer); + lineno++; realbuffer = buffer.c_str(); while(*realbuffer != '0' && (*realbuffer == ' ' || @@ -169,6 +79,7 @@ *realbuffer == '\r' || *realbuffer == '\n')) { + if (*realbuffer == '\n') lineno++; realbuffer++; } // skip blank lines and comment lines @@ -188,6 +99,7 @@ helpString += &realbuffer[2]; } cmSystemTools::GetLineFromStream(fin, buffer); + lineno++; realbuffer = buffer.c_str(); if(!fin) { @@ -195,7 +107,7 @@ } } e.SetProperty("HELPSTRING", helpString.c_str()); - if(cmCacheManager::ParseEntry(realbuffer, entryKey, e.Value, e.Type)) + if(cmState::ParseCacheEntry(realbuffer, entryKey, e.Value, e.Type)) { if ( excludes.find(entryKey) == excludes.end() ) { @@ -230,8 +142,10 @@ } else { - cmSystemTools::Error("Parse error in cache file ", cacheFile.c_str(), - ". Offending entry: ", realbuffer); + std::ostringstream error; + error << "Parse error in cache file " << cacheFile; + error << " on line " << lineno << ". Offending entry: " << realbuffer; + cmSystemTools::Error(error.str().c_str()); } } this->CacheMajorVersion = 0; @@ -678,7 +592,6 @@ } e.SetProperty("HELPSTRING", helpString? helpString : "(This variable does not exist and should not be used)"); - this->CMakeInstance->UnwatchUnusedCli(key); } bool cmCacheManager::CacheIterator::IsAtEnd() const diff -Nru cmake-3.4.1/Source/cmCacheManager.h cmake-3.5.0/Source/cmCacheManager.h --- cmake-3.4.1/Source/cmCacheManager.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCacheManager.h 2016-03-08 14:36:22.000000000 +0000 @@ -16,9 +16,7 @@ #include "cmPropertyMap.h" #include "cmState.h" -class cmMakefile; class cmMarkAsAdvancedCommand; -class cmake; /** \class cmCacheManager * \brief Control class for cmake's cache @@ -29,7 +27,7 @@ class cmCacheManager { public: - cmCacheManager(cmake* cm); + cmCacheManager(); class CacheIterator; friend class cmCacheManager::CacheIterator; @@ -100,7 +98,6 @@ } ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. - bool LoadCache(const std::string& path); bool LoadCache(const std::string& path, bool internal, std::set& excludes, std::set& includes); @@ -124,12 +121,6 @@ int GetSize() { return static_cast(this->Cache.size()); } - ///! Break up a line like VAR:type="value" into var, type and value - static bool ParseEntry(const std::string& entry, - std::string& var, - std::string& value, - cmState::CacheEntryType& type); - ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; @@ -241,7 +232,7 @@ void WritePropertyEntries(std::ostream& os, CacheIterator const& i); CacheEntryMap Cache; - // Only cmake and cmMakefile should be able to add cache values + // Only cmake and cmState should be able to add cache values // the commands should never use the cmCacheManager directly friend class cmState; // allow access to add cache values friend class cmake; // allow access to add cache values diff -Nru cmake-3.4.1/Source/cmcmd.cxx cmake-3.5.0/Source/cmcmd.cxx --- cmake-3.4.1/Source/cmcmd.cxx 2015-12-02 15:43:22.000000000 +0000 +++ cmake-3.5.0/Source/cmcmd.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -35,8 +35,7 @@ #include // required for atoi #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -// defined in binexplib.cxx -bool DumpFile(const char* filename, FILE *fout); +#include "bindexplib.h" #endif void CMakeCommandUsage(const char* program) @@ -53,25 +52,25 @@ // If you add new commands, change here, // and in cmakemain.cxx in the options table errorStream - << "Usage: " << program << " -E [command] [arguments ...]\n" + << "Usage: " << program << " -E [arguments...]\n" << "Available commands: \n" - << " chdir dir cmd [args]... - run command in a given directory\n" + << " chdir dir cmd [args...] - run command in a given directory\n" << " compare_files file1 file2 - check if file1 is same as file2\n" - << " copy file destination - copy file to destination (either file " - "or directory)\n" - << " copy_directory source destination - copy directory 'source' " - "content to directory 'destination'\n" - << " copy_if_different in-file out-file - copy file if input has " + << " copy ... destination - copy files to destination " + "(either file or directory)\n" + << " copy_directory ... destination - copy content of ... " + "directories to 'destination' directory\n" + << " copy_if_different ... destination - copy files if it has " "changed\n" - << " echo [string]... - displays arguments as text\n" - << " echo_append [string]... - displays arguments as text but no new " + << " echo [...] - displays arguments as text\n" + << " echo_append [...] - displays arguments as text but no new " "line\n" << " env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...\n" << " - run command in a modified environment\n" << " environment - display the current environment\n" - << " make_directory dir - create a directory\n" - << " md5sum file1 [...] - compute md5sum of files\n" - << " remove [-f] file1 file2 ... - remove the file(s), use -f to force " + << " make_directory ... - create parent and directories\n" + << " md5sum ... - compute md5sum of files\n" + << " remove [-f] ... - remove the file(s), use -f to force " "it\n" << " remove_directory dir - remove a directory and its contents\n" << " rename oldname newname - rename a file or directory " @@ -79,7 +78,7 @@ << " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n" << " - create or extract a tar or zip archive\n" << " sleep ... - sleep for given number of seconds\n" - << " time command [args] ... - run command and return elapsed time\n" + << " time command [args...] - run command and return elapsed time\n" << " touch file - touch a file.\n" << " touch_nocreate file - touch a file but do not create it.\n" #if defined(_WIN32) && !defined(__CYGWIN__) @@ -150,42 +149,79 @@ if (args.size() > 1) { // Copy file - if (args[1] == "copy" && args.size() == 4) + if (args[1] == "copy" && args.size() > 3) { - if(!cmSystemTools::cmCopyFile(args[2].c_str(), args[3].c_str())) + // If multiple source files specified, + // then destination must be directory + if ((args.size() > 4) && + (!cmSystemTools::FileIsDirectory(args[args.size() - 1]))) { - std::cerr << "Error copying file \"" << args[2] - << "\" to \"" << args[3] << "\".\n"; + std::cerr << "Error: Target (for copy command) \"" + << args[args.size() - 1] + << "\" is not a directory.\n"; return 1; } - return 0; + // If error occurs we want to continue copying next files. + bool return_value = 0; + for (std::string::size_type cc = 2; cc < args.size() - 1; cc ++) + { + if(!cmSystemTools::cmCopyFile(args[cc].c_str(), + args[args.size() - 1].c_str())) + { + std::cerr << "Error copying file \"" << args[cc] + << "\" to \"" << args[args.size() - 1] << "\".\n"; + return_value = 1; + } + } + return return_value; } // Copy file if different. - if (args[1] == "copy_if_different" && args.size() == 4) + if (args[1] == "copy_if_different" && args.size() > 3) { - if(!cmSystemTools::CopyFileIfDifferent(args[2].c_str(), - args[3].c_str())) + // If multiple source files specified, + // then destination must be directory + if ((args.size() > 4) && + (!cmSystemTools::FileIsDirectory(args[args.size() - 1]))) { - std::cerr << "Error copying file (if different) from \"" - << args[2] << "\" to \"" << args[3] - << "\".\n"; + std::cerr << "Error: Target (for copy_if_different command) \"" + << args[args.size() - 1] + << "\" is not a directory.\n"; return 1; } - return 0; + // If error occurs we want to continue copying next files. + bool return_value = 0; + for (std::string::size_type cc = 2; cc < args.size() - 1; cc ++) + { + if(!cmSystemTools::CopyFileIfDifferent(args[cc].c_str(), + args[args.size() - 1].c_str())) + { + std::cerr << "Error copying file (if different) from \"" + << args[cc] << "\" to \"" << args[args.size() - 1] + << "\".\n"; + return_value = 1; + } + } + return return_value; } // Copy directory content - if (args[1] == "copy_directory" && args.size() == 4) + if (args[1] == "copy_directory" && args.size() > 3) { - if(!cmSystemTools::CopyADirectory(args[2], args[3])) + // If error occurs we want to continue copying next files. + bool return_value = 0; + for (std::string::size_type cc = 2; cc < args.size() - 1; cc ++) { - std::cerr << "Error copying directory from \"" - << args[2] << "\" to \"" << args[3] - << "\".\n"; - return 1; + if(!cmSystemTools::CopyADirectory(args[cc].c_str(), + args[args.size() - 1].c_str())) + { + std::cerr << "Error copying directory from \"" + << args[cc] << "\" to \"" << args[args.size() - 1] + << "\".\n"; + return_value = 1; + } } - return 0; + return return_value; } // Rename a file or directory @@ -240,13 +276,16 @@ return 1; } std::string objfile; + bindexplib deffile; while(cmSystemTools::GetLineFromStream(fin, objfile)) { - if (!DumpFile(objfile.c_str(), fout)) + if( !deffile.AddObjectFile(objfile.c_str())) { return 1; } } + deffile.WriteFile(fout); + fclose(fout); return 0; } #endif @@ -322,11 +361,10 @@ } // Now run the real compiler command and return its result value. - if(!cmSystemTools::RunSingleCommand(orig_cmd, 0, &stdErr, &ret, 0, + if(!cmSystemTools::RunSingleCommand(orig_cmd, 0, 0, &ret, 0, cmSystemTools::OUTPUT_PASSTHROUGH)) { - std::cerr << "Error running '" << orig_cmd[0] << "': " - << stdErr << "\n"; + std::cerr << "Error running '" << orig_cmd[0] << "'\n"; return 1; } return ret; @@ -408,15 +446,20 @@ } #endif - else if (args[1] == "make_directory" && args.size() == 3) + else if (args[1] == "make_directory" && args.size() > 2) { - if(!cmSystemTools::MakeDirectory(args[2].c_str())) + // If error occurs we want to continue copying next files. + bool return_value = 0; + for (std::string::size_type cc = 2; cc < args.size(); cc ++) { - std::cerr << "Error making directory \"" << args[2] - << "\".\n"; - return 1; + if(!cmSystemTools::MakeDirectory(args[cc].c_str())) + { + std::cerr << "Error creating directory \"" + << args[cc] << "\".\n"; + return_value = 1; + } } - return 0; + return return_value; } else if (args[1] == "remove_directory" && args.size() == 3) @@ -511,7 +554,7 @@ // Clock command else if (args[1] == "time" && args.size() > 2) { - std::string command = cmJoin(cmMakeRange(args).advance(2), " "); + std::vector command(args.begin()+2, args.end()); clock_t clock_start, clock_finish; time_t time_start, time_finish; @@ -519,7 +562,7 @@ time(&time_start); clock_start = clock(); int ret =0; - cmSystemTools::RunSingleCommand(command.c_str(), 0, 0, &ret); + cmSystemTools::RunSingleCommand(command, 0, 0, &ret); clock_finish = clock(); time(&time_finish); @@ -577,7 +620,7 @@ int retval = 0; int timeout = 0; if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, 0, &retval, - directory.c_str(), cmSystemTools::OUTPUT_NORMAL, timeout) ) + directory.c_str(), cmSystemTools::OUTPUT_PASSTHROUGH, timeout) ) { return retval; } @@ -765,15 +808,16 @@ startOutDir = cmSystemTools::CollapseFullPath(startOutDir); cm.SetHomeDirectory(homeDir); cm.SetHomeOutputDirectory(homeOutDir); + cm.GetCurrentSnapshot().SetDefaultDefinitions(); if(cmGlobalGenerator* ggd = cm.CreateGlobalGenerator(gen)) { cm.SetGlobalGenerator(ggd); cmState::Snapshot snapshot = cm.GetCurrentSnapshot(); + snapshot.GetDirectory().SetCurrentBinary(startOutDir); + snapshot.GetDirectory().SetCurrentSource(startDir); cmsys::auto_ptr mf(new cmMakefile(ggd, snapshot)); cmsys::auto_ptr lgd( ggd->CreateLocalGenerator(mf.get())); - lgd->GetMakefile()->SetCurrentSourceDirectory(startDir); - lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir); // Actually scan dependencies. return lgd->UpdateDependencies(depInfo.c_str(), diff -Nru cmake-3.4.1/Source/cmCommonTargetGenerator.cxx cmake-3.5.0/Source/cmCommonTargetGenerator.cxx --- cmake-3.4.1/Source/cmCommonTargetGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCommonTargetGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -18,7 +18,6 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" -#include "cmTarget.h" cmCommonTargetGenerator::cmCommonTargetGenerator( cmOutputConverter::RelativeRoot wd, @@ -26,7 +25,6 @@ ) : WorkingDirectory(wd) , GeneratorTarget(gt) - , Target(gt->Target) , Makefile(gt->Makefile) , LocalGenerator(static_cast(gt->LocalGenerator)) , GlobalGenerator(static_cast( @@ -83,7 +81,7 @@ //---------------------------------------------------------------------------- void cmCommonTargetGenerator::AddModuleDefinitionFlag(std::string& flags) { - if(this->ModuleDefinitionFile.empty()) + if(!this->ModuleDefinitionFile) { return; } @@ -100,7 +98,7 @@ // vs6's "cl -link" pass it to the linker. std::string flag = defFileFlag; flag += (this->LocalGenerator->ConvertToLinkReference( - this->ModuleDefinitionFile)); + this->ModuleDefinitionFile->GetFullPath())); this->LocalGenerator->AppendFlags(flags, flag); } @@ -109,7 +107,7 @@ { std::string mod_dir; const char* target_mod_dir = - this->Target->GetProperty("Fortran_MODULE_DIRECTORY"); + this->GeneratorTarget->GetProperty("Fortran_MODULE_DIRECTORY"); const char* moddir_flag = this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG"); if(target_mod_dir && moddir_flag) @@ -123,7 +121,7 @@ else { // Interpret relative to the current output directory. - mod_dir = this->Makefile->GetCurrentBinaryDirectory(); + mod_dir = this->LocalGenerator->GetCurrentBinaryDirectory(); mod_dir += "/"; mod_dir += target_mod_dir; } @@ -214,7 +212,7 @@ this->LocalGenerator->GetFortranFormat(srcfmt); if(format == cmLocalGenerator::FortranFormatNone) { - const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT"); + const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT"); format = this->LocalGenerator->GetFortranFormat(tgtfmt); } const char* var = 0; @@ -265,7 +263,7 @@ for(std::vector::iterator i = includes.begin(); i != includes.end(); ++i) { - if(this->Target->NameResolvesToFramework(*i)) + if(this->GlobalGenerator->NameResolvesToFramework(*i)) { std::string frameworkDir = *i; frameworkDir += "/../"; @@ -316,10 +314,11 @@ this->AddFortranFlags(flags); } - this->LocalGenerator->AddCMP0018Flags(flags, this->Target, + this->LocalGenerator->AddCMP0018Flags(flags, this->GeneratorTarget, lang, this->ConfigName); - this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target, + this->LocalGenerator->AddVisibilityPresetFlags(flags, + this->GeneratorTarget, lang); // Append old-style preprocessor definition flags. @@ -331,7 +330,7 @@ AppendFlags(flags,this->GetFrameworkFlags(l)); // Add target-specific flags. - this->LocalGenerator->AddCompileOptions(flags, this->Target, + this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, lang, this->ConfigName); ByLanguageMap::value_type entry(l, flags); @@ -348,13 +347,14 @@ std::set defines; const char *lang = l.c_str(); // Add the export symbol definition for shared library objects. - if(const char* exportMacro = this->Target->GetExportMacro()) + if(const char* exportMacro = + this->GeneratorTarget->GetExportMacro()) { this->LocalGenerator->AppendDefines(defines, exportMacro); } // Add preprocessor definitions for this target and configuration. - this->LocalGenerator->AddCompileDefinitions(defines, this->Target, + this->LocalGenerator->AddCompileDefinitions(defines, this->GeneratorTarget, this->LocalGenerator->GetConfigName(), l); std::string definesString; @@ -383,7 +383,7 @@ cmCommonTargetGenerator::GetLinkedTargetDirectories() const { std::vector dirs; - std::set emitted; + std::set emitted; if (cmComputeLinkInformation* cli = this->GeneratorTarget->GetLinkInformation(this->ConfigName)) { @@ -391,21 +391,18 @@ for(cmComputeLinkInformation::ItemVector::const_iterator i = items.begin(); i != items.end(); ++i) { - cmTarget const* linkee = i->Target; + cmGeneratorTarget const* linkee = i->Target; if(linkee && !linkee->IsImported() // We can ignore the INTERFACE_LIBRARY items because // Target->GetLinkInformation already processed their // link interface and they don't have any output themselves. - && linkee->GetType() != cmTarget::INTERFACE_LIBRARY + && linkee->GetType() != cmState::INTERFACE_LIBRARY && emitted.insert(linkee).second) { - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(linkee); - cmLocalGenerator* lg = gt->GetLocalGenerator(); - cmMakefile* mf = linkee->GetMakefile(); - std::string di = mf->GetCurrentBinaryDirectory(); + cmLocalGenerator* lg = linkee->GetLocalGenerator(); + std::string di = lg->GetCurrentBinaryDirectory(); di += "/"; - di += lg->GetTargetDirectory(*linkee); + di += lg->GetTargetDirectory(linkee); dirs.push_back(di); } } diff -Nru cmake-3.4.1/Source/cmCommonTargetGenerator.h cmake-3.5.0/Source/cmCommonTargetGenerator.h --- cmake-3.4.1/Source/cmCommonTargetGenerator.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCommonTargetGenerator.h 2016-03-08 14:36:22.000000000 +0000 @@ -21,7 +21,6 @@ class cmLocalCommonGenerator; class cmMakefile; class cmSourceFile; -class cmTarget; /** \class cmCommonTargetGenerator * \brief Common infrastructure for Makefile and Ninja per-target generators @@ -49,14 +48,13 @@ cmOutputConverter::RelativeRoot WorkingDirectory; cmGeneratorTarget* GeneratorTarget; - cmTarget* Target; cmMakefile* Makefile; cmLocalCommonGenerator* LocalGenerator; cmGlobalCommonGenerator* GlobalGenerator; std::string ConfigName; // The windows module definition source file (.def), if any. - std::string ModuleDefinitionFile; + cmSourceFile const* ModuleDefinitionFile; // Target-wide Fortran module output directory. bool FortranModuleDirectoryComputed; diff -Nru cmake-3.4.1/Source/cmComputeLinkDepends.cxx cmake-3.5.0/Source/cmComputeLinkDepends.cxx --- cmake-3.4.1/Source/cmComputeLinkDepends.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmComputeLinkDepends.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -185,7 +185,9 @@ // The configuration being linked. this->HasConfig = !config.empty(); this->Config = (this->HasConfig)? config : std::string(); - this->LinkType = this->Target->Target->ComputeLinkType(this->Config); + std::vector debugConfigs = + this->Makefile->GetCMakeInstance()->GetDebugConfigs(); + this->LinkType = CMP0003_ComputeLinkType(this->Config, debugConfigs); // Enable debug mode if requested. this->DebugMode = this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE"); @@ -268,9 +270,9 @@ { int i = *li; LinkEntry const& e = this->EntryList[i]; - cmTarget const* t = e.Target; + cmGeneratorTarget const* t = e.Target; // Entries that we know the linker will re-use do not need to be repeated. - bool uniquify = t && t->GetType() == cmTarget::SHARED_LIBRARY; + bool uniquify = t && t->GetType() == cmState::SHARED_LIBRARY; if(!uniquify || emmitted.insert(i).second) { this->FinalLinkEntries.push_back(e); @@ -362,14 +364,12 @@ // Follow the item's dependencies. if(entry.Target) { - cmGeneratorTarget* gtgt = - this->GlobalGenerator->GetGeneratorTarget(entry.Target); // Follow the target dependencies. if(cmLinkInterface const* iface = - gtgt->GetLinkInterface(this->Config, this->Target->Target)) + entry.Target->GetLinkInterface(this->Config, this->Target)) { const bool isIface = - entry.Target->GetType() == cmTarget::INTERFACE_LIBRARY; + entry.Target->GetType() == cmState::INTERFACE_LIBRARY; // This target provides its own link interface information. this->AddLinkEntries(depender_index, iface->Libraries); @@ -463,10 +463,8 @@ // Target items may have their own dependencies. if(entry.Target) { - cmGeneratorTarget* gtgt = - this->GlobalGenerator->GetGeneratorTarget(entry.Target); if(cmLinkInterface const* iface = - gtgt->GetLinkInterface(this->Config, this->Target->Target)) + entry.Target->GetLinkInterface(this->Config, this->Target)) { // Follow public and private dependencies transitively. this->FollowSharedDeps(index, iface, true); @@ -486,24 +484,24 @@ // Look for entries meant for this configuration. std::vector actual_libs; - cmTarget::LinkLibraryType llt = cmTarget::GENERAL; + cmTargetLinkLibraryType llt = GENERAL_LibraryType; bool haveLLT = false; for(std::vector::const_iterator di = deplist.begin(); di != deplist.end(); ++di) { if(*di == "debug") { - llt = cmTarget::DEBUG; + llt = DEBUG_LibraryType; haveLLT = true; } else if(*di == "optimized") { - llt = cmTarget::OPTIMIZED; + llt = OPTIMIZED_LibraryType; haveLLT = true; } else if(*di == "general") { - llt = cmTarget::GENERAL; + llt = GENERAL_LibraryType; haveLLT = true; } else if(!di->empty()) @@ -521,17 +519,17 @@ { if(strcmp(val, "debug") == 0) { - llt = cmTarget::DEBUG; + llt = DEBUG_LibraryType; } else if(strcmp(val, "optimized") == 0) { - llt = cmTarget::OPTIMIZED; + llt = OPTIMIZED_LibraryType; } } } // If the library is meant for this link type then use it. - if(llt == cmTarget::GENERAL || llt == this->LinkType) + if(llt == GENERAL_LibraryType || llt == this->LinkType) { cmLinkItem item(*di, this->FindTargetToLink(depender_index, *di)); actual_libs.push_back(item); @@ -543,7 +541,7 @@ } // Reset the link type until another explicit type is given. - llt = cmTarget::GENERAL; + llt = GENERAL_LibraryType; haveLLT = false; } } @@ -635,14 +633,16 @@ } //---------------------------------------------------------------------------- -cmTarget const* cmComputeLinkDepends::FindTargetToLink(int depender_index, - const std::string& name) +cmGeneratorTarget const* +cmComputeLinkDepends::FindTargetToLink(int depender_index, + const std::string& name) { // Look for a target in the scope of the depender. - cmTarget const* from = this->Target->Target; + cmGeneratorTarget const* from = this->Target; if(depender_index >= 0) { - if(cmTarget const* depender = this->EntryList[depender_index].Target) + if(cmGeneratorTarget const* depender = + this->EntryList[depender_index].Target) { from = depender; } @@ -934,12 +934,10 @@ int count = 2; for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { - if(cmTarget const* target = this->EntryList[*ni].Target) + if(cmGeneratorTarget const* target = this->EntryList[*ni].Target) { - cmGeneratorTarget* gtgt = - this->GlobalGenerator->GetGeneratorTarget(target); if(cmLinkInterface const* iface = - gtgt->GetLinkInterface(this->Config, this->Target->Target)) + target->GetLinkInterface(this->Config, this->Target)) { if(iface->Multiplicity > count) { diff -Nru cmake-3.4.1/Source/cmComputeLinkDepends.h cmake-3.5.0/Source/cmComputeLinkDepends.h --- cmake-3.4.1/Source/cmComputeLinkDepends.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmComputeLinkDepends.h 2016-03-08 14:36:22.000000000 +0000 @@ -13,7 +13,7 @@ #define cmComputeLinkDepends_h #include "cmStandardIncludes.h" -#include "cmTarget.h" +#include "cmLinkItem.h" #include "cmGraphAdjacencyList.h" @@ -23,7 +23,6 @@ class cmGlobalGenerator; class cmMakefile; class cmGeneratorTarget; -class cmTarget; class cmake; /** \class cmComputeLinkDepends @@ -40,7 +39,7 @@ struct LinkEntry { std::string Item; - cmTarget const* Target; + cmGeneratorTarget const* Target; bool IsSharedDep; bool IsFlag; LinkEntry(): Item(), Target(0), IsSharedDep(false), IsFlag(false) {} @@ -53,7 +52,7 @@ EntryVector const& Compute(); void SetOldLinkDirMode(bool b); - std::set const& GetOldWrongConfigItems() const + std::set const& GetOldWrongConfigItems() const { return this->OldWrongConfigItems; } private: @@ -66,8 +65,6 @@ std::string Config; EntryVector FinalLinkEntries; - typedef cmTarget::LinkLibraryVectorType LinkLibraryVectorType; - std::map::iterator AllocateLinkEntry(std::string const& item); int AddLinkEntry(cmLinkItem const& item); @@ -75,8 +72,8 @@ void AddDirectLinkEntries(); template void AddLinkEntries(int depender_index, std::vector const& libs); - cmTarget const* FindTargetToLink(int depender_index, - const std::string& name); + cmGeneratorTarget const* FindTargetToLink(int depender_index, + const std::string& name); // One entry for each unique item. std::vector EntryList; @@ -153,11 +150,11 @@ // Record of the original link line. std::vector OriginalEntries; - std::set OldWrongConfigItems; + std::set OldWrongConfigItems; void CheckWrongConfigItem(cmLinkItem const& item); int ComponentOrderId; - cmTarget::LinkLibraryType LinkType; + cmTargetLinkLibraryType LinkType; bool HasConfig; bool DebugMode; bool OldLinkDirMode; diff -Nru cmake-3.4.1/Source/cmComputeLinkInformation.cxx cmake-3.5.0/Source/cmComputeLinkInformation.cxx --- cmake-3.4.1/Source/cmComputeLinkInformation.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmComputeLinkInformation.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -19,7 +19,6 @@ #include "cmState.h" #include "cmOutputConverter.h" #include "cmMakefile.h" -#include "cmTarget.h" #include "cmGeneratorTarget.h" #include "cmake.h" #include "cmAlgorithms.h" @@ -284,14 +283,14 @@ // Check whether we should skip dependencies on shared library files. this->LinkDependsNoShared = - this->Target->Target->GetPropertyAsBool("LINK_DEPENDS_NO_SHARED"); + this->Target->GetPropertyAsBool("LINK_DEPENDS_NO_SHARED"); // On platforms without import libraries there may be a special flag // to use when creating a plugin (module) that obtains symbols from // the program that will load it. this->LoaderFlag = 0; if(!this->UseImportLibrary && - this->Target->Target->GetType() == cmTarget::MODULE_LIBRARY) + this->Target->GetType() == cmState::MODULE_LIBRARY) { std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_"; loader_flag_var += this->LinkLanguage; @@ -309,10 +308,10 @@ // Get options needed to specify RPATHs. this->RuntimeUseChrpath = false; - if(this->Target->Target->GetType() != cmTarget::STATIC_LIBRARY) + if(this->Target->GetType() != cmState::STATIC_LIBRARY) { const char* tType = - ((this->Target->Target->GetType() == cmTarget::EXECUTABLE)? + ((this->Target->GetType() == cmState::EXECUTABLE)? "EXECUTABLE" : "SHARED_LIBRARY"); std::string rtVar = "CMAKE_"; rtVar += tType; @@ -378,9 +377,9 @@ // Add the search path entries requested by the user to path ordering. this->OrderLinkerSearchPath - ->AddUserDirectories(this->Target->Target->GetLinkDirectories()); + ->AddUserDirectories(this->Target->GetLinkDirectories()); this->OrderRuntimeSearchPath - ->AddUserDirectories(this->Target->Target->GetLinkDirectories()); + ->AddUserDirectories(this->Target->GetLinkDirectories()); // Set up the implicit link directories. this->LoadImplicitLinkInfo(); @@ -408,13 +407,13 @@ // order to support such projects we need to add the directories // containing libraries linked with a full path to the -L path. this->OldLinkDirMode = - this->Target->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW; + this->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW; if(this->OldLinkDirMode) { // Construct a mask to not bother with this behavior for link // directories already specified by the user. std::vector const& dirs = - this->Target->Target->GetLinkDirectories(); + this->Target->GetLinkDirectories(); this->OldLinkDirMask.insert(dirs.begin(), dirs.end()); } @@ -471,7 +470,7 @@ } //---------------------------------------------------------------------------- -std::set const& +const std::set& cmComputeLinkInformation::GetSharedLibrariesLinked() { return this->SharedLibrariesLinked; @@ -481,10 +480,10 @@ bool cmComputeLinkInformation::Compute() { // Skip targets that do not link. - if(!(this->Target->GetType() == cmTarget::EXECUTABLE || - this->Target->GetType() == cmTarget::SHARED_LIBRARY || - this->Target->GetType() == cmTarget::MODULE_LIBRARY || - this->Target->GetType() == cmTarget::STATIC_LIBRARY)) + if(!(this->Target->GetType() == cmState::EXECUTABLE || + this->Target->GetType() == cmState::SHARED_LIBRARY || + this->Target->GetType() == cmState::MODULE_LIBRARY || + this->Target->GetType() == cmState::STATIC_LIBRARY)) { return false; } @@ -521,7 +520,7 @@ // Restore the target link type so the correct system runtime // libraries are found. const char* lss = - this->Target->Target->GetProperty("LINK_SEARCH_END_STATIC"); + this->Target->GetProperty("LINK_SEARCH_END_STATIC"); if(cmSystemTools::IsOn(lss)) { this->SetCurrentLinkType(LinkStatic); @@ -537,16 +536,16 @@ // For CMake 2.4 bug-compatibility we need to consider the output // directories of targets linked in another configuration as link // directories. - std::set const& wrongItems = cld.GetOldWrongConfigItems(); - for(std::set::const_iterator i = wrongItems.begin(); - i != wrongItems.end(); ++i) + std::set const& wrongItems = + cld.GetOldWrongConfigItems(); + for(std::set::const_iterator i = + wrongItems.begin(); i != wrongItems.end(); ++i) { - cmTarget const* tgt = *i; - cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt); + cmGeneratorTarget const* tgt = *i; bool implib = (this->UseImportLibrary && - (tgt->GetType() == cmTarget::SHARED_LIBRARY)); - std::string lib = gtgt->GetFullPath(this->Config , implib, true); + (tgt->GetType() == cmState::SHARED_LIBRARY)); + std::string lib = tgt->GetFullPath(this->Config , implib, true); this->OldLinkDirItems.push_back(lib); } } @@ -572,7 +571,7 @@ "name." ; this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } return true; @@ -632,7 +631,7 @@ //---------------------------------------------------------------------------- void cmComputeLinkInformation::AddItem(std::string const& item, - cmTarget const* tgt) + cmGeneratorTarget const* tgt) { // Compute the proper name to use to link this library. const std::string& config = this->Config; @@ -646,7 +645,6 @@ if(tgt && tgt->IsLinkable()) { - cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt); // This is a CMake target. Ask the target for its real name. if(impexe && this->LoaderFlag) { @@ -656,13 +654,13 @@ std::string linkItem; linkItem = this->LoaderFlag; - std::string exe = gtgt->GetFullPath(config, this->UseImportLibrary, + std::string exe = tgt->GetFullPath(config, this->UseImportLibrary, true); linkItem += exe; this->Items.push_back(Item(linkItem, true, tgt)); this->Depends.push_back(exe); } - else if(tgt->GetType() == cmTarget::INTERFACE_LIBRARY) + else if(tgt->GetType() == cmState::INTERFACE_LIBRARY) { // Add the interface library as an item so it can be considered as part // of COMPATIBLE_INTERFACE_ enforcement. The generators will ignore @@ -674,12 +672,12 @@ // Decide whether to use an import library. bool implib = (this->UseImportLibrary && - (impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY)); + (impexe || tgt->GetType() == cmState::SHARED_LIBRARY)); // Pass the full path to the target file. - std::string lib = gtgt->GetFullPath(config, implib, true); + std::string lib = tgt->GetFullPath(config, implib, true); if(!this->LinkDependsNoShared || - tgt->GetType() != cmTarget::SHARED_LIBRARY) + tgt->GetType() != cmState::SHARED_LIBRARY) { this->Depends.push_back(lib); } @@ -716,7 +714,7 @@ //---------------------------------------------------------------------------- void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, - cmTarget const* tgt) + const cmGeneratorTarget* tgt) { // If dropping shared library dependencies, ignore them. if(this->SharedDependencyMode == SharedDepModeNone) @@ -730,7 +728,7 @@ { // The target will provide a full path. Make sure it is a shared // library. - if(tgt->GetType() != cmTarget::SHARED_LIBRARY) + if(tgt->GetType() != cmState::SHARED_LIBRARY) { return; } @@ -760,17 +758,13 @@ return; } - cmGeneratorTarget *gtgt = 0; - // Get a full path to the dependent shared library. // Add it to the runtime path computation so that the target being // linked will be able to find it. std::string lib; if(tgt) { - gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt); - - lib = gtgt->GetFullPath(this->Config, this->UseImportLibrary); + lib = tgt->GetFullPath(this->Config, this->UseImportLibrary); this->AddLibraryRuntimeInfo(lib, tgt); } else @@ -795,9 +789,9 @@ } if(order) { - if(gtgt) + if(tgt) { - std::string soName = gtgt->GetSOName(this->Config); + std::string soName = tgt->GetSOName(this->Config); const char* soname = soName.empty()? 0 : soName.c_str(); order->AddRuntimeLibrary(lib, soname); } @@ -824,9 +818,9 @@ const char* target_type_str = 0; switch(this->Target->GetType()) { - case cmTarget::EXECUTABLE: target_type_str = "EXE"; break; - case cmTarget::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break; - case cmTarget::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break; + case cmState::EXECUTABLE: target_type_str = "EXE"; break; + case cmState::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break; + case cmState::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break; default: break; } if(target_type_str) @@ -860,7 +854,7 @@ // Lookup the starting link type from the target (linked statically?). const char* lss = - this->Target->Target->GetProperty("LINK_SEARCH_START_STATIC"); + this->Target->GetProperty("LINK_SEARCH_START_STATIC"); this->StartLinkType = cmSystemTools::IsOn(lss)? LinkStatic : LinkShared; this->CurrentLinkType = this->StartLinkType; } @@ -1082,7 +1076,7 @@ //---------------------------------------------------------------------------- void cmComputeLinkInformation::AddTargetItem(std::string const& item, - cmTarget const* target) + cmGeneratorTarget const* target) { // This is called to handle a link item that is a full path to a target. // If the target is not a static library make sure the link type is @@ -1090,13 +1084,13 @@ // shared and static libraries but static-mode can handle only // static libraries. If a previous user item changed the link type // to static we need to make sure it is back to shared. - if(target->GetType() != cmTarget::STATIC_LIBRARY) + if(target->GetType() != cmState::STATIC_LIBRARY) { this->SetCurrentLinkType(LinkShared); } // Keep track of shared library targets linked. - if(target->GetType() == cmTarget::SHARED_LIBRARY) + if(target->GetType() == cmState::SHARED_LIBRARY) { this->SharedLibrariesLinked.insert(target); } @@ -1146,7 +1140,7 @@ // Full path libraries should specify a valid library file name. // See documentation of CMP0008. std::string generator = this->GlobalGenerator->GetName(); - if(this->Target->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW && + if(this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW && (generator.find("Visual Studio") != generator.npos || generator.find("Xcode") != generator.npos)) { @@ -1227,7 +1221,7 @@ } // Check the policy for whether we should use the approach below. - switch (this->Target->Target->GetPolicyStatusCMP0060()) + switch (this->Target->GetPolicyStatusCMP0060()) { case cmPolicies::WARN: if (this->CMP0060Warn) @@ -1537,7 +1531,7 @@ this->OrderLinkerSearchPath->AddLinkLibrary(item); // Produce any needed message. - switch(this->Target->Target->GetPolicyStatusCMP0008()) + switch(this->Target->GetPolicyStatusCMP0008()) { case cmPolicies::WARN: { @@ -1554,7 +1548,7 @@ << " " << item << "\n" << "which is a full-path but not a valid library file name."; this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } } case cmPolicies::OLD: @@ -1572,7 +1566,7 @@ << " " << item << "\n" << "which is a full-path but not a valid library file name."; this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } break; } @@ -1589,7 +1583,7 @@ } // Enforce policy constraints. - switch(this->Target->Target->GetPolicyStatusCMP0003()) + switch(this->Target->GetPolicyStatusCMP0003()) { case cmPolicies::WARN: if(!this->CMakeInstance->GetState() @@ -1600,7 +1594,7 @@ std::ostringstream w; this->PrintLinkPolicyDiagnosis(w); this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } case cmPolicies::OLD: // OLD behavior is to add the paths containing libraries with @@ -1616,7 +1610,7 @@ e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0003) << "\n"; this->PrintLinkPolicyDiagnosis(e); this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); return false; } } @@ -1781,7 +1775,7 @@ //---------------------------------------------------------------------------- void cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath, - cmTarget const* target) + cmGeneratorTarget const* target) { // Ignore targets on Apple where install_name is not @rpath. // The dependenty library can be found with other means such as @@ -1796,22 +1790,21 @@ // Libraries with unknown type must be handled using just the file // on disk. - if(target->GetType() == cmTarget::UNKNOWN_LIBRARY) + if(target->GetType() == cmState::UNKNOWN_LIBRARY) { this->AddLibraryRuntimeInfo(fullPath); return; } // Skip targets that are not shared libraries (modules cannot be linked). - if(target->GetType() != cmTarget::SHARED_LIBRARY) + if(target->GetType() != cmState::SHARED_LIBRARY) { return; } // Try to get the soname of the library. Only files with this name // could possibly conflict. - cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target); - std::string soName = gtgt->GetSOName(this->Config); + std::string soName = target->GetSOName(this->Config); const char* soname = soName.empty()? 0 : soName.c_str(); // Include this library in the runtime path ordering. @@ -1918,9 +1911,9 @@ // build tree. bool linking_for_install = (for_install || - this->Target->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH")); + this->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH")); bool use_install_rpath = - (outputRuntime && this->Target->Target->HaveInstallTreeRPATH() && + (outputRuntime && this->Target->HaveInstallTreeRPATH() && linking_for_install); bool use_build_rpath = (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) && @@ -1928,14 +1921,14 @@ bool use_link_rpath = outputRuntime && linking_for_install && !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH") && - this->Target->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH"); + this->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH"); // Construct the RPATH. std::set emitted; if(use_install_rpath) { const char* install_rpath = - this->Target->Target->GetProperty("INSTALL_RPATH"); + this->Target->GetProperty("INSTALL_RPATH"); cmCLI_ExpandListUnique(install_rpath, runtimeDirs, emitted); } if(use_build_rpath || use_link_rpath) @@ -1975,8 +1968,9 @@ else if(use_link_rpath) { // Do not add any path inside the source or build tree. - const char* topSourceDir = this->Makefile->GetHomeDirectory(); - const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory(); + const char* topSourceDir = this->CMakeInstance->GetHomeDirectory(); + const char* topBinaryDir = + this->CMakeInstance->GetHomeOutputDirectory(); if(!cmSystemTools::ComparePath(*ri, topSourceDir) && !cmSystemTools::ComparePath(*ri, topBinaryDir) && !cmSystemTools::IsSubDirectory(*ri, topSourceDir) && diff -Nru cmake-3.4.1/Source/cmComputeLinkInformation.h cmake-3.5.0/Source/cmComputeLinkInformation.h --- cmake-3.4.1/Source/cmComputeLinkInformation.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmComputeLinkInformation.h 2016-03-08 14:36:22.000000000 +0000 @@ -19,7 +19,6 @@ class cmake; class cmGlobalGenerator; class cmMakefile; -class cmTarget; class cmGeneratorTarget; class cmOrderDirectories; @@ -39,11 +38,11 @@ Item(): Value(), IsPath(true), Target(0) {} Item(Item const& item): Value(item.Value), IsPath(item.IsPath), Target(item.Target) {} - Item(std::string const& v, bool p, cmTarget const* target = 0): + Item(std::string const& v, bool p, cmGeneratorTarget const* target = 0): Value(v), IsPath(p), Target(target) {} std::string Value; bool IsPath; - cmTarget const* Target; + cmGeneratorTarget const* Target; }; typedef std::vector ItemVector; ItemVector const& GetItems(); @@ -57,13 +56,13 @@ void GetRPath(std::vector& runtimeDirs, bool for_install); std::string GetRPathString(bool for_install); std::string GetChrpathString(); - std::set const& GetSharedLibrariesLinked(); + std::set const& GetSharedLibrariesLinked(); std::string const& GetRPathLinkFlag() const { return this->RPathLinkFlag; } std::string GetRPathLinkString(); private: - void AddItem(std::string const& item, cmTarget const* tgt); - void AddSharedDepItem(std::string const& item, cmTarget const* tgt); + void AddItem(std::string const& item, const cmGeneratorTarget* tgt); + void AddSharedDepItem(std::string const& item, cmGeneratorTarget const* tgt); // Output information. ItemVector Items; @@ -71,7 +70,7 @@ std::vector Depends; std::vector FrameworkPaths; std::vector RuntimeSearchPath; - std::set SharedLibrariesLinked; + std::set SharedLibrariesLinked; // Context information. cmGeneratorTarget const* Target; @@ -129,7 +128,7 @@ std::string NoCaseExpression(const char* str); // Handling of link items. - void AddTargetItem(std::string const& item, cmTarget const* target); + void AddTargetItem(std::string const& item, const cmGeneratorTarget* target); void AddFullItem(std::string const& item); bool CheckImplicitDirItem(std::string const& item); void AddUserItem(std::string const& item, bool pathNotKnown); @@ -183,7 +182,7 @@ bool CMP0060Warn; void AddLibraryRuntimeInfo(std::string const& fullPath, - cmTarget const* target); + const cmGeneratorTarget* target); void AddLibraryRuntimeInfo(std::string const& fullPath); }; diff -Nru cmake-3.4.1/Source/cmComputeTargetDepends.cxx cmake-3.5.0/Source/cmComputeTargetDepends.cxx --- cmake-3.4.1/Source/cmComputeTargetDepends.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmComputeTargetDepends.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -175,13 +175,12 @@ this->GlobalGenerator->GetLocalGenerators(); for(unsigned int i = 0; i < lgens.size(); ++i) { - const cmTargets& targets = lgens[i]->GetMakefile()->GetTargets(); - for(cmTargets::const_iterator ti = targets.begin(); + const std::vector targets = + lgens[i]->GetGeneratorTargets(); + for(std::vector::const_iterator ti = targets.begin(); ti != targets.end(); ++ti) { - cmTarget const* target = &ti->second; - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(target); + cmGeneratorTarget* gt = *ti; int index = static_cast(this->Targets.size()); this->TargetIndex[gt] = index; this->Targets.push_back(gt); @@ -207,7 +206,7 @@ { // Get the depender. cmGeneratorTarget const* depender = this->Targets[depender_index]; - if (depender->GetType() == cmTarget::INTERFACE_LIBRARY) + if (depender->GetType() == cmState::INTERFACE_LIBRARY) { return; } @@ -236,16 +235,16 @@ std::string objLib = (*oi)->GetObjectLibrary(); if (!objLib.empty() && emitted.insert(objLib).second) { - if(depender->GetType() != cmTarget::EXECUTABLE && - depender->GetType() != cmTarget::STATIC_LIBRARY && - depender->GetType() != cmTarget::SHARED_LIBRARY && - depender->GetType() != cmTarget::MODULE_LIBRARY) + if(depender->GetType() != cmState::EXECUTABLE && + depender->GetType() != cmState::STATIC_LIBRARY && + depender->GetType() != cmState::SHARED_LIBRARY && + depender->GetType() != cmState::MODULE_LIBRARY) { this->GlobalGenerator->GetCMakeInstance() ->IssueMessage(cmake::FATAL_ERROR, "Only executables and non-OBJECT libraries may " "reference target objects.", - depender->Target->GetBacktrace()); + depender->GetBacktrace()); return; } const_cast(depender)->Target->AddUtility(objLib); @@ -272,7 +271,7 @@ // Loop over all utility dependencies. { - std::set const& tutils = depender->Target->GetUtilityItems(); + std::set const& tutils = depender->GetUtilityItems(); std::set emitted; // A target should not depend on itself. emitted.insert(depender->GetName()); @@ -297,7 +296,7 @@ cmGeneratorTarget const* depender = this->Targets[depender_index]; if(cmLinkInterface const* iface = dependee->GetLinkInterface(config, - depender->Target)) + depender)) { for(std::vector::const_iterator lib = iface->Libraries.begin(); @@ -319,12 +318,12 @@ std::set &emitted) { cmGeneratorTarget const* depender = this->Targets[depender_index]; - cmTarget const* dependee = dependee_name.Target; + cmGeneratorTarget const* dependee = dependee_name.Target; // Skip targets that will not really be linked. This is probably a // name conflict between an external library and an executable // within the project. if(dependee && - dependee->GetType() == cmTarget::EXECUTABLE && + dependee->GetType() == cmState::EXECUTABLE && !dependee->IsExecutableWithExports()) { dependee = 0; @@ -332,9 +331,7 @@ if(dependee) { - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(dependee); - this->AddInterfaceDepends(depender_index, gt, "", emitted); + this->AddInterfaceDepends(depender_index, dependee, "", emitted); std::vector configs; depender->Makefile->GetConfigurations(configs); for (std::vector::const_iterator it = configs.begin(); @@ -342,7 +339,7 @@ { // A target should not depend on itself. emitted.insert(depender->GetName()); - this->AddInterfaceDepends(depender_index, gt, *it, emitted); + this->AddInterfaceDepends(depender_index, dependee, *it, emitted); } } } @@ -356,15 +353,15 @@ cmGeneratorTarget const* depender = this->Targets[depender_index]; // Check the target's makefile first. - cmTarget const* dependee = dependee_name.Target; + cmGeneratorTarget const* dependee = dependee_name.Target; if(!dependee && !linking && - (depender->GetType() != cmTarget::GLOBAL_TARGET)) + (depender->GetType() != cmState::GLOBAL_TARGET)) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; std::ostringstream e; - switch(depender->Target->GetPolicyStatusCMP0046()) + switch(depender->GetPolicyStatusCMP0046()) { case cmPolicies::WARN: e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0046) << "\n"; @@ -385,7 +382,7 @@ << "\" of target \"" << depender->GetName() << "\" does not exist."; cmListFileBacktrace const* backtrace = - depender->Target->GetUtilityBacktrace(dependee_name); + depender->GetUtilityBacktrace(dependee_name); if(backtrace) { cm->IssueMessage(messageType, e.str(), *backtrace); @@ -402,7 +399,7 @@ // name conflict between an external library and an executable // within the project. if(linking && dependee && - dependee->GetType() == cmTarget::EXECUTABLE && + dependee->GetType() == cmState::EXECUTABLE && !dependee->IsExecutableWithExports()) { dependee = 0; @@ -410,9 +407,7 @@ if(dependee) { - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(dependee); - this->AddTargetDepend(depender_index, gt, linking); + this->AddTargetDepend(depender_index, dependee, linking); } } @@ -421,20 +416,18 @@ const cmGeneratorTarget* dependee, bool linking) { - if(dependee->Target->IsImported() || - dependee->GetType() == cmTarget::INTERFACE_LIBRARY) + if(dependee->IsImported() || + dependee->GetType() == cmState::INTERFACE_LIBRARY) { // Skip IMPORTED and INTERFACE targets but follow their utility // dependencies. - std::set const& utils = dependee->Target->GetUtilityItems(); + std::set const& utils = dependee->GetUtilityItems(); for(std::set::const_iterator i = utils.begin(); i != utils.end(); ++i) { - if(cmTarget const* transitive_dependee = i->Target) + if(cmGeneratorTarget const* transitive_dependee = i->Target) { - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(transitive_dependee); - this->AddTargetDepend(depender_index, gt, false); + this->AddTargetDepend(depender_index, transitive_dependee, false); } } } @@ -529,7 +522,7 @@ // Make sure the component is all STATIC_LIBRARY targets. for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { - if(this->Targets[*ni]->GetType() != cmTarget::STATIC_LIBRARY) + if(this->Targets[*ni]->GetType() != cmState::STATIC_LIBRARY) { this->ComplainAboutBadComponent(ccg, c); return false; @@ -560,7 +553,7 @@ // Describe the depender. e << " \"" << depender->GetName() << "\" of type " - << cmTarget::GetTargetTypeName(depender->Target->GetType()) << "\n"; + << cmState::GetTargetTypeName(depender->GetType()) << "\n"; // List its dependencies that are inside the component. EdgeList const& nl = this->InitialGraph[i]; diff -Nru cmake-3.4.1/Source/cmConditionEvaluator.cxx cmake-3.5.0/Source/cmConditionEvaluator.cxx --- cmake-3.4.1/Source/cmConditionEvaluator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmConditionEvaluator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -12,6 +12,7 @@ #include "cmConditionEvaluator.h" #include "cmOutputConverter.h" +#include "cmAlgorithms.h" cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile, const cmListFileContext &context, @@ -578,6 +579,7 @@ cmake::MessageType &status) { int reducible; + std::string def_buf; const char *def; const char *def2; do @@ -594,6 +596,14 @@ IsKeyword("MATCHES", *argP1)) { def = this->GetVariableOrString(*arg); + if (def != arg->c_str() // yes, we compare the pointer value + && cmHasLiteralPrefix(arg->GetValue(), "CMAKE_MATCH_")) + { + // The string to match is owned by our match result variables. + // Move it to our own buffer before clearing them. + def_buf = def; + def = def_buf.c_str(); + } const char* rex = argP2->c_str(); this->Makefile.ClearMatches(); cmsys::RegularExpression regEntry; diff -Nru cmake-3.4.1/Source/cmCoreTryCompile.cxx cmake-3.5.0/Source/cmCoreTryCompile.cxx --- cmake-3.4.1/Source/cmCoreTryCompile.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCoreTryCompile.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -34,7 +34,7 @@ std::string outputVariable; std::string copyFile; std::string copyFileError; - std::vector targets; + std::vector targets; std::string libsToLink = " "; bool useOldLinkLibs = true; char targetNameBuf[64]; @@ -93,12 +93,12 @@ { switch(tgt->GetType()) { - case cmTarget::SHARED_LIBRARY: - case cmTarget::STATIC_LIBRARY: - case cmTarget::INTERFACE_LIBRARY: - case cmTarget::UNKNOWN_LIBRARY: + case cmState::SHARED_LIBRARY: + case cmState::STATIC_LIBRARY: + case cmState::INTERFACE_LIBRARY: + case cmState::UNKNOWN_LIBRARY: break; - case cmTarget::EXECUTABLE: + case cmState::EXECUTABLE: if (tgt->IsExecutableWithExports()) { break; @@ -107,12 +107,12 @@ this->Makefile->IssueMessage(cmake::FATAL_ERROR, "Only libraries may be used as try_compile or try_run IMPORTED " "LINK_LIBRARIES. Got " + std::string(tgt->GetName()) + " of " - "type " + tgt->GetTargetTypeName(tgt->GetType()) + "."); + "type " + cmState::GetTargetTypeName(tgt->GetType()) + "."); return -1; } if (tgt->IsImported()) { - targets.push_back(tgt); + targets.push_back(argv[i]); } } } @@ -375,9 +375,8 @@ if (!targets.empty()) { std::string fname = "/" + std::string(targetName) + "Targets.cmake"; - cmExportTryCompileFileGenerator tcfg(gg); + cmExportTryCompileFileGenerator tcfg(gg, targets, this->Makefile); tcfg.SetExportFile((this->BinaryDirectory + fname).c_str()); - tcfg.SetExports(targets); tcfg.SetConfig(this->Makefile->GetSafeDefinition( "CMAKE_TRY_COMPILE_CONFIGURATION")); diff -Nru cmake-3.4.1/Source/cmCPackPropertiesGenerator.cxx cmake-3.5.0/Source/cmCPackPropertiesGenerator.cxx --- cmake-3.4.1/Source/cmCPackPropertiesGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCPackPropertiesGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -18,7 +18,7 @@ const std::string& config, Indent const& indent) { std::string const& expandedFileName = - this->InstalledFile.GetNameExpression().Evaluate(this->LG->GetMakefile(), + this->InstalledFile.GetNameExpression().Evaluate(this->LG, config); cmInstalledFile::PropertyMapType const& properties = @@ -38,7 +38,7 @@ j = property.ValueExpressions.begin(); j != property.ValueExpressions.end(); ++j) { - std::string value = (*j)->Evaluate(LG->GetMakefile(), config); + std::string value = (*j)->Evaluate(this->LG, config); os << " " << cmOutputConverter::EscapeForCMake(value); } diff -Nru cmake-3.4.1/Source/cmCPluginAPI.cxx cmake-3.5.0/Source/cmCPluginAPI.cxx --- cmake-3.4.1/Source/cmCPluginAPI.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCPluginAPI.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -51,14 +51,14 @@ unsigned int CCONV cmGetCacheMajorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); - return manager->GetCacheMajorVersion(); + cmState *state = mf->GetState(); + return state->GetCacheMajorVersion(); } unsigned int CCONV cmGetCacheMinorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); - return manager->GetCacheMinorVersion(); + cmState *state = mf->GetState(); + return state->GetCacheMinorVersion(); } unsigned int CCONV cmGetMajorVersion(void *) @@ -116,7 +116,7 @@ { cmMakefile *mf = static_cast(arg); static std::string name; - name = mf->GetProjectName(); + name = mf->GetStateSnapshot().GetProjectName(); return name.c_str(); } @@ -373,13 +373,13 @@ switch (libtype) { case CM_LIBRARY_GENERAL: - mf->AddLinkLibraryForTarget(tgt,value, cmTarget::GENERAL); + mf->AddLinkLibraryForTarget(tgt,value, GENERAL_LibraryType); break; case CM_LIBRARY_DEBUG: - mf->AddLinkLibraryForTarget(tgt,value, cmTarget::DEBUG); + mf->AddLinkLibraryForTarget(tgt,value, DEBUG_LibraryType); break; case CM_LIBRARY_OPTIMIZED: - mf->AddLinkLibraryForTarget(tgt,value, cmTarget::OPTIMIZED); + mf->AddLinkLibraryForTarget(tgt,value, OPTIMIZED_LibraryType); break; } } @@ -395,7 +395,7 @@ srcs2.push_back(srcs[i]); } mf->AddLibrary(libname, - (shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY), + (shared? cmState::SHARED_LIBRARY : cmState::STATIC_LIBRARY), srcs2); } diff -Nru cmake-3.4.1/Source/cmCTest.cxx cmake-3.5.0/Source/cmCTest.cxx --- cmake-3.4.1/Source/cmCTest.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCTest.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -14,7 +14,6 @@ #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include #include @@ -518,9 +517,9 @@ cmake cm; cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); + cm.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator gg(&cm); cmsys::auto_ptr mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); - cmsys::auto_ptr lg(gg.CreateLocalGenerator(mf.get())); if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf.get()) ) { diff -Nru cmake-3.4.1/Source/cmCurl.cxx cmake-3.5.0/Source/cmCurl.cxx --- cmake-3.4.1/Source/cmCurl.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCurl.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -12,6 +12,11 @@ #include "cmCurl.h" #include "cmSystemTools.h" +// curl versions before 7.21.5 did not provide this error code +#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x071505 +# define CURLE_NOT_BUILT_IN 4 +#endif + #define check_curl_result(result, errstr) \ if (result != CURLE_OK && result != CURLE_NOT_BUILT_IN) \ { \ diff -Nru cmake-3.4.1/Source/cmCustomCommandGenerator.cxx cmake-3.5.0/Source/cmCustomCommandGenerator.cxx --- cmake-3.4.1/Source/cmCustomCommandGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmCustomCommandGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -43,15 +43,14 @@ { std::string const& argv0 = this->CC.GetCommandLines()[c][0]; cmGeneratorTarget* target = - this->LG->GetMakefile()->FindGeneratorTargetToUse(argv0); - if(target && target->GetType() == cmTarget::EXECUTABLE && - (target->Target->IsImported() + this->LG->FindGeneratorTargetToUse(argv0); + if(target && target->GetType() == cmState::EXECUTABLE && + (target->IsImported() || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) { return target->GetLocation(this->Config); } - return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(), - this->Config); + return this->GE->Parse(argv0)->Evaluate(this->LG, this->Config); } //---------------------------------------------------------------------------- @@ -92,7 +91,7 @@ for(unsigned int j=1;j < commandLine.size(); ++j) { std::string arg = - this->GE->Parse(commandLine[j])->Evaluate(this->LG->GetMakefile(), + this->GE->Parse(commandLine[j])->Evaluate(this->LG, this->Config); cmd += " "; if(this->OldStyle) @@ -101,7 +100,7 @@ } else { - cmOutputConverter converter(this->LG->GetMakefile()->GetStateSnapshot()); + cmOutputConverter converter(this->LG->GetStateSnapshot()); cmd += converter.EscapeForShell(arg, this->MakeVars); } } @@ -146,7 +145,7 @@ = this->GE->Parse(*i); std::vector result; cmSystemTools::ExpandListArgument( - cge->Evaluate(this->LG->GetMakefile(), this->Config), result); + cge->Evaluate(this->LG, this->Config), result); for (std::vector::iterator it = result.begin(); it != result.end(); ++it) { diff -Nru cmake-3.4.1/Source/cmDependsFortran.cxx cmake-3.5.0/Source/cmDependsFortran.cxx --- cmake-3.4.1/Source/cmDependsFortran.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmDependsFortran.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -160,7 +160,7 @@ if (mod_dir.empty()) { mod_dir = - this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory(); + this->LocalGenerator->GetCurrentBinaryDirectory(); } // Actually write dependencies to the streams. diff -Nru cmake-3.4.1/Source/cmELF.cxx cmake-3.5.0/Source/cmELF.cxx --- cmake-3.4.1/Source/cmELF.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmELF.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -15,10 +15,6 @@ #include #include -// Need the native byte order of the running CPU. -#define cmsys_CPU_UNKNOWN_OKAY // We can decide at runtime if not known. -#include - // Include the ELF format information system header. #if defined(__OpenBSD__) # include @@ -102,9 +98,9 @@ // In most cases the processor-specific byte order will match that // of the target execution environment. If we choose wrong here // it is fixed when the header is read. -#if cmsys_CPU_ENDIAN_ID == cmsys_CPU_ENDIAN_ID_LITTLE +#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE this->NeedSwap = (this->ByteOrder == ByteOrderMSB); -#elif cmsys_CPU_ENDIAN_ID == cmsys_CPU_ENDIAN_ID_BIG +#elif KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_BIG this->NeedSwap = (this->ByteOrder == ByteOrderLSB); #else this->NeedSwap = false; // Final decision is at runtime anyway. @@ -198,7 +194,7 @@ typedef Elf32_Shdr ELF_Shdr; typedef Elf32_Dyn ELF_Dyn; typedef Elf32_Half ELF_Half; - typedef cmIML_INT_uint32_t tagtype; + typedef KWIML_INT_uint32_t tagtype; static const char* GetName() { return "32-bit"; } }; @@ -209,7 +205,7 @@ typedef Elf64_Shdr ELF_Shdr; typedef Elf64_Dyn ELF_Dyn; typedef Elf64_Half ELF_Half; - typedef cmIML_INT_uint64_t tagtype; + typedef KWIML_INT_uint64_t tagtype; static const char* GetName() { return "64-bit"; } }; diff -Nru cmake-3.4.1/Source/cmEnableTestingCommand.cxx cmake-3.5.0/Source/cmEnableTestingCommand.cxx --- cmake-3.4.1/Source/cmEnableTestingCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmEnableTestingCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmEnableTestingCommand.h" -#include "cmLocalGenerator.h" // we do this in the final pass so that we now the subdirs have all // been defined diff -Nru cmake-3.4.1/Source/cmExportBuildFileGenerator.cxx cmake-3.5.0/Source/cmExportBuildFileGenerator.cxx --- cmake-3.4.1/Source/cmExportBuildFileGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportBuildFileGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -18,16 +18,24 @@ //---------------------------------------------------------------------------- cmExportBuildFileGenerator::cmExportBuildFileGenerator() - : Backtrace() { - this->Makefile = 0; + this->LG = 0; this->ExportSet = 0; } //---------------------------------------------------------------------------- +void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg) +{ + this->LG = lg; + if (this->ExportSet) + { + this->ExportSet->Compute(lg); + } +} + +//---------------------------------------------------------------------------- bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) { - std::vector allTargets; { std::string expectedTargets; std::string sep; @@ -37,11 +45,11 @@ tei = targets.begin(); tei != targets.end(); ++tei) { - cmGeneratorTarget *te = this->Makefile + cmGeneratorTarget *te = this->LG ->FindGeneratorTargetToUse(*tei); - expectedTargets += sep + this->Namespace + te->Target->GetExportName(); + expectedTargets += sep + this->Namespace + te->GetExportName(); sep = " "; - if(this->ExportedTargets.insert(te->Target).second) + if(this->ExportedTargets.insert(te).second) { this->Exports.push_back(te); } @@ -49,11 +57,12 @@ { std::ostringstream e; e << "given target \"" << te->GetName() << "\" more than once."; - this->Makefile->GetCMakeInstance() - ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); + this->LG->GetGlobalGenerator()->GetCMakeInstance() + ->IssueMessage(cmake::FATAL_ERROR, e.str(), + this->LG->GetMakefile()->GetBacktrace()); return false; } - if (te->GetType() == cmTarget::INTERFACE_LIBRARY) + if (te->GetType() == cmState::INTERFACE_LIBRARY) { this->GenerateRequiredCMakeVersion(os, "3.0.0"); } @@ -70,45 +79,44 @@ tei != this->Exports.end(); ++tei) { cmGeneratorTarget* gte = *tei; - cmTarget* te = gte->Target; - this->GenerateImportTargetCode(os, te); + this->GenerateImportTargetCode(os, gte); - te->AppendBuildInterfaceIncludes(); + gte->Target->AppendBuildInterfaceIncludes(); ImportPropertyMap properties; - this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", te, + this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", gte, cmGeneratorExpression::BuildInterface, properties, missingTargets); - this->PopulateInterfaceProperty("INTERFACE_SOURCES", te, + this->PopulateInterfaceProperty("INTERFACE_SOURCES", gte, cmGeneratorExpression::BuildInterface, properties, missingTargets); - this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te, + this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", gte, cmGeneratorExpression::BuildInterface, properties, missingTargets); - this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", te, + this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", gte, cmGeneratorExpression::BuildInterface, properties, missingTargets); - this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS", te, + this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS", gte, cmGeneratorExpression::BuildInterface, properties, missingTargets); - this->PopulateInterfaceProperty("INTERFACE_COMPILE_FEATURES", te, + this->PopulateInterfaceProperty("INTERFACE_COMPILE_FEATURES", gte, cmGeneratorExpression::BuildInterface, properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE", - te, properties); + gte, properties); const bool newCMP0022Behavior = - te->GetPolicyStatusCMP0022() != cmPolicies::WARN - && te->GetPolicyStatusCMP0022() != cmPolicies::OLD; + gte->GetPolicyStatusCMP0022() != cmPolicies::WARN + && gte->GetPolicyStatusCMP0022() != cmPolicies::OLD; if (newCMP0022Behavior) { - this->PopulateInterfaceLinkLibrariesProperty(te, + this->PopulateInterfaceLinkLibrariesProperty(gte, cmGeneratorExpression::BuildInterface, properties, missingTargets); } this->PopulateCompatibleInterfaceProperties(gte, properties); - this->GenerateInterfaceProperties(te, os, properties); + this->GenerateInterfaceProperties(gte, os, properties); } // Generate import file content for each configuration. @@ -140,14 +148,14 @@ cmGeneratorTarget* target = *tei; ImportPropertyMap properties; - if (target->GetType() != cmTarget::INTERFACE_LIBRARY) + if (target->GetType() != cmState::INTERFACE_LIBRARY) { this->SetImportLocationProperty(config, suffix, target, properties); } if(!properties.empty()) { // Get the rest of the target details. - if (target->GetType() != cmTarget::INTERFACE_LIBRARY) + if (target->GetType() != cmState::INTERFACE_LIBRARY) { this->SetImportDetailProperties(config, suffix, target, @@ -165,7 +173,7 @@ // properties); // Generate code in the export file. - this->GenerateImportPropertyCode(os, config, target->Target, + this->GenerateImportPropertyCode(os, config, target, properties); } } @@ -193,7 +201,7 @@ std::string prop = "IMPORTED_LOCATION"; prop += suffix; std::string value; - if(target->Target->IsAppBundleOnApple()) + if(target->IsAppBundleOnApple()) { value = target->GetFullPath(config, false); } @@ -204,20 +212,16 @@ properties[prop] = value; } - // Check whether this is a DLL platform. - bool dll_platform = - (mf->IsOn("WIN32") || mf->IsOn("CYGWIN") || mf->IsOn("MINGW")); - // Add the import library for windows DLLs. - if(dll_platform && - (target->GetType() == cmTarget::SHARED_LIBRARY || - target->Target->IsExecutableWithExports()) && + if(target->IsDLLPlatform() && + (target->GetType() == cmState::SHARED_LIBRARY || + target->IsExecutableWithExports()) && mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { std::string prop = "IMPORTED_IMPLIB"; prop += suffix; std::string value = target->GetFullPath(config, true); - target->Target->GetImplibGNUtoMS(value, value, + target->GetImplibGNUtoMS(value, value, "${CMAKE_IMPORT_LIBRARY_SUFFIX}"); properties[prop] = value; } @@ -226,14 +230,18 @@ //---------------------------------------------------------------------------- void cmExportBuildFileGenerator::HandleMissingTarget( - std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, cmTarget* depender, cmTarget* dependee) + std::string& link_libs, + std::vector& missingTargets, + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee) { // The target is not in the export. if(!this->AppendMode) { const std::string name = dependee->GetName(); - std::vector namespaces = this->FindNamespaces(mf, name); + cmGlobalGenerator* gg = + dependee->GetLocalGenerator()->GetGlobalGenerator(); + std::vector namespaces = this->FindNamespaces(gg, name); int targetOccurrences = (int)namespaces.size(); if (targetOccurrences == 1) @@ -268,7 +276,7 @@ tei = this->ExportSet->GetTargetExports()->begin(); tei != this->ExportSet->GetTargetExports()->end(); ++tei) { - targets.push_back((*tei)->Target->GetName()); + targets.push_back((*tei)->TargetName); } return; } @@ -278,10 +286,9 @@ //---------------------------------------------------------------------------- std::vector cmExportBuildFileGenerator -::FindNamespaces(cmMakefile* mf, const std::string& name) +::FindNamespaces(cmGlobalGenerator* gg, const std::string& name) { std::vector namespaces; - cmGlobalGenerator* gg = mf->GetGlobalGenerator(); std::map& exportSets = gg->GetBuildExportSets(); @@ -304,8 +311,8 @@ //---------------------------------------------------------------------------- void cmExportBuildFileGenerator -::ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, +::ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences) { if(cmSystemTools::GetErrorOccuredFlag()) @@ -328,8 +335,9 @@ e << "If the required target is not easy to reference in this call, " << "consider using the APPEND option with multiple separate calls."; - this->Makefile->GetCMakeInstance() - ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); + this->LG->GetGlobalGenerator()->GetCMakeInstance() + ->IssueMessage(cmake::FATAL_ERROR, e.str(), + this->LG->GetMakefile()->GetBacktrace()); } std::string diff -Nru cmake-3.4.1/Source/cmExportBuildFileGenerator.h cmake-3.5.0/Source/cmExportBuildFileGenerator.h --- cmake-3.4.1/Source/cmExportBuildFileGenerator.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportBuildFileGenerator.h 2016-03-08 14:36:22.000000000 +0000 @@ -43,10 +43,7 @@ /** Set whether to append generated code to the output file. */ void SetAppendMode(bool append) { this->AppendMode = append; } - void SetMakefile(cmMakefile *mf) { - this->Makefile = mf; - this->Backtrace = this->Makefile->GetBacktrace(); - } + void Compute(cmLocalGenerator* lg); protected: // Implement virtual methods from the superclass. @@ -57,12 +54,11 @@ std::vector &missingTargets); virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, - cmTarget* depender, - cmTarget* dependee); + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee); - void ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, + void ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences); /** Fill in properties indicating built file locations. */ @@ -75,13 +71,12 @@ const std::string& config); std::vector - FindNamespaces(cmMakefile* mf, const std::string& name); + FindNamespaces(cmGlobalGenerator* gg, const std::string& name); std::vector Targets; cmExportSet *ExportSet; std::vector Exports; - cmMakefile* Makefile; - cmListFileBacktrace Backtrace; + cmLocalGenerator* LG; }; #endif diff -Nru cmake-3.4.1/Source/cmExportCommand.cxx cmake-3.5.0/Source/cmExportCommand.cxx --- cmake-3.4.1/Source/cmExportCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmExportCommand.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmGeneratedFileStream.h" #include "cmake.h" @@ -169,7 +168,7 @@ if(cmTarget* target = gg->FindTarget(*currentTarget)) { - if(target->GetType() == cmTarget::OBJECT_LIBRARY) + if(target->GetType() == cmState::OBJECT_LIBRARY) { std::ostringstream e; e << "given OBJECT library \"" << *currentTarget @@ -177,7 +176,7 @@ this->SetError(e.str()); return false; } - if (target->GetType() == cmTarget::UTILITY) + if (target->GetType() == cmState::UTILITY) { this->SetError("given custom target \"" + *currentTarget + "\" which may not be exported."); @@ -222,7 +221,7 @@ { ebfg->SetTargets(targets); } - ebfg->SetMakefile(this->Makefile); + this->Makefile->AddExportBuildFileGenerator(ebfg); ebfg->SetExportOld(this->ExportOld.IsEnabled()); // Compute the set of configurations exported. diff -Nru cmake-3.4.1/Source/cmExportFileGenerator.cxx cmake-3.5.0/Source/cmExportFileGenerator.cxx --- cmake-3.4.1/Source/cmExportFileGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportFileGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -18,7 +18,6 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSystemTools.h" -#include "cmTarget.h" #include "cmTargetExport.h" #include "cmVersion.h" #include "cmComputeLinkInformation.h" @@ -155,7 +154,7 @@ //---------------------------------------------------------------------------- void cmExportFileGenerator::PopulateInterfaceProperty( const std::string& propName, - cmTarget *target, + cmGeneratorTarget *target, ImportPropertyMap &properties) { const char *input = target->GetProperty(propName); @@ -169,7 +168,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty( const std::string& propName, const std::string& outputName, - cmTarget *target, + cmGeneratorTarget *target, cmGeneratorExpression::PreprocessContext preprocessRule, ImportPropertyMap &properties, std::vector &missingTargets) @@ -206,7 +205,7 @@ //---------------------------------------------------------------------------- bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty( - cmTarget *target, + cmGeneratorTarget *target, cmGeneratorExpression::PreprocessContext preprocessRule, ImportPropertyMap &properties, std::vector &missingTargets) @@ -241,12 +240,14 @@ //---------------------------------------------------------------------------- static bool checkInterfaceDirs(const std::string &prepro, - cmTarget *target, const std::string& prop) + cmGeneratorTarget *target, const std::string& prop) { const char* installDir = - target->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); - const char* topSourceDir = target->GetMakefile()->GetHomeDirectory(); - const char* topBinaryDir = target->GetMakefile()->GetHomeOutputDirectory(); + target->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); + const char* topSourceDir = + target->GetLocalGenerator()->GetSourceDirectory(); + const char* topBinaryDir = + target->GetLocalGenerator()->GetBinaryDirectory(); std::vector parts; cmGeneratorExpression::Split(prepro, parts); @@ -298,7 +299,7 @@ e << "Target \"" << target->GetName() << "\" " << prop << " property contains relative path:\n" " \"" << *li << "\""; - target->GetMakefile()->IssueMessage(messageType, e.str()); + target->GetLocalGenerator()->IssueMessage(messageType, e.str()); } bool inBinary = isSubDirectory(li->c_str(), topBinaryDir); bool inSource = isSubDirectory(li->c_str(), topSourceDir); @@ -329,7 +330,7 @@ "a subdirectory of the " << (inBinary ? "build" : "source") << " tree:\n \"" << (inBinary ? topBinaryDir : topSourceDir) << "\"" << std::endl; - target->GetMakefile()->IssueMessage(cmake::AUTHOR_WARNING, + target->GetLocalGenerator()->IssueMessage(cmake::AUTHOR_WARNING, s.str()); } case cmPolicies::OLD: @@ -352,7 +353,7 @@ e << "Target \"" << target->GetName() << "\" " << prop << " property contains path:\n" " \"" << *li << "\"\nwhich is prefixed in the build directory."; - target->GetMakefile()->IssueMessage(messageType, e.str()); + target->GetLocalGenerator()->IssueMessage(messageType, e.str()); } if (!inSourceBuild) { @@ -361,7 +362,7 @@ e << "Target \"" << target->GetName() << "\" " << prop << " property contains path:\n" " \"" << *li << "\"\nwhich is prefixed in the source directory."; - target->GetMakefile()->IssueMessage(messageType, e.str()); + target->GetLocalGenerator()->IssueMessage(messageType, e.str()); } } } @@ -396,11 +397,11 @@ ImportPropertyMap &properties, std::vector &missingTargets) { - cmTarget *target = tei->Target; + cmGeneratorTarget* gt = tei->Target; assert(preprocessRule == cmGeneratorExpression::InstallInterface); const char *propName = "INTERFACE_SOURCES"; - const char *input = target->GetProperty(propName); + const char *input = gt->GetProperty(propName); if (!input) { @@ -418,10 +419,10 @@ true); if (!prepro.empty()) { - this->ResolveTargetsInGeneratorExpressions(prepro, target, + this->ResolveTargetsInGeneratorExpressions(prepro, gt, missingTargets); - if (!checkInterfaceDirs(prepro, target, propName)) + if (!checkInterfaceDirs(prepro, gt, propName)) { return; } @@ -436,7 +437,7 @@ ImportPropertyMap &properties, std::vector &missingTargets) { - cmTarget *target = tei->Target; + cmGeneratorTarget *target = tei->Target; assert(preprocessRule == cmGeneratorExpression::InstallInterface); const char *propName = "INTERFACE_INCLUDE_DIRECTORIES"; @@ -450,18 +451,18 @@ true); this->ReplaceInstallPrefix(dirs); cmsys::auto_ptr cge = ge.Parse(dirs); - std::string exportDirs = cge->Evaluate(target->GetMakefile(), "", + std::string exportDirs = cge->Evaluate(target->GetLocalGenerator(), "", false, target); if (cge->GetHadContextSensitiveCondition()) { - cmMakefile* mf = target->GetMakefile(); + cmLocalGenerator* lg = target->GetLocalGenerator(); std::ostringstream e; e << "Target \"" << target->GetName() << "\" is installed with " "INCLUDES DESTINATION set to a context sensitive path. Paths which " "depend on the configuration, policy values or the link interface are " "not supported. Consider using target_include_directories instead."; - mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + lg->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } @@ -500,7 +501,7 @@ //---------------------------------------------------------------------------- void cmExportFileGenerator::PopulateInterfaceProperty( const std::string& propName, - cmTarget *target, + cmGeneratorTarget* target, cmGeneratorExpression::PreprocessContext preprocessRule, ImportPropertyMap &properties, std::vector &missingTargets) @@ -511,8 +512,9 @@ //---------------------------------------------------------------------------- -void getPropertyContents(cmTarget const* tgt, const std::string& prop, - std::set &ifaceProperties) +void getPropertyContents(cmGeneratorTarget const* tgt, + const std::string& prop, + std::set &ifaceProperties) { const char *p = tgt->GetProperty(prop); if (!p) @@ -533,11 +535,11 @@ if (!info) { - cmMakefile* mf = target->Target->GetMakefile(); + cmLocalGenerator* lg = target->GetLocalGenerator(); std::ostringstream e; e << "Exporting the target \"" << target->GetName() << "\" is not " "allowed since its linker language cannot be determined"; - mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + lg->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } @@ -571,31 +573,30 @@ cmGeneratorTarget *gtarget, ImportPropertyMap &properties) { - cmTarget *target = gtarget->Target; this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_BOOL", - target, properties); + gtarget, properties); this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_STRING", - target, properties); + gtarget, properties); this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MIN", - target, properties); + gtarget, properties); this->PopulateInterfaceProperty("COMPATIBLE_INTERFACE_NUMBER_MAX", - target, properties); + gtarget, properties); std::set ifaceProperties; - getPropertyContents(target, "COMPATIBLE_INTERFACE_BOOL", ifaceProperties); - getPropertyContents(target, "COMPATIBLE_INTERFACE_STRING", ifaceProperties); - getPropertyContents(target, "COMPATIBLE_INTERFACE_NUMBER_MIN", + getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_BOOL", ifaceProperties); + getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_STRING", ifaceProperties); + getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MIN", ifaceProperties); - getPropertyContents(target, "COMPATIBLE_INTERFACE_NUMBER_MAX", + getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX", ifaceProperties); - if (target->GetType() != cmTarget::INTERFACE_LIBRARY) + if (gtarget->GetType() != cmState::INTERFACE_LIBRARY) { getCompatibleInterfaceProperties(gtarget, ifaceProperties, ""); std::vector configNames; - target->GetMakefile()->GetConfigurations(configNames); + gtarget->Target->GetMakefile()->GetConfigurations(configNames); for (std::vector::const_iterator ci = configNames.begin(); ci != configNames.end(); ++ci) @@ -608,12 +609,13 @@ it != ifaceProperties.end(); ++it) { this->PopulateInterfaceProperty("INTERFACE_" + *it, - target, properties); + gtarget, properties); } } //---------------------------------------------------------------------------- -void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget const* target, +void cmExportFileGenerator::GenerateInterfaceProperties( + const cmGeneratorTarget* target, std::ostream& os, const ImportPropertyMap &properties) { @@ -635,12 +637,12 @@ //---------------------------------------------------------------------------- bool cmExportFileGenerator::AddTargetNamespace(std::string &input, - cmTarget* target, + cmGeneratorTarget* target, std::vector &missingTargets) { - cmMakefile *mf = target->GetMakefile(); + cmLocalGenerator *lg = target->GetLocalGenerator(); - cmTarget *tgt = mf->FindTargetToUse(input); + cmGeneratorTarget *tgt = lg->FindGeneratorTargetToUse(input); if (!tgt) { return false; @@ -658,7 +660,7 @@ { std::string namespacedTarget; this->HandleMissingTarget(namespacedTarget, missingTargets, - mf, target, tgt); + target, tgt); if (!namespacedTarget.empty()) { input = namespacedTarget; @@ -671,7 +673,7 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpressions( std::string &input, - cmTarget* target, + cmGeneratorTarget* target, std::vector &missingTargets, FreeTargetsReplace replace) { @@ -708,14 +710,12 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpression( std::string &input, - cmTarget* target, + cmGeneratorTarget* target, std::vector &missingTargets) { std::string::size_type pos = 0; std::string::size_type lastPos = pos; - cmMakefile *mf = target->GetMakefile(); - while((pos = input.find("$", nameStartPos); + if (endPos == input.npos) + { + errorString = "$ expression incomplete"; + break; + } + std::string libName = input.substr(nameStartPos, endPos - nameStartPos); + if (cmGeneratorExpression::IsValidTargetName(libName) && + this->AddTargetNamespace(libName, target, missingTargets)) + { + input.replace(nameStartPos, endPos - nameStartPos, libName); + } + lastPos = nameStartPos + libName.size() + 1; + } + this->ReplaceInstallPrefix(input); if (!errorString.empty()) { - mf->IssueMessage(cmake::FATAL_ERROR, errorString); + target->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, errorString); } } @@ -797,7 +818,7 @@ { // Add the transitive link dependencies for this configuration. cmLinkInterface const* iface = target->GetLinkInterface(config, - target->Target); + target); if (!iface) { return; @@ -830,20 +851,18 @@ } const bool newCMP0022Behavior = - target->Target - ->GetPolicyStatusCMP0022() != cmPolicies::WARN - && target->Target - ->GetPolicyStatusCMP0022() != cmPolicies::OLD; + target->GetPolicyStatusCMP0022() != cmPolicies::WARN + && target->GetPolicyStatusCMP0022() != cmPolicies::OLD; if(newCMP0022Behavior && !this->ExportOld) { - cmMakefile *mf = target->Target->GetMakefile(); + cmLocalGenerator *lg = target->GetLocalGenerator(); std::ostringstream e; e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, " "but also has old-style LINK_INTERFACE_LIBRARIES properties " "populated, but it was exported without the " "EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties"; - mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + lg->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } @@ -857,7 +876,7 @@ preprocessRule); if (!prepro.empty()) { - this->ResolveTargetsInGeneratorExpressions(prepro, target->Target, + this->ResolveTargetsInGeneratorExpressions(prepro, target, missingTargets, ReplaceFreeTargets); properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = prepro; @@ -878,13 +897,10 @@ cmMakefile* mf = target->Makefile; // Add the soname for unix shared libraries. - if(target->GetType() == cmTarget::SHARED_LIBRARY || - target->GetType() == cmTarget::MODULE_LIBRARY) + if(target->GetType() == cmState::SHARED_LIBRARY || + target->GetType() == cmState::MODULE_LIBRARY) { - // Check whether this is a DLL platform. - bool dll_platform = - (mf->IsOn("WIN32") || mf->IsOn("CYGWIN") || mf->IsOn("MINGW")); - if(!dll_platform) + if(!target->IsDLLPlatform()) { std::string prop; std::string value; @@ -909,7 +925,7 @@ // Add the transitive link dependencies for this configuration. if(cmLinkInterface const* iface = - target->GetLinkInterface(config, target->Target)) + target->GetLinkInterface(config, target)) { this->SetImportLinkProperty(suffix, target, "IMPORTED_LINK_INTERFACE_LANGUAGES", @@ -959,7 +975,7 @@ sep = ";"; std::string temp = *li; - this->AddTargetNamespace(temp, target->Target, missingTargets); + this->AddTargetNamespace(temp, target, missingTargets); link_entries += temp; } @@ -1041,7 +1057,7 @@ //---------------------------------------------------------------------------- void cmExportFileGenerator -::GenerateImportTargetCode(std::ostream& os, cmTarget const* target) +::GenerateImportTargetCode(std::ostream& os, const cmGeneratorTarget* target) { // Construct the imported target name. std::string targetName = this->Namespace; @@ -1052,22 +1068,22 @@ os << "# Create imported target " << targetName << "\n"; switch(target->GetType()) { - case cmTarget::EXECUTABLE: + case cmState::EXECUTABLE: os << "add_executable(" << targetName << " IMPORTED)\n"; break; - case cmTarget::STATIC_LIBRARY: + case cmState::STATIC_LIBRARY: os << "add_library(" << targetName << " STATIC IMPORTED)\n"; break; - case cmTarget::SHARED_LIBRARY: + case cmState::SHARED_LIBRARY: os << "add_library(" << targetName << " SHARED IMPORTED)\n"; break; - case cmTarget::MODULE_LIBRARY: + case cmState::MODULE_LIBRARY: os << "add_library(" << targetName << " MODULE IMPORTED)\n"; break; - case cmTarget::UNKNOWN_LIBRARY: + case cmState::UNKNOWN_LIBRARY: os << "add_library(" << targetName << " UNKNOWN IMPORTED)\n"; break; - case cmTarget::INTERFACE_LIBRARY: + case cmState::INTERFACE_LIBRARY: os << "add_library(" << targetName << " INTERFACE IMPORTED)\n"; break; default: // should never happen @@ -1107,7 +1123,7 @@ void cmExportFileGenerator ::GenerateImportPropertyCode(std::ostream& os, const std::string& config, - cmTarget const* target, + cmGeneratorTarget const* target, ImportPropertyMap const& properties) { // Construct the imported target name. @@ -1227,7 +1243,7 @@ //---------------------------------------------------------------------------- void cmExportFileGenerator -::GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target, +::GenerateImportedFileChecksCode(std::ostream& os, cmGeneratorTarget* target, ImportPropertyMap const& properties, const std::set& importedLocations) { diff -Nru cmake-3.4.1/Source/cmExportFileGenerator.h cmake-3.5.0/Source/cmExportFileGenerator.h --- cmake-3.4.1/Source/cmExportFileGenerator.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportFileGenerator.h 2016-03-08 14:36:22.000000000 +0000 @@ -75,11 +75,13 @@ const std::string& config = ""); void GenerateImportFooterCode(std::ostream& os); void GenerateImportVersionCode(std::ostream& os); - void GenerateImportTargetCode(std::ostream& os, cmTarget const* target); + void GenerateImportTargetCode(std::ostream& os, + cmGeneratorTarget const* target); void GenerateImportPropertyCode(std::ostream& os, const std::string& config, - cmTarget const* target, + cmGeneratorTarget const* target, ImportPropertyMap const& properties); - void GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target, + void GenerateImportedFileChecksCode(std::ostream& os, + cmGeneratorTarget* target, ImportPropertyMap const& properties, const std::set& importedLocations); void GenerateImportedFileCheckLoop(std::ostream& os); @@ -118,23 +120,24 @@ * export set. */ virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, - cmTarget* depender, - cmTarget* dependee) = 0; + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee) = 0; void PopulateInterfaceProperty(const std::string&, - cmTarget *target, + cmGeneratorTarget *target, cmGeneratorExpression::PreprocessContext, ImportPropertyMap &properties, std::vector &missingTargets); - bool PopulateInterfaceLinkLibrariesProperty(cmTarget *target, + bool PopulateInterfaceLinkLibrariesProperty(cmGeneratorTarget* target, cmGeneratorExpression::PreprocessContext, ImportPropertyMap &properties, std::vector &missingTargets); - void PopulateInterfaceProperty(const std::string& propName, cmTarget *target, + void PopulateInterfaceProperty(const std::string& propName, + cmGeneratorTarget* target, ImportPropertyMap &properties); void PopulateCompatibleInterfaceProperties(cmGeneratorTarget *target, ImportPropertyMap &properties); - void GenerateInterfaceProperties(cmTarget const* target, std::ostream& os, + void GenerateInterfaceProperties(cmGeneratorTarget const* target, + std::ostream& os, const ImportPropertyMap &properties); void PopulateIncludeDirectoriesInterface( cmTargetExport *target, @@ -159,7 +162,7 @@ }; void ResolveTargetsInGeneratorExpressions(std::string &input, - cmTarget* target, + cmGeneratorTarget* target, std::vector &missingTargets, FreeTargetsReplace replace = NoReplaceFreeTargets); @@ -182,20 +185,20 @@ bool AppendMode; // The set of targets included in the export. - std::set ExportedTargets; + std::set ExportedTargets; private: void PopulateInterfaceProperty(const std::string&, const std::string&, - cmTarget *target, + cmGeneratorTarget* target, cmGeneratorExpression::PreprocessContext, ImportPropertyMap &properties, std::vector &missingTargets); - bool AddTargetNamespace(std::string &input, cmTarget* target, + bool AddTargetNamespace(std::string &input, cmGeneratorTarget* target, std::vector &missingTargets); void ResolveTargetsInGeneratorExpression(std::string &input, - cmTarget* target, + cmGeneratorTarget* target, std::vector &missingTargets); virtual void ReplaceInstallPrefix(std::string &input); diff -Nru cmake-3.4.1/Source/cmExportInstallFileGenerator.cxx cmake-3.5.0/Source/cmExportInstallFileGenerator.cxx --- cmake-3.4.1/Source/cmExportInstallFileGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportInstallFileGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -48,7 +48,8 @@ tei = this->IEGen->GetExportSet()->GetTargetExports()->begin(); tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei) { - expectedTargets += sep + this->Namespace + (*tei)->Target->GetExportName(); + expectedTargets += + sep + this->Namespace + (*tei)->Target->GetExportName(); sep = " "; cmTargetExport * te = *tei; if(this->ExportedTargets.insert(te->Target).second) @@ -131,12 +132,12 @@ tei = allTargets.begin(); tei != allTargets.end(); ++tei) { - cmTarget* te = (*tei)->Target; + cmGeneratorTarget* gt = (*tei)->Target; requiresConfigFiles = requiresConfigFiles - || te->GetType() != cmTarget::INTERFACE_LIBRARY; + || gt->GetType() != cmState::INTERFACE_LIBRARY; - this->GenerateImportTargetCode(os, te); + this->GenerateImportTargetCode(os, gt); ImportPropertyMap properties; @@ -147,32 +148,32 @@ cmGeneratorExpression::InstallInterface, properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", - te, + gt, cmGeneratorExpression::InstallInterface, properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", - te, + gt, cmGeneratorExpression::InstallInterface, properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", - te, + gt, cmGeneratorExpression::InstallInterface, properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS", - te, + gt, cmGeneratorExpression::InstallInterface, properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_COMPILE_FEATURES", - te, + gt, cmGeneratorExpression::InstallInterface, properties, missingTargets); const bool newCMP0022Behavior = - te->GetPolicyStatusCMP0022() != cmPolicies::WARN - && te->GetPolicyStatusCMP0022() != cmPolicies::OLD; + gt->GetPolicyStatusCMP0022() != cmPolicies::WARN + && gt->GetPolicyStatusCMP0022() != cmPolicies::OLD; if (newCMP0022Behavior) { - if (this->PopulateInterfaceLinkLibrariesProperty(te, + if (this->PopulateInterfaceLinkLibrariesProperty(gt, cmGeneratorExpression::InstallInterface, properties, missingTargets) && !this->ExportOld) @@ -180,11 +181,11 @@ require2_8_12 = true; } } - if (te->GetType() == cmTarget::INTERFACE_LIBRARY) + if (gt->GetType() == cmState::INTERFACE_LIBRARY) { require3_0_0 = true; } - if(te->GetProperty("INTERFACE_SOURCES")) + if(gt->GetProperty("INTERFACE_SOURCES")) { // We can only generate INTERFACE_SOURCES in CMake 3.3, but CMake 3.1 // can consume them. @@ -192,14 +193,11 @@ } this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE", - te, properties); - cmGeneratorTarget *gtgt = te->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(te); + gt, properties); - this->PopulateCompatibleInterfaceProperties(gtgt, properties); + this->PopulateCompatibleInterfaceProperties(gt, properties); - this->GenerateInterfaceProperties(te, os, properties); + this->GenerateInterfaceProperties(gt, os, properties); } if (require3_1_0) @@ -337,7 +335,7 @@ { // Collect import properties for this target. cmTargetExport const* te = *tei; - if (te->Target->GetType() == cmTarget::INTERFACE_LIBRARY) + if (te->Target->GetType() == cmState::INTERFACE_LIBRARY) { continue; } @@ -362,8 +360,7 @@ if(!properties.empty()) { // Get the rest of the target details. - cmGeneratorTarget *gtgt = te->Target->GetMakefile() - ->GetGlobalGenerator()->GetGeneratorTarget(te->Target); + cmGeneratorTarget *gtgt = te->Target; this->SetImportDetailProperties(config, suffix, gtgt, properties, missingTargets); @@ -378,8 +375,8 @@ // properties); // Generate code in the export file. - this->GenerateImportPropertyCode(os, config, te->Target, properties); - this->GenerateImportedFileChecksCode(os, te->Target, properties, + this->GenerateImportPropertyCode(os, config, gtgt, properties); + this->GenerateImportedFileChecksCode(os, gtgt, properties, importedLocations); } } @@ -402,7 +399,7 @@ } // Get the target to be installed. - cmTarget* target = itgen->GetTarget()->Target; + cmGeneratorTarget* target = itgen->GetTarget(); // Construct the installed location of the target. std::string dest = itgen->GetDestination(config); @@ -456,12 +453,13 @@ //---------------------------------------------------------------------------- void -cmExportInstallFileGenerator::HandleMissingTarget( - std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, cmTarget* depender, cmTarget* dependee) +cmExportInstallFileGenerator::HandleMissingTarget(std::string& link_libs, + std::vector& missingTargets, + cmGeneratorTarget* depender, cmGeneratorTarget* dependee) { const std::string name = dependee->GetName(); - std::vector namespaces = this->FindNamespaces(mf, name); + cmGlobalGenerator* gg = dependee->GetLocalGenerator()->GetGlobalGenerator(); + std::vector namespaces = this->FindNamespaces(gg, name); int targetOccurrences = (int)namespaces.size(); if (targetOccurrences == 1) { @@ -482,10 +480,9 @@ //---------------------------------------------------------------------------- std::vector cmExportInstallFileGenerator -::FindNamespaces(cmMakefile* mf, const std::string& name) +::FindNamespaces(cmGlobalGenerator* gg, const std::string& name) { std::vector namespaces; - cmGlobalGenerator* gg = mf->GetGlobalGenerator(); const cmExportSetMap& exportSets = gg->GetExportSets(); for(cmExportSetMap::const_iterator expIt = exportSets.begin(); @@ -499,7 +496,7 @@ bool containsTarget = false; for(unsigned int i=0; isize(); i++) { - if (name == (*targets)[i]->Target->GetName()) + if (name == (*targets)[i]->TargetName) { containsTarget = true; break; @@ -523,8 +520,8 @@ //---------------------------------------------------------------------------- void cmExportInstallFileGenerator -::ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, +::ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences) { std::ostringstream e; diff -Nru cmake-3.4.1/Source/cmExportInstallFileGenerator.h cmake-3.5.0/Source/cmExportInstallFileGenerator.h --- cmake-3.4.1/Source/cmExportInstallFileGenerator.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportInstallFileGenerator.h 2016-03-08 14:36:22.000000000 +0000 @@ -57,17 +57,16 @@ std::vector &missingTargets); virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, - cmTarget* depender, - cmTarget* dependee); + cmGeneratorTarget* depender, + cmGeneratorTarget* dependee); virtual void ReplaceInstallPrefix(std::string &input); - void ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee, + void ComplainAboutMissingTarget(cmGeneratorTarget* depender, + cmGeneratorTarget* dependee, int occurrences); - std::vector FindNamespaces(cmMakefile* mf, + std::vector FindNamespaces(cmGlobalGenerator* gg, const std::string& name); diff -Nru cmake-3.4.1/Source/cmExportLibraryDependenciesCommand.cxx cmake-3.5.0/Source/cmExportLibraryDependenciesCommand.cxx --- cmake-3.4.1/Source/cmExportLibraryDependenciesCommand.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportLibraryDependenciesCommand.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -96,8 +96,8 @@ cmTarget const& target = l->second; // Skip non-library targets. - if(target.GetType() < cmTarget::STATIC_LIBRARY - || target.GetType() > cmTarget::MODULE_LIBRARY) + if(target.GetType() < cmState::STATIC_LIBRARY + || target.GetType() > cmState::MODULE_LIBRARY) { continue; } @@ -120,15 +120,15 @@ std::string ltValue; switch(li->second) { - case cmTarget::GENERAL: + case GENERAL_LibraryType: valueNew += "general;"; ltValue = "general"; break; - case cmTarget::DEBUG: + case DEBUG_LibraryType: valueNew += "debug;"; ltValue = "debug"; break; - case cmTarget::OPTIMIZED: + case OPTIMIZED_LibraryType: valueNew += "optimized;"; ltValue = "optimized"; break; diff -Nru cmake-3.4.1/Source/cmExportSet.cxx cmake-3.5.0/Source/cmExportSet.cxx --- cmake-3.4.1/Source/cmExportSet.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportSet.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -13,12 +13,22 @@ #include "cmExportSet.h" #include "cmTargetExport.h" #include "cmAlgorithms.h" +#include "cmLocalGenerator.h" cmExportSet::~cmExportSet() { cmDeleteAll(this->TargetExports); } +void cmExportSet::Compute(cmLocalGenerator* lg) +{ + for (std::vector::iterator it = this->TargetExports.begin(); + it != this->TargetExports.end(); ++it) + { + (*it)->Target = lg->FindGeneratorTargetToUse((*it)->TargetName); + } +} + void cmExportSet::AddTargetExport(cmTargetExport* te) { this->TargetExports.push_back(te); diff -Nru cmake-3.4.1/Source/cmExportSet.h cmake-3.5.0/Source/cmExportSet.h --- cmake-3.4.1/Source/cmExportSet.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportSet.h 2016-03-08 14:36:22.000000000 +0000 @@ -15,6 +15,7 @@ #include "cmSystemTools.h" class cmTargetExport; class cmInstallExportGenerator; +class cmLocalGenerator; /// A set of targets that were installed with the same EXPORT parameter. class cmExportSet @@ -25,6 +26,8 @@ /// Destructor ~cmExportSet(); + void Compute(cmLocalGenerator* lg); + void AddTargetExport(cmTargetExport* tgt); void AddInstallation(cmInstallExportGenerator const* installation); diff -Nru cmake-3.4.1/Source/cmExportTryCompileFileGenerator.cxx cmake-3.5.0/Source/cmExportTryCompileFileGenerator.cxx --- cmake-3.4.1/Source/cmExportTryCompileFileGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportTryCompileFileGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -14,22 +14,25 @@ #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmGeneratorExpressionDAGChecker.h" //---------------------------------------------------------------------------- cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator( - cmGlobalGenerator* gg) + cmGlobalGenerator* gg, + const std::vector& targets, + cmMakefile* mf) { - gg->CreateGenerationObjects(cmGlobalGenerator::ImportedOnly); + gg->CreateImportedGenerationObjects(mf, targets, this->Exports); } bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os) { - std::set emitted; - std::set emittedDeps; + std::set emitted; + std::set emittedDeps; while(!this->Exports.empty()) { - cmTarget const* te = this->Exports.back(); + cmGeneratorTarget const* te = this->Exports.back(); this->Exports.pop_back(); if (emitted.insert(te).second) { @@ -54,9 +57,9 @@ } std::string cmExportTryCompileFileGenerator::FindTargets( - const std::string& propName, - cmTarget const* tgt, - std::set &emitted) + const std::string& propName, + cmGeneratorTarget const* tgt, + std::set &emitted) { const char *prop = tgt->GetProperty(propName); if(!prop) @@ -73,15 +76,19 @@ cmsys::auto_ptr cge = ge.Parse(prop); cmTarget dummyHead; - dummyHead.SetType(cmTarget::EXECUTABLE, "try_compile_dummy_exe"); - dummyHead.SetMakefile(tgt->GetMakefile()); + dummyHead.SetType(cmState::EXECUTABLE, "try_compile_dummy_exe"); + dummyHead.SetMakefile(tgt->Target->GetMakefile()); - std::string result = cge->Evaluate(tgt->GetMakefile(), this->Config, - false, &dummyHead, tgt, &dagChecker); + cmGeneratorTarget gDummyHead(&dummyHead, tgt->GetLocalGenerator()); - const std::set &allTargets = cge->GetAllTargetsSeen(); - for(std::set::const_iterator li = allTargets.begin(); - li != allTargets.end(); ++li) + std::string result = cge->Evaluate(tgt->GetLocalGenerator(), this->Config, + false, &gDummyHead, + tgt, &dagChecker); + + const std::set &allTargets = + cge->GetAllTargetsSeen(); + for(std::set::const_iterator li = + allTargets.begin(); li != allTargets.end(); ++li) { if(emitted.insert(*li).second) { @@ -93,20 +100,23 @@ //---------------------------------------------------------------------------- void -cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target, - ImportPropertyMap& properties, - std::set &emitted) +cmExportTryCompileFileGenerator::PopulateProperties( + const cmGeneratorTarget* target, + ImportPropertyMap& properties, + std::set &emitted) { - cmPropertyMap props = target->GetProperties(); - for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i) + std::vector props = target->GetPropertyKeys(); + for(std::vector::const_iterator i = props.begin(); + i != props.end(); ++i) { - properties[i->first] = i->second.GetValue(); - if(i->first.find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0 - || i->first.find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0 - || i->first.find("INTERFACE_LINK_LIBRARIES") == 0) + properties[*i] = target->GetProperty(*i); + + if(i->find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0 + || i->find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0 + || i->find("INTERFACE_LINK_LIBRARIES") == 0) { - std::string evalResult = this->FindTargets(i->first, + std::string evalResult = this->FindTargets(*i, target, emitted); std::vector depends; @@ -114,7 +124,8 @@ for(std::vector::const_iterator li = depends.begin(); li != depends.end(); ++li) { - cmTarget *tgt = target->GetMakefile()->FindTargetToUse(*li); + cmGeneratorTarget *tgt = + target->GetLocalGenerator()->FindGeneratorTargetToUse(*li); if(tgt && emitted.insert(tgt).second) { this->Exports.push_back(tgt); diff -Nru cmake-3.4.1/Source/cmExportTryCompileFileGenerator.h cmake-3.5.0/Source/cmExportTryCompileFileGenerator.h --- cmake-3.4.1/Source/cmExportTryCompileFileGenerator.h 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExportTryCompileFileGenerator.h 2016-03-08 14:36:22.000000000 +0000 @@ -20,11 +20,11 @@ class cmExportTryCompileFileGenerator: public cmExportFileGenerator { public: - cmExportTryCompileFileGenerator(cmGlobalGenerator* gg); + cmExportTryCompileFileGenerator(cmGlobalGenerator* gg, + std::vector const& targets, + cmMakefile* mf); /** Set the list of targets to export. */ - void SetExports(const std::vector &exports) - { this->Exports = exports; } void SetConfig(const std::string& config) { this->Config = config; } protected: @@ -37,22 +37,22 @@ std::vector&) {} virtual void HandleMissingTarget(std::string&, std::vector&, - cmMakefile*, - cmTarget*, - cmTarget*) {} + cmGeneratorTarget*, + cmGeneratorTarget*) {} - void PopulateProperties(cmTarget const* target, + void PopulateProperties(cmGeneratorTarget const* target, ImportPropertyMap& properties, - std::set &emitted); + std::set& emitted); std::string InstallNameDir(cmGeneratorTarget* target, const std::string& config); private: - std::string FindTargets(const std::string& prop, cmTarget const* tgt, - std::set &emitted); + std::string FindTargets(const std::string& prop, + const cmGeneratorTarget* tgt, + std::set& emitted); - std::vector Exports; + std::vector Exports; std::string Config; }; diff -Nru cmake-3.4.1/Source/cmExtraCodeBlocksGenerator.cxx cmake-3.5.0/Source/cmExtraCodeBlocksGenerator.cxx --- cmake-3.4.1/Source/cmExtraCodeBlocksGenerator.cxx 2015-12-02 15:43:21.000000000 +0000 +++ cmake-3.5.0/Source/cmExtraCodeBlocksGenerator.cxx 2016-03-08 14:36:22.000000000 +0000 @@ -17,7 +17,6 @@ #include "cmake.h" #include "cmSourceFile.h" #include "cmGeneratedFileStream.h" -#include "cmTarget.h" #include "cmSystemTools.h" #include "cmXMLSafe.h" @@ -76,9 +75,8 @@ void cmExtraCodeBlocksGenerator::CreateProjectFile( const std::vector& lgs) { - const cmMakefile* mf=lgs[0]->GetMakefile(); - std::string outputDir=mf->GetCurrentBinaryDirectory(); - std::string projectName=mf->GetProjectName(); + std::string outputDir=lgs[0]->GetCurrentBinaryDirectory(); + std::string projectName=lgs[0]->GetProjectName(); std::string filename=outputDir+"/"; filename+=projectName+".cbp"; @@ -273,7 +271,7 @@ } const std::string &relative = cmSystemTools::RelativePath( - it->second[0]->GetMakefile()->GetHomeDirectory(), + it->second[0]->GetSourceDirectory(), jt->c_str()); std::vector splitted; cmSystemTools::SplitPath(relative, splitted, false); @@ -297,7 +295,7 @@ tree.BuildVirtualFolder(virtualFolders); // And one for std::string unitFiles; - tree.BuildUnit(unitFiles, std::string(mf->GetHomeDirectory()) + "/"); + tree.BuildUnit(unitFiles, std::string(lgs[0]->GetSourceDirectory()) + "/"); // figure out the compiler std::string compiler = this->GetCBCompilerId(mf); @@ -307,7 +305,7 @@ "\n" " \n" " \n" - "