diff options
25 files changed, 160 insertions, 63 deletions
diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst index 7b2ef04..8256444 100644 --- a/Help/policy/CMP0082.rst +++ b/Help/policy/CMP0082.rst @@ -6,9 +6,11 @@ those in caller. CMake 3.13 and lower ran the install rules from :command:`add_subdirectory` after all other install rules, even if :command:`add_subdirectory` was called -before the other install rules. CMake 3.14 and later interleaves these -:command:`add_subdirectory` install rules with the others so that they are -run in the order they are declared. +before the other install rules. CMake 3.14 and above prefer to interleave +these :command:`add_subdirectory` install rules with the others so that +they are run in the order they are declared. This policy provides +compatibility for projects that have not been updated to expect the +new behavior. The ``OLD`` behavior for this policy is to run the install rules from :command:`add_subdirectory` after the other install rules. The ``NEW`` diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst index 5038a75..f2a91c6 100644 --- a/Help/release/3.14.rst +++ b/Help/release/3.14.rst @@ -377,3 +377,17 @@ Other Changes * CMake no longer issues a warning if a target listed in an :command:`install(TARGETS)` command has its :prop_tgt:`EXCLUDE_FROM_ALL` property set to true. + +Updates +======= + +Changes made since CMake 3.14.0 include the following. + +3.14.1 +------ + +* The :module:`FindFontconfig` module added by 3.14.0 accidentally + used uppercase ``FONTCONFIG_*`` variable names that do not match + our conventions. 3.14.1 revises the module to use ``Fontconfig_*`` + variable names. This is incompatible with 3.14.0 but since the + module is new in the 3.14 series usage should not yet be widespread. diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake index 4d0c681..6a22d27 100644 --- a/Modules/CMakeCompilerIdDetection.cmake +++ b/Modules/CMakeCompilerIdDetection.cmake @@ -73,13 +73,13 @@ function(compiler_id_detection outvar lang) endif() list(APPEND ordered_compilers SCO + ARMCC AppleClang Clang GNU MSVC ADSP IAR - ARMCC ) if (lang STREQUAL C) list(APPEND ordered_compilers diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 113b520..490d659 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -111,10 +111,15 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL NVIDIA) if(_nvcc_libraries) # Remove variable assignments. string(REGEX REPLACE "#\\\$ *[^= ]+=[^\n]*\n" "" _nvcc_output "${_nvcc_output_orig}") + # Encode [] characters that break list expansion. + string(REPLACE "[" "{==={" _nvcc_output "${_nvcc_output}") + string(REPLACE "]" "}===}" _nvcc_output "${_nvcc_output}") # Split lines. string(REGEX REPLACE "\n+(#\\\$ )?" ";" _nvcc_output "${_nvcc_output}") foreach(line IN LISTS _nvcc_output) set(_nvcc_output_line "${line}") + string(REPLACE "{==={" "[" _nvcc_output_line "${_nvcc_output_line}") + string(REPLACE "}===}" "]" _nvcc_output_line "${_nvcc_output_line}") string(APPEND _nvcc_log " considering line: [${_nvcc_output_line}]\n") if("${_nvcc_output_line}" MATCHES "^ *nvlink") string(APPEND _nvcc_log " ignoring nvlink line\n") diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index e0d2449..06f3ba2 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -51,6 +51,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) OUTPUT_VARIABLE OUTPUT COPY_FILE "${BIN}" COPY_FILE_ERROR _copy_error + __CMAKE_INTERNAL ABI ) # Restore original LC_ALL, LC_MESSAGES, and LANG diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 8380977..42ef8c7 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -616,6 +616,12 @@ macro(cpack_ifw_configure_component_group grpname) set(_CPACK_IFWGRP_STR "\n# Configuration for IFW component group \"${grpname}\"\n") + foreach(_IFW_ARG_NAME ${_IFW_OPT}) + cpack_append_option_set_command( + CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME} + _CPACK_IFWGRP_STR) + endforeach() + foreach(_IFW_ARG_NAME ${_IFW_ARGS}) cpack_append_string_variable_set_command( CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME} diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake index 96e1e76..a6f0180 100644 --- a/Modules/FindFontconfig.cmake +++ b/Modules/FindFontconfig.cmake @@ -18,15 +18,15 @@ Result Variables This will define the following variables in your project: -``FONTCONFIG_FOUND`` +``Fontconfig_FOUND`` true if (the requested version of) Fontconfig is available. -``FONTCONFIG_VERSION`` +``Fontconfig_VERSION`` the version of Fontconfig. -``FONTCONFIG_LIBRARIES`` +``Fontconfig_LIBRARIES`` the libraries to link against to use Fontconfig. -``FONTCONFIG_INCLUDE_DIRS`` +``Fontconfig_INCLUDE_DIRS`` where to find the Fontconfig headers. -``FONTCONFIG_COMPILE_OPTIONS`` +``Fontconfig_COMPILE_OPTIONS`` this should be passed to target_compile_options(), if the target is not used for linking @@ -37,10 +37,10 @@ This will define the following variables in your project: # in the FIND_PATH() and FIND_LIBRARY() calls find_package(PkgConfig QUIET) pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig) -set(FONTCONFIG_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER}) -set(FONTCONFIG_VERSION ${PKG_FONTCONFIG_VERSION}) +set(Fontconfig_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER}) +set(Fontconfig_VERSION ${PKG_FONTCONFIG_VERSION}) -find_path( FONTCONFIG_INCLUDE_DIR +find_path( Fontconfig_INCLUDE_DIR NAMES fontconfig/fontconfig.h HINTS @@ -48,24 +48,24 @@ find_path( FONTCONFIG_INCLUDE_DIR /usr/X11/include ) -find_library( FONTCONFIG_LIBRARY +find_library( Fontconfig_LIBRARY NAMES fontconfig PATHS ${PKG_FONTCONFIG_LIBRARY_DIRS} ) -if (FONTCONFIG_INCLUDE_DIR AND NOT FONTCONFIG_VERSION) - file(STRINGS ${FONTCONFIG_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$") - unset(FONTCONFIG_VERSION) +if (Fontconfig_INCLUDE_DIR AND NOT Fontconfig_VERSION) + file(STRINGS ${Fontconfig_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$") + unset(Fontconfig_VERSION) foreach(VPART MAJOR MINOR REVISION) foreach(VLINE ${_contents}) if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$") - set(FONTCONFIG_VERSION_PART "${CMAKE_MATCH_1}") - if(FONTCONFIG_VERSION) - string(APPEND FONTCONFIG_VERSION ".${FONTCONFIG_VERSION_PART}") + set(Fontconfig_VERSION_PART "${CMAKE_MATCH_1}") + if(Fontconfig_VERSION) + string(APPEND Fontconfig_VERSION ".${Fontconfig_VERSION_PART}") else() - set(FONTCONFIG_VERSION "${FONTCONFIG_VERSION_PART}") + set(Fontconfig_VERSION "${Fontconfig_VERSION_PART}") endif() endif() endforeach() @@ -75,27 +75,27 @@ endif () include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Fontconfig FOUND_VAR - FONTCONFIG_FOUND + Fontconfig_FOUND REQUIRED_VARS - FONTCONFIG_LIBRARY - FONTCONFIG_INCLUDE_DIR + Fontconfig_LIBRARY + Fontconfig_INCLUDE_DIR VERSION_VAR - FONTCONFIG_VERSION + Fontconfig_VERSION ) -if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig) +if(Fontconfig_FOUND AND NOT TARGET Fontconfig::Fontconfig) add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED) set_target_properties(Fontconfig::Fontconfig PROPERTIES - IMPORTED_LOCATION "${FONTCONFIG_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${FONTCONFIG_COMPILE_OPTIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}" + IMPORTED_LOCATION "${Fontconfig_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${Fontconfig_COMPILE_OPTIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${Fontconfig_INCLUDE_DIR}" ) endif() -mark_as_advanced(FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR) +mark_as_advanced(Fontconfig_LIBRARY Fontconfig_INCLUDE_DIR) -if(FONTCONFIG_FOUND) - set(FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY}) - set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR}) +if(Fontconfig_FOUND) + set(Fontconfig_LIBRARIES ${Fontconfig_LIBRARY}) + set(Fontconfig_INCLUDE_DIRS ${Fontconfig_INCLUDE_DIR}) endif() diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake index f014916..1c134e2 100644 --- a/Modules/FindPython.cmake +++ b/Modules/FindPython.cmake @@ -28,6 +28,13 @@ is searched. To manage concurrent versions 3 and 2 of Python, use :module:`FindPython3` and :module:`FindPython2` modules rather than this one. +.. note:: + + If components ``Interpreter`` and ``Development`` are both specified, this + module search only for interpreter with same platform architecture as the one + defined by ``CMake`` configuration. This contraint does not apply if only + ``Interpreter`` component is specified. + Imported Targets ^^^^^^^^^^^^^^^^ diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index ef8272c..1236bf8 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -341,14 +341,14 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} NAMES_PER_DIR HINTS ${_${_PYTHON_PREFIX}_HINTS} - PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] + PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\IronPython\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] @@ -402,14 +402,14 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) python ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} NAMES_PER_DIR - PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] + PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\IronPython\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] @@ -816,14 +816,14 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS _python_get_frameworks (_${_PYTHON_PREFIX}_FRAMEWORK_PATHS ${_${_PYTHON_PREFIX}_VERSION}) set (_${_PYTHON_PREFIX}_REGISTRY_PATHS - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]) diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake index 0bb7b28..b9c0b6b 100644 --- a/Modules/FindPython2.cmake +++ b/Modules/FindPython2.cmake @@ -29,6 +29,13 @@ concurrently with :module:`FindPython3` module to use both Python versions. The :module:`FindPython` module can be used if Python version does not matter for you. +.. note:: + + If components ``Interpreter`` and ``Development`` are both specified, this + module search only for interpreter with same platform architecture as the one + defined by ``CMake`` configuration. This contraint does not apply if only + ``Interpreter`` component is specified. + Imported Targets ^^^^^^^^^^^^^^^^ diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake index b3dfff3..c2f3384 100644 --- a/Modules/FindPython3.cmake +++ b/Modules/FindPython3.cmake @@ -29,6 +29,13 @@ concurrently with :module:`FindPython2` module to use both Python versions. The :module:`FindPython` module can be used if Python version does not matter for you. +.. note:: + + If components ``Interpreter`` and ``Development`` are both specified, this + module search only for interpreter with same platform architecture as the one + defined by ``CMake`` configuration. This contraint does not apply if only + ``Interpreter`` component is specified. + Imported Targets ^^^^^^^^^^^^^^^^ diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake index 46a7449..b28dd12 100644 --- a/Modules/FindX11.cmake +++ b/Modules/FindX11.cmake @@ -206,7 +206,7 @@ if (UNIX) if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH) find_package(Freetype QUIET) find_package(Fontconfig QUIET) - if (FREETYPE_FOUND AND FONTCONFIG_FOUND) + if (FREETYPE_FOUND AND Fontconfig_FOUND) set(X11_Xft_FOUND TRUE) endif () list(APPEND X11_INCLUDE_DIR ${X11_Xft_INCLUDE_PATH}) diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 61c5dcb..b78142a 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -29,6 +29,7 @@ protected: this->PackageName = atts[1]; this->PackagePath.clear(); } else if (name == "sourcefile") { + this->FilePath.clear(); std::string fileName = atts[1]; if (this->PackagePath.empty()) { diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index eb52895..3892011 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -123,6 +123,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, std::string targetName; std::vector<std::string> cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0] std::vector<std::string> compileDefs; + std::string cmakeInternal; std::string outputVariable; std::string copyFile; std::string copyFileError; @@ -174,7 +175,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, DoingCExtensions, DoingCxxExtensions, DoingCudaExtensions, - DoingSources + DoingSources, + DoingCMakeInternal }; Doing doing = useSources ? DoingSources : DoingNone; for (size_t i = 3; i < argv.size(); ++i) { @@ -223,6 +225,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } else if (argv[i] == "CUDA_EXTENSIONS") { doing = DoingCudaExtensions; didCudaExtensions = true; + } else if (argv[i] == "__CMAKE_INTERNAL") { + doing = DoingCMakeInternal; } else if (doing == DoingCMakeFlags) { cmakeFlags.push_back(argv[i]); } else if (doing == DoingCompileDefinitions) { @@ -296,6 +300,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, doing = DoingNone; } else if (doing == DoingSources) { sources.push_back(argv[i]); + } else if (doing == DoingCMakeInternal) { + cmakeInternal = argv[i]; + doing = DoingNone; } else if (i == 3) { this->SrcFileSignature = false; projectName = argv[i].c_str(); @@ -508,6 +515,14 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } } fprintf(fout, "project(CMAKE_TRY_COMPILE%s)\n", projectLangs.c_str()); + if (cmakeInternal == "ABI") { + // This is the ABI detection step, also used for implicit includes. + // Erase any include_directories() calls from the toolchain file so + // that we do not see them as implicit. Our ABI detection source + // does not include any system headers anyway. + fprintf(fout, + "set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES \"\")\n"); + } fprintf(fout, "set(CMAKE_VERBOSE_MAKEFILE 1)\n"); for (std::string const& li : testLangs) { std::string langFlags = "CMAKE_" + li + "_FLAGS"; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 30067b7..e05f74b 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -845,6 +845,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const const std::vector<cmGeneratorTarget*>& targets = lgen->GetGeneratorTargets(); for (cmGeneratorTarget* target : targets) { + if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { + continue; + } std::vector<std::string> includeDirs; std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE"); lgen->GetIncludeDirectories(includeDirs, target, "C", config); @@ -971,6 +974,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const virtDir, "", ""); } } break; + case cmStateEnums::INTERFACE_LIBRARY: + break; default: break; } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index db34077..782f746 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -77,7 +77,7 @@ struct cmFindProgramHelper this->TestNameExt = name; this->TestNameExt += ext; this->TestPath = - cmSystemTools::CollapseCombinedPath(path, this->TestNameExt); + cmSystemTools::CollapseFullPath(this->TestNameExt, path); if (cmSystemTools::FileExists(this->TestPath, true)) { this->BestPath = this->TestPath; diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 4d74e32..f52abd0 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -18,8 +18,15 @@ #elif defined(_M_IA64) # define HOST_PLATFORM_NAME "Itanium" # define HOST_TOOLS_ARCH "" +#elif defined(_WIN64) +# define HOST_PLATFORM_NAME "x64" +# define HOST_TOOLS_ARCH "x64" #else -# include "cmsys/SystemInformation.hxx" +static bool VSIsWow64() +{ + BOOL isWow64 = false; + return IsWow64Process(GetCurrentProcess(), &isWow64) && isWow64; +} #endif static std::string VSHostPlatformName() @@ -27,8 +34,7 @@ static std::string VSHostPlatformName() #ifdef HOST_PLATFORM_NAME return HOST_PLATFORM_NAME; #else - cmsys::SystemInformation info; - if (info.Is64Bits()) { + if (VSIsWow64()) { return "x64"; } else { return "Win32"; @@ -41,8 +47,7 @@ static std::string VSHostArchitecture() #ifdef HOST_TOOLS_ARCH return HOST_TOOLS_ARCH; #else - cmsys::SystemInformation info; - if (info.Is64Bits()) { + if (VSIsWow64()) { return "x64"; } else { return "x86"; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7e56818..7e15234 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -937,10 +937,8 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( // Implicit include directories std::vector<std::string> implicitDirs; std::set<std::string> implicitSet; - // Checks if this is not an implicit include directory - auto notImplicit = [&implicitSet](std::string const& dir) { - return (implicitSet.find(dir) == implicitSet.end()); - }; + // Include directories to be excluded as if they were implicit. + std::set<std::string> implicitExclude; { // Raw list of implicit include directories // Start with "standard" directories that we unconditionally add below. @@ -978,7 +976,8 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( [](std::string const& d) { return cmHasLiteralSuffix(d, "/usr/include"); }) != impDirVec.end()) { - impDirVec.emplace_back("/usr/include"); + // Only exclude this hard coded path for backwards compatibility. + implicitExclude.emplace("/usr/include"); } for (std::string const& i : impDirVec) { @@ -988,6 +987,12 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( } } + // Checks if this is not an excluded (implicit) include directory. + auto notExcluded = [&implicitSet, &implicitExclude](std::string const& dir) { + return ((implicitSet.find(dir) == implicitSet.end()) && + (implicitExclude.find(dir) == implicitExclude.end())); + }; + // Get the target-specific include directories. std::vector<BT<std::string>> userDirs = target->GetIncludeDirectories(config, lang); @@ -1004,7 +1009,7 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( cmSystemTools::ComparePath(udr.Value, topBinaryDir) || cmSystemTools::IsSubDirectory(udr.Value, topSourceDir) || cmSystemTools::IsSubDirectory(udr.Value, topBinaryDir)) { - if (notImplicit(udr.Value)) { + if (notExcluded(udr.Value)) { emitBT(udr); } } @@ -1013,7 +1018,7 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( // Emit remaining non implicit user direcories. for (BT<std::string> const& udr : userDirs) { - if (notImplicit(udr.Value)) { + if (notExcluded(udr.Value)) { emitBT(udr); } } @@ -1032,7 +1037,7 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( if (!stripImplicitDirs) { // Append implicit directories that were requested by the user only for (BT<std::string> const& udr : userDirs) { - if (!notImplicit(udr.Value)) { + if (implicitSet.find(udr.Value) != implicitSet.end()) { emitBT(udr); } } diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index cbdfe11..d8904fe 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2307,10 +2307,6 @@ static bool CloneFileContent(const std::string& source, bool SystemTools::CopyFileAlways(const std::string& source, const std::string& destination) { - // If files are the same do not copy - if (SystemTools::SameFile(source, destination)) { - return true; - } mode_t perm = 0; bool perms = SystemTools::GetPermissions(source, perm); std::string real_destination = destination; @@ -2331,6 +2327,10 @@ bool SystemTools::CopyFileAlways(const std::string& source, } else { destination_dir = SystemTools::GetFilenamePath(destination); } + // If files are the same do not copy + if (SystemTools::SameFile(source, real_destination)) { + return true; + } // Create destination directory diff --git a/Tests/FindFontconfig/Test/CMakeLists.txt b/Tests/FindFontconfig/Test/CMakeLists.txt index 81db3ba..36c76b1 100644 --- a/Tests/FindFontconfig/Test/CMakeLists.txt +++ b/Tests/FindFontconfig/Test/CMakeLists.txt @@ -4,13 +4,13 @@ include(CTest) find_package(Fontconfig REQUIRED) -add_definitions(-DCMAKE_EXPECTED_FONTCONFIG_VERSION="${FONTCONFIG_VERSION}") +add_definitions(-DCMAKE_EXPECTED_FONTCONFIG_VERSION="${Fontconfig_VERSION}") add_executable(test_tgt main.c) target_link_libraries(test_tgt Fontconfig::Fontconfig) add_test(NAME test_tgt COMMAND test_tgt) add_executable(test_var main.c) -target_include_directories(test_var PRIVATE ${FONTCONFIG_INCLUDE_DIRS}) -target_link_libraries(test_var PRIVATE ${FONTCONFIG_LIBRARIES}) +target_include_directories(test_var PRIVATE ${Fontconfig_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${Fontconfig_LIBRARIES}) add_test(NAME test_var COMMAND test_var) diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories-toolchain.cmake b/Tests/RunCMake/ToolchainFile/IncludeDirectories-toolchain.cmake new file mode 100644 index 0000000..e77e9fe --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories-toolchain.cmake @@ -0,0 +1 @@ +include_directories(${CMAKE_CURRENT_LIST_DIR}/IncludeDirectories) diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories.c b/Tests/RunCMake/ToolchainFile/IncludeDirectories.c new file mode 100644 index 0000000..81b2465 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories.c @@ -0,0 +1,5 @@ +#include <IncDir.h> + +void IncDir(void) +{ +} diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories.cmake b/Tests/RunCMake/ToolchainFile/IncludeDirectories.cmake new file mode 100644 index 0000000..616cff4 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories.cmake @@ -0,0 +1,2 @@ +enable_language(C) +add_library(IncDir STATIC IncludeDirectories.c) diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories/IncDir.h b/Tests/RunCMake/ToolchainFile/IncludeDirectories/IncDir.h new file mode 100644 index 0000000..bca9c2c --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories/IncDir.h @@ -0,0 +1 @@ +/* IncDir.h */ diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake index 8a20200..7eb4485 100644 --- a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake +++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake @@ -9,3 +9,11 @@ run_cmake_toolchain(CallEnableLanguage) run_cmake_toolchain(CallProject) run_cmake_toolchain(FlagsInit) run_cmake_toolchain(LinkFlagsInit) + +function(run_IncludeDirectories) + run_cmake_toolchain(IncludeDirectories) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/IncludeDirectories-build) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(IncludeDirectories-build ${CMAKE_COMMAND} --build . --config Debug) +endfunction() +run_IncludeDirectories() |