diff options
70 files changed, 527 insertions, 145 deletions
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst index 4304f09..e08c573 100644 --- a/Help/command/configure_file.rst +++ b/Help/command/configure_file.rst @@ -30,9 +30,23 @@ a false constant by the :command:`if` command. The "..." content on the line after the variable name, if any, is processed as above. Input file lines of the form ``#cmakedefine01 VAR`` will be replaced with either ``#define VAR 1`` or ``#define VAR 0`` similarly. +The result lines (with the exception of the ``#undef`` comments) can be +indented using spaces and/or tabs between the ``#`` character +and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace +indentation will be preserved in the output lines:: + + # cmakedefine VAR + # cmakedefine01 VAR + +will be replaced, if ``VAR`` is defined, with:: + + # define VAR + # define VAR 1 If the input file is modified the build system will re-run CMake to re-configure the file and generate the build system again. +The generated file is modified and its timestamp updated on subsequent +cmake runs only if its content is changed. The arguments are: diff --git a/Help/command/file.rst b/Help/command/file.rst index 7afb715..97466ff 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -306,8 +306,8 @@ from the input content to produce the output content. The options are: Exactly one ``CONTENT`` or ``INPUT`` option must be given. A specific ``OUTPUT`` file may be named by at most one invocation of ``file(GENERATE)``. -Generated files are modified on subsequent cmake runs only if their content -is changed. +Generated files are modified and their timestamp updated on subsequent cmake +runs only if their content is changed. Note also that ``file(GENERATE)`` does not create the output file until the generation phase. The output file will not yet have been written when the diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst index a88f8bc..2ac0449 100644 --- a/Help/generator/Visual Studio 15 2017.rst +++ b/Help/generator/Visual Studio 15 2017.rst @@ -15,6 +15,18 @@ a target platform name optionally at the end of this generator name: ``Visual Studio 15 2017 ARM`` Specify target platform ``ARM``. +Instance Selection +^^^^^^^^^^^^^^^^^^ + +VS 2017 supports multiple installations on the same machine. +CMake queries the Visual Studio Installer to locate VS instances. +If more than one instance is installed we do not define which one +is chosen by default. If the ``VS150COMNTOOLS`` environment variable +is set and points to the ``Common7/Tools`` directory within one of +the instances, that instance will be used. The environment variable +must remain consistently set whenever CMake is re-run within a given +build tree. + Toolset Selection ^^^^^^^^^^^^^^^^^ diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst index 6a68a1c..f6d3032 100644 --- a/Help/manual/cmake-server.7.rst +++ b/Help/manual/cmake-server.7.rst @@ -504,6 +504,9 @@ Each target object can have the following keys: with the sysroot path. "fileGroups" contains the source files making up the target. +"crossReferences" + contains the location of the target in the corresponding CMakeLists.txt + file and the locations of the related statements like "target_link_libraries" FileGroups are used to group sources using similar settings together. @@ -529,6 +532,16 @@ Each fileGroup object may contain the following keys: All file paths in the fileGroup are either absolute or relative to the sourceDirectory of the target. +CrossReferences object is used to report the location of the target (including +the entire call stack if the target is defined in a function) and the related +"target_link_libraries", "target_include_directories", "target_compile_definitions" +and "target_compile_options" statements. + +See the example below for details on the internal format of the "crossReferences" object. +Line numbers stated in the "backtrace" entries are 1-based. The last entry of a backtrace +is a special entry with missing "line" and "name" fields that specifies the initial +CMakeLists.txt file. + Example:: [== "CMake Server" ==[ @@ -565,7 +578,34 @@ CMake will reply:: "linkerLanguage": "C", "name": "cmForm", "sourceDirectory": "/home/code/src/cmake/Source/CursesDialog/form", - "type": "STATIC_LIBRARY" + "type": "STATIC_LIBRARY", + "crossReferences": { + "backtrace": [ + { + "line": 7, + "name": "add_executable", + "path": "C:/full/path/CMakeLists.txt" + }, + { + "path": "c:/full/path/CMakeLists.txt" + } + ], + "relatedStatements": [ + { + "backtrace": [ + { + "line": 8, + "name": "target_link_libraries", + "path": "c:/full/path/CMakeLists.txt" + }, + { + "path": "c:/full/path/CMakeLists.txt" + } + ], + "type": "target_link_libraries" + } + ] + } } ] }, diff --git a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst index dcd2a4e..a316abe 100644 --- a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst +++ b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst @@ -26,4 +26,6 @@ and ExtensibilityAddIns by default. If you set the corresponding property, it will override the default section. For example, setting VS_GLOBAL_SECTION_POST_ExtensibilityGlobals will override the default contents of the ExtensibilityGlobals section, while keeping -ExtensibilityAddIns on its default. +ExtensibilityAddIns on its default. However, CMake will always +add a ``SolutionGuid`` to the ``ExtensibilityGlobals`` section +if it is not specified explicitly. diff --git a/Help/release/dev/indented_cmakedefine.rst b/Help/release/dev/indented_cmakedefine.rst new file mode 100644 index 0000000..fd28b25 --- /dev/null +++ b/Help/release/dev/indented_cmakedefine.rst @@ -0,0 +1,7 @@ +indented_cmakedefine +-------------------- + +* The :command:`configure_file` command learned to support indented + ``# cmakedefine`` and ``# cmakedefine01``. Spaces and/or tabs between + the ``#`` character and the ``cmakedefine``/``cmakedefine01`` words + are now understood and preserved in the output. diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 2d9d2a2..48d5de4 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -23,7 +23,7 @@ # Fortran_HL. If the COMPONENTS argument is not given, the module will # attempt to find only the C bindings. # -# On UNIX systems, this module will read the variable +# This module will read the variable # HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a # static link to a dynamic link for HDF5 and all of it's dependencies. # To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES @@ -551,8 +551,12 @@ if(NOT HDF5_FOUND) if("x${L}" MATCHES "hdf5") # hdf5 library set(_HDF5_SEARCH_OPTS_LOCAL ${_HDF5_SEARCH_OPTS}) - if(UNIX AND HDF5_USE_STATIC_LIBRARIES) - set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a) + if(HDF5_USE_STATIC_LIBRARIES) + if(WIN32) + set(_HDF5_SEARCH_NAMES_LOCAL lib${L}) + else() + set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a) + endif() endif() else() # external library @@ -579,8 +583,12 @@ if(NOT HDF5_FOUND) if("x${L}" MATCHES "hdf5") # hdf5 library set(_HDF5_SEARCH_OPTS_LOCAL ${_HDF5_SEARCH_OPTS}) - if(UNIX AND HDF5_USE_STATIC_LIBRARIES) - set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a) + if(HDF5_USE_STATIC_LIBRARIES) + if(WIN32) + set(_HDF5_SEARCH_NAMES_LOCAL lib${L}) + else() + set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a) + endif() endif() else() # external library @@ -712,19 +720,22 @@ if( NOT HDF5_FOUND ) # find the HDF5 libraries foreach(LIB IN LISTS HDF5_${__lang}_LIBRARY_NAMES) - if(UNIX AND HDF5_USE_STATIC_LIBRARIES) + if(HDF5_USE_STATIC_LIBRARIES) # According to bug 1643 on the CMake bug tracker, this is the # preferred method for searching for a static library. # See https://gitlab.kitware.com/cmake/cmake/issues/1643. We search # first for the full static library name, but fall back to a # generic search on the name if the static search fails. set( THIS_LIBRARY_SEARCH_DEBUG - lib${LIB}d.a lib${LIB}_debug.a ${LIB}d ${LIB}_debug - lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_debug-static ) - set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a ${LIB}-static) + lib${LIB}d.a lib${LIB}_debug.a lib${LIB}d lib${LIB}_D lib${LIB}_debug + lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_D-static ${LIB}_debug-static ) + set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a lib${LIB} lib${LIB}-static.a ${LIB}-static) else() - set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_debug ${LIB}d-shared ${LIB}_debug-shared) + set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_D ${LIB}_debug ${LIB}d-shared ${LIB}_D-shared ${LIB}_debug-shared) set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared) + if(WIN32) + list(APPEND HDF5_DEFINITIONS "-DH5_BUILT_AS_DYNAMIC_LIB") + endif() endif() find_library(HDF5_${LIB}_LIBRARY_DEBUG NAMES ${THIS_LIBRARY_SEARCH_DEBUG} @@ -749,18 +760,18 @@ if( NOT HDF5_FOUND ) if(FIND_HL) foreach(LIB IN LISTS HDF5_${__lang}_HL_LIBRARY_NAMES) - if(UNIX AND HDF5_USE_STATIC_LIBRARIES) + if(HDF5_USE_STATIC_LIBRARIES) # According to bug 1643 on the CMake bug tracker, this is the # preferred method for searching for a static library. # See https://gitlab.kitware.com/cmake/cmake/issues/1643. We search # first for the full static library name, but fall back to a # generic search on the name if the static search fails. set( THIS_LIBRARY_SEARCH_DEBUG - lib${LIB}d.a lib${LIB}_debug.a ${LIB}d ${LIB}_debug - lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_debug-static ) - set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a ${LIB}-static) + lib${LIB}d.a lib${LIB}_debug.a lib${LIB}d lib${LIB}_D lib${LIB}_debug + lib${LIB}d-static.a lib${LIB}_debug-static.a lib${LIB}d-static lib${LIB}_D-static lib${LIB}_debug-static ) + set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a lib${LIB}-static) else() - set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_debug ${LIB}d-shared ${LIB}_debug-shared) + set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_D ${LIB}_debug ${LIB}d-shared ${LIB}_D-shared ${LIB}_debug-shared) set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared) endif() find_library(HDF5_${LIB}_LIBRARY_DEBUG @@ -786,6 +797,7 @@ if( NOT HDF5_FOUND ) set(HDF5_HL_FOUND True) endif() + _HDF5_remove_duplicates_from_beginning(HDF5_DEFINITIONS) _HDF5_remove_duplicates_from_beginning(HDF5_INCLUDE_DIRS) _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES) _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES) diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake index 5c2dbbf..3baaf32 100644 --- a/Modules/FindMFC.cmake +++ b/Modules/FindMFC.cmake @@ -31,6 +31,7 @@ if(MFC_ATTEMPT_TRY_COMPILE) configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) message(STATUS "Looking for MFC") + # Try both shared and static as the root project may have set the /MT flag try_compile(MFC_HAVE_MFC ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx @@ -38,6 +39,16 @@ if(MFC_ATTEMPT_TRY_COMPILE) -DCMAKE_MFC_FLAG:STRING=2 -DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL OUTPUT_VARIABLE OUTPUT) + if(NOT MFC_HAVE_MFC) + configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) + try_compile(MFC_HAVE_MFC + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx + CMAKE_FLAGS + -DCMAKE_MFC_FLAG:STRING=1 + OUTPUT_VARIABLE OUTPUT) + endif() if(MFC_HAVE_MFC) message(STATUS "Looking for MFC - found") set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?") diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index a5357fa..8ac1691 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -584,7 +584,9 @@ endmacro() macro(pkg_check_modules _prefix _module0) _pkgconfig_parse_options(_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN}) # check cached value - if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0};${ARGN}") + if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR + (NOT "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0};${ARGN}") OR + ( "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0}")) _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} "${_prefix}" ${_pkg_modules}) _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) diff --git a/Modules/Platform/Android/ndk-stl-c++_shared.cmake b/Modules/Platform/Android/ndk-stl-c++_shared.cmake index f585adb..3389408 100644 --- a/Modules/Platform/Android/ndk-stl-c++_shared.cmake +++ b/Modules/Platform/Android/ndk-stl-c++_shared.cmake @@ -1,4 +1,5 @@ include(Platform/Android/ndk-stl-c++) macro(__android_stl lang) __android_stl_cxx(${lang} libc++_shared.so) + __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libandroid_support.a" 0) endmacro() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2d86e33..6a45aec 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 9) -set(CMake_VERSION_PATCH 20170710) +set(CMake_VERSION_PATCH 20170713) #set(CMake_VERSION_RC 1) diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index cd1fb8a..e96226a 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -242,24 +242,26 @@ public: // Check whether it is "Scalar deleting destructor" and "Vector // deleting destructor" - // if scalarPrefix and vectorPrefix are not found then print the - // symbol + // if scalarPrefix and vectorPrefix are not found then print + // the symbol const char* scalarPrefix = "??_G"; const char* vectorPrefix = "??_E"; + // The original code had a check for + // symbol.find("real@") == std::string::npos) + // but this disallows member functions with the name "real". if (symbol.compare(0, 4, scalarPrefix) && symbol.compare(0, 4, vectorPrefix)) { SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1] .Characteristics; - // skip symbols containing a dot if (symbol.find('.') == std::string::npos) { - if (SectChar & IMAGE_SCN_MEM_EXECUTE) { - this->Symbols.insert(symbol); - } else if (SectChar & IMAGE_SCN_MEM_READ) { - // skip __real@ and __xmm@ - if (symbol.find("_real") == std::string::npos && - symbol.find("_xmm") == std::string::npos) { - this->DataSymbols.insert(symbol); + if (!pSymbolTable->Type && (SectChar & IMAGE_SCN_MEM_WRITE)) { + // Read only (i.e. constants) must be excluded + this->DataSymbols.insert(symbol); + } else { + if (pSymbolTable->Type || !(SectChar & IMAGE_SCN_MEM_READ) || + (SectChar & IMAGE_SCN_MEM_EXECUTE)) { + this->Symbols.insert(symbol); } } } diff --git a/Source/cmFileLockResult.cxx b/Source/cmFileLockResult.cxx index a040705..9ca5d8a 100644 --- a/Source/cmFileLockResult.cxx +++ b/Source/cmFileLockResult.cxx @@ -5,6 +5,7 @@ #include <errno.h> #include <string.h> +#define WINMSG_BUF_LEN (1024) cmFileLockResult cmFileLockResult::MakeOk() { return cmFileLockResult(OK, 0); @@ -53,18 +54,12 @@ std::string cmFileLockResult::GetOutputMessage() const case SYSTEM: #if defined(_WIN32) { - char* errorText = NULL; - - // http://stackoverflow.com/a/455533/2288008 - DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS; - ::FormatMessageA(flags, NULL, this->ErrorValue, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPSTR)&errorText, 0, NULL); - - if (errorText != NULL) { - const std::string message = errorText; - ::LocalFree(errorText); + char winmsg[WINMSG_BUF_LEN]; + DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS; + if (FormatMessageA(flags, NULL, this->ErrorValue, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)winmsg, WINMSG_BUF_LEN, NULL)) { + const std::string message = winmsg; return message; } else { return "Internal error (FormatMessageA failed)"; diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 581c401..e378208 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -216,6 +216,8 @@ void cmFindBase::FillPackageRootPath() paths.AddCMakePrefixPath(varName); paths.AddEnvPrefixPath(varName); } + + paths.AddSuffixes(this->SearchPathSuffixes); } void cmFindBase::FillCMakeVariablePath() diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 103e692..fd0e317 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -11,7 +11,7 @@ cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL"); cmFindCommon::PathLabel cmFindCommon::PathLabel::PackageRoot( - "PacakgeName_ROOT"); + "PackageName_ROOT"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMake("CMAKE"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeEnvironment( "CMAKE_ENVIRONMENT"); @@ -231,18 +231,6 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) } } -void cmFindCommon::FilterPaths(const std::vector<std::string>& inPaths, - const std::set<std::string>& ignore, - std::vector<std::string>& outPaths) -{ - for (std::vector<std::string>::const_iterator i = inPaths.begin(); - i != inPaths.end(); ++i) { - if (ignore.count(*i) == 0) { - outPaths.push_back(*i); - } - } -} - void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore) { // null-terminated list of paths. diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 2eed47b..7954267 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -81,11 +81,6 @@ protected: void GetIgnoredPaths(std::vector<std::string>& ignore); void GetIgnoredPaths(std::set<std::string>& ignore); - /** Remove paths in the ignore set from the supplied vector. */ - void FilterPaths(const std::vector<std::string>& inPaths, - const std::set<std::string>& ignore, - std::vector<std::string>& outPaths); - /** Compute final search path list (reroot + trailing slash). */ void ComputeFinalPaths(); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 65670e5..f291f9d 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -739,7 +739,8 @@ bool cmFindPackageCommand::HandlePackageMode() if (result && !found) { // warn if package required or neither quiet nor in config mode if (this->Required || - !(this->Quiet || (this->UseConfigFiles && !this->UseFindModules))) { + !(this->Quiet || (this->UseConfigFiles && !this->UseFindModules && + this->ConsideredConfigs.empty()))) { // The variable is not set. std::ostringstream e; std::ostringstream aw; diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index f067d8f..b155f5b 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -520,6 +520,7 @@ std::string cmGlobalVisualStudio7Generator::ConvertToSolutionPath( void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections( std::ostream& fout, cmLocalGenerator* root) { + std::string const guid = this->GetGUID(root->GetProjectName() + ".sln"); bool extensibilityGlobalsOverridden = false; bool extensibilityAddInsOverridden = false; const std::vector<std::string> propKeys = @@ -538,11 +539,14 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections( } else continue; if (!name.empty()) { - if (name == "ExtensibilityGlobals" && sectionType == "postSolution") + bool addGuid = false; + if (name == "ExtensibilityGlobals" && sectionType == "postSolution") { + addGuid = true; extensibilityGlobalsOverridden = true; - else if (name == "ExtensibilityAddIns" && - sectionType == "postSolution") + } else if (name == "ExtensibilityAddIns" && + sectionType == "postSolution") { extensibilityAddInsOverridden = true; + } fout << "\tGlobalSection(" << name << ") = " << sectionType << "\n"; std::vector<std::string> keyValuePairs; cmSystemTools::ExpandListArgument( @@ -557,15 +561,23 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections( const std::string value = cmSystemTools::TrimWhitespace(itPair->substr(posEqual + 1)); fout << "\t\t" << key << " = " << value << "\n"; + if (key == "SolutionGuid") { + addGuid = false; + } } } + if (addGuid) { + fout << "\t\tSolutionGuid = {" << guid << "}\n"; + } fout << "\tEndGlobalSection\n"; } } } - if (!extensibilityGlobalsOverridden) + if (!extensibilityGlobalsOverridden) { fout << "\tGlobalSection(ExtensibilityGlobals) = postSolution\n" + << "\t\tSolutionGuid = {" << guid << "}\n" << "\tEndGlobalSection\n"; + } if (!extensibilityAddInsOverridden) fout << "\tGlobalSection(ExtensibilityAddIns) = postSolution\n" << "\tEndGlobalSection\n"; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4a0cab3..fb956bc 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -66,8 +66,8 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, this->DefineFlags = " "; - this->cmDefineRegex.compile("#cmakedefine[ \t]+([A-Za-z_0-9]*)"); - this->cmDefine01Regex.compile("#cmakedefine01[ \t]+([A-Za-z_0-9]*)"); + this->cmDefineRegex.compile("#([ \t]*)cmakedefine[ \t]+([A-Za-z_0-9]*)"); + this->cmDefine01Regex.compile("#([ \t]*)cmakedefine01[ \t]+([A-Za-z_0-9]*)"); this->cmAtVarRegex.compile("(@[A-Za-z_0-9/.+-]+@)"); this->cmNamedCurly.compile("^[A-Za-z0-9/_.+-]+{"); @@ -87,12 +87,10 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, #if defined(CMAKE_BUILD_WITH_CMAKE) this->AddSourceGroup("", "^.*$"); - this->AddSourceGroup("Source Files", - "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp" - "|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$"); + this->AddSourceGroup("Source Files", CM_SOURCE_REGEX); this->AddSourceGroup("Header Files", CM_HEADER_REGEX); this->AddSourceGroup("CMake Rules", "\\.rule$"); - this->AddSourceGroup("Resources", "\\.plist$"); + this->AddSourceGroup("Resources", CM_RESOURCE_REGEX); this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$"); this->ObjectLibrariesSourceGroupIndex = this->SourceGroups.size(); @@ -3433,18 +3431,22 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, // Replace #cmakedefine instances. if (this->cmDefineRegex.find(line)) { - const char* def = this->GetDefinition(this->cmDefineRegex.match(1)); + const char* def = this->GetDefinition(this->cmDefineRegex.match(2)); if (!cmSystemTools::IsOff(def)) { - cmSystemTools::ReplaceString(line, "#cmakedefine", "#define"); + const std::string indentation = this->cmDefineRegex.match(1); + cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine", + "#" + indentation + "define"); output += line; } else { output += "/* #undef "; - output += this->cmDefineRegex.match(1); + output += this->cmDefineRegex.match(2); output += " */"; } } else if (this->cmDefine01Regex.find(line)) { - const char* def = this->GetDefinition(this->cmDefine01Regex.match(1)); - cmSystemTools::ReplaceString(line, "#cmakedefine01", "#define"); + const std::string indentation = this->cmDefine01Regex.match(1); + const char* def = this->GetDefinition(this->cmDefine01Regex.match(2)); + cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine01", + "#" + indentation + "define"); output += line; if (!cmSystemTools::IsOff(def)) { output += " 1"; diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 6924ba2..cecf165 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -303,6 +303,13 @@ static void AcquireScanFiles(cmGeneratorTarget const* target, !(fileType == cmSystemTools::HEADER_FILE_FORMAT)) { continue; } + if (PropertyEnabled(sf, "GENERATED") && + !target->GetPropertyAsBool("__UNDOCUMENTED_AUTOGEN_GENERATED_FILES")) { + // FIXME: Add a policy whose NEW behavior allows generated files. + // The implementation already works. We disable it here to avoid + // changing behavior for existing projects that do not expect it. + continue; + } const std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath()); // Skip flags diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 948ac44..feec735 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -973,17 +973,19 @@ bool cmQtAutoGenerators::MocParseSourceContent( const std::string headerToMoc = this->MocFindHeader(scannedFileAbsPath, incSubDir + incRealBasename); if (!headerToMoc.empty()) { - // Register moc job - mocsIncluded[headerToMoc] = incString; - this->MocFindDepends(headerToMoc, contentText, mocDepends); - // Store meta information for relaxed mode - if (relaxed && (incRealBasename == scannedFileBasename)) { - ownMocUnderscoreInclude = incString; - ownMocUnderscoreHeader = headerToMoc; + if (!this->MocSkip(headerToMoc)) { + // Register moc job + mocsIncluded[headerToMoc] = incString; + this->MocFindDepends(headerToMoc, contentText, mocDepends); + // Store meta information for relaxed mode + if (relaxed && (incRealBasename == scannedFileBasename)) { + ownMocUnderscoreInclude = incString; + ownMocUnderscoreHeader = headerToMoc; + } } } else { std::ostringstream ost; - ost << "AutoMoc: Error: " << absFilename << "\n" + ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n" << "The file includes the moc file " << Quoted(incString) << ", but could not find header " << Quoted(incRealBasename + "{" + @@ -1005,36 +1007,39 @@ bool cmQtAutoGenerators::MocParseSourceContent( // In relaxed mode try to find a header instead but issue a warning const std::string headerToMoc = this->MocFindHeader(scannedFileAbsPath, incSubDir + incBasename); - if (!headerToMoc.empty() && !this->MocSkip(headerToMoc)) { - // This is for KDE4 compatibility: - fileToMoc = headerToMoc; - if (!requiresMoc && (incBasename == scannedFileBasename)) { - std::ostringstream ost; - ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n" + if (!headerToMoc.empty()) { + if (!this->MocSkip(headerToMoc)) { + // This is for KDE4 compatibility: + fileToMoc = headerToMoc; + if (!requiresMoc && (incBasename == scannedFileBasename)) { + std::ostringstream ost; + ost + << "AutoMoc: Warning: " << Quoted(absFilename) << "\n" << "The file includes the moc file " << Quoted(incString) << ", but does not contain a Q_OBJECT or Q_GADGET macro.\n" << "Running moc on " << Quoted(headerToMoc) << "!\n" << "Include " << Quoted("moc_" + incBasename + ".cpp") << " for a compatibility with strict mode (see " "CMAKE_AUTOMOC_RELAXED_MODE).\n"; - this->LogWarning(ost.str()); - } else { - std::ostringstream ost; - ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n" - << "The file includes the moc file " << Quoted(incString) - << " instead of " << Quoted("moc_" + incBasename + ".cpp") - << ".\n" - << "Running moc on " << Quoted(headerToMoc) << "!\n" - << "Include " << Quoted("moc_" + incBasename + ".cpp") - << " for compatibility with strict mode (see " - "CMAKE_AUTOMOC_RELAXED_MODE).\n"; - this->LogWarning(ost.str()); + this->LogWarning(ost.str()); + } else { + std::ostringstream ost; + ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n" + << "The file includes the moc file " << Quoted(incString) + << " instead of " + << Quoted("moc_" + incBasename + ".cpp") << ".\n" + << "Running moc on " << Quoted(headerToMoc) << "!\n" + << "Include " << Quoted("moc_" + incBasename + ".cpp") + << " for compatibility with strict mode (see " + "CMAKE_AUTOMOC_RELAXED_MODE).\n"; + this->LogWarning(ost.str()); + } } } else { std::ostringstream ost; ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n" << "The file includes the moc file " << Quoted(incString) - << ". which seems to be the moc file from a different " + << ", which seems to be the moc file from a different " "source file. CMake also could not find a matching " "header."; this->LogError(ost.str()); @@ -1050,7 +1055,7 @@ bool cmQtAutoGenerators::MocParseSourceContent( // Accept but issue a warning if moc isn't required if (!requiresMoc) { std::ostringstream ost; - ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n" + ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n" << "The file includes the moc file " << Quoted(incString) << ", but does not contain a Q_OBJECT or Q_GADGET " "macro."; diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index 7fc6ed7..5283dfc 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -36,7 +36,7 @@ cmServer::cmServer(cmServerConnection* conn, bool supportExperimental) { this->Connection->SetServer(this); // Register supported protocols: - this->RegisterProtocol(new cmServerProtocol1_0); + this->RegisterProtocol(new cmServerProtocol1); } cmServer::~cmServer() diff --git a/Source/cmServerDictionary.h b/Source/cmServerDictionary.h index e6a7ae6..405ff6b 100644 --- a/Source/cmServerDictionary.h +++ b/Source/cmServerDictionary.h @@ -89,6 +89,11 @@ static const std::string kWARN_UNUSED_KEY = "warnUnused"; static const std::string kWATCHED_DIRECTORIES_KEY = "watchedDirectories"; static const std::string kWATCHED_FILES_KEY = "watchedFiles"; +static const std::string kTARGET_CROSS_REFERENCES_KEY = "crossReferences"; +static const std::string kLINE_NUMBER_KEY = "line"; +static const std::string kBACKTRACE_KEY = "backtrace"; +static const std::string kRELATED_STATEMENTS_KEY = "relatedStatements"; + static const std::string kSTART_MAGIC = "[== \"CMake Server\" ==["; static const std::string kEND_MAGIC = "]== \"CMake Server\" ==]"; diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index defba77..21b69cf 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -2,12 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmServerProtocol.h" +#include "cmAlgorithms.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmFileMonitor.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLinkLineComputer.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmServer.h" @@ -18,6 +20,7 @@ #include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTarget.h" #include "cm_uv.h" #include "cmake.h" @@ -247,9 +250,9 @@ bool cmServerProtocol::DoActivate(const cmServerRequest& /*request*/, return true; } -std::pair<int, int> cmServerProtocol1_0::ProtocolVersion() const +std::pair<int, int> cmServerProtocol1::ProtocolVersion() const { - return std::make_pair(1, 0); + return std::make_pair(1, 1); } static void setErrorMessage(std::string* errorMessage, const std::string& text) @@ -297,8 +300,8 @@ static bool testValue(cmState* state, const std::string& key, return true; } -bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request, - std::string* errorMessage) +bool cmServerProtocol1::DoActivate(const cmServerRequest& request, + std::string* errorMessage) { std::string sourceDirectory = request.Data[kSOURCE_DIRECTORY_KEY].asString(); const std::string buildDirectory = @@ -417,8 +420,8 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request, return true; } -void cmServerProtocol1_0::HandleCMakeFileChanges(const std::string& path, - int event, int status) +void cmServerProtocol1::HandleCMakeFileChanges(const std::string& path, + int event, int status) { assert(status == 0); static_cast<void>(status); @@ -441,7 +444,7 @@ void cmServerProtocol1_0::HandleCMakeFileChanges(const std::string& path, SendSignal(kFILE_CHANGE_SIGNAL, obj); } -const cmServerResponse cmServerProtocol1_0::Process( +const cmServerResponse cmServerProtocol1::Process( const cmServerRequest& request) { assert(this->m_State >= STATE_ACTIVE); @@ -474,12 +477,12 @@ const cmServerResponse cmServerProtocol1_0::Process( return request.ReportError("Unknown command!"); } -bool cmServerProtocol1_0::IsExperimental() const +bool cmServerProtocol1::IsExperimental() const { return true; } -cmServerResponse cmServerProtocol1_0::ProcessCache( +cmServerResponse cmServerProtocol1::ProcessCache( const cmServerRequest& request) { if (this->m_State < STATE_CONFIGURED) { @@ -528,7 +531,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCache( return request.Reply(result); } -cmServerResponse cmServerProtocol1_0::ProcessCMakeInputs( +cmServerResponse cmServerProtocol1::ProcessCMakeInputs( const cmServerRequest& request) { if (this->m_State < STATE_CONFIGURED) { @@ -729,6 +732,37 @@ static Json::Value DumpSourceFilesList( return result; } +static Json::Value DumpBacktrace(const cmListFileBacktrace& backtrace) +{ + Json::Value result = Json::arrayValue; + + cmListFileBacktrace backtraceCopy = backtrace; + while (!backtraceCopy.Top().FilePath.empty()) { + Json::Value entry = Json::objectValue; + entry[kPATH_KEY] = backtraceCopy.Top().FilePath; + if (backtraceCopy.Top().Line) { + entry[kLINE_NUMBER_KEY] = (int)backtraceCopy.Top().Line; + } + if (!backtraceCopy.Top().Name.empty()) { + entry[kNAME_KEY] = backtraceCopy.Top().Name; + } + result.append(std::move(entry)); + backtraceCopy = backtraceCopy.Pop(); + } + return result; +} + +static void DumpBacktraceRange(Json::Value& result, const std::string& type, + const cmBacktraceRange& range) +{ + for (const auto& bt : range) { + Json::Value obj = Json::objectValue; + obj[kTYPE_KEY] = type; + obj[kBACKTRACE_KEY] = DumpBacktrace(bt); + result.append(obj); + } +} + static Json::Value DumpTarget(cmGeneratorTarget* target, const std::string& config) { @@ -763,6 +797,22 @@ static Json::Value DumpTarget(cmGeneratorTarget* target, result[kFULL_NAME_KEY] = target->GetFullName(config); + Json::Value crossRefs = Json::objectValue; + crossRefs[kBACKTRACE_KEY] = DumpBacktrace(target->Target->GetBacktrace()); + + Json::Value statements = Json::arrayValue; + DumpBacktraceRange(statements, "target_compile_definitions", + target->Target->GetCompileDefinitionsBacktraces()); + DumpBacktraceRange(statements, "target_include_directories", + target->Target->GetIncludeDirectoriesBacktraces()); + DumpBacktraceRange(statements, "target_compile_options", + target->Target->GetCompileOptionsBacktraces()); + DumpBacktraceRange(statements, "target_link_libraries", + target->Target->GetLinkImplementationBacktraces()); + + crossRefs[kRELATED_STATEMENTS_KEY] = std::move(statements); + result[kTARGET_CROSS_REFERENCES_KEY] = std::move(crossRefs); + if (target->HaveWellDefinedOutputFiles()) { Json::Value artifacts = Json::arrayValue; artifacts.append( @@ -915,7 +965,7 @@ static Json::Value DumpConfigurationsList(const cmake* cm) return result; } -cmServerResponse cmServerProtocol1_0::ProcessCodeModel( +cmServerResponse cmServerProtocol1::ProcessCodeModel( const cmServerRequest& request) { if (this->m_State != STATE_COMPUTED) { @@ -927,7 +977,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCodeModel( return request.Reply(result); } -cmServerResponse cmServerProtocol1_0::ProcessCompute( +cmServerResponse cmServerProtocol1::ProcessCompute( const cmServerRequest& request) { if (this->m_State > STATE_CONFIGURED) { @@ -947,7 +997,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCompute( return request.Reply(Json::Value()); } -cmServerResponse cmServerProtocol1_0::ProcessConfigure( +cmServerResponse cmServerProtocol1::ProcessConfigure( const cmServerRequest& request) { if (this->m_State == STATE_INACTIVE) { @@ -1053,7 +1103,7 @@ cmServerResponse cmServerProtocol1_0::ProcessConfigure( return request.Reply(Json::Value()); } -cmServerResponse cmServerProtocol1_0::ProcessGlobalSettings( +cmServerResponse cmServerProtocol1::ProcessGlobalSettings( const cmServerRequest& request) { cmake* cm = this->CMakeInstance(); @@ -1089,7 +1139,7 @@ static void setBool(const cmServerRequest& request, const std::string& key, setter(request.Data[key].asBool()); } -cmServerResponse cmServerProtocol1_0::ProcessSetGlobalSettings( +cmServerResponse cmServerProtocol1::ProcessSetGlobalSettings( const cmServerRequest& request) { const std::vector<std::string> boolValues = { @@ -1121,7 +1171,7 @@ cmServerResponse cmServerProtocol1_0::ProcessSetGlobalSettings( return request.Reply(Json::Value()); } -cmServerResponse cmServerProtocol1_0::ProcessFileSystemWatchers( +cmServerResponse cmServerProtocol1::ProcessFileSystemWatchers( const cmServerRequest& request) { const cmFileMonitor* const fm = FileMonitor(); @@ -1140,7 +1190,7 @@ cmServerResponse cmServerProtocol1_0::ProcessFileSystemWatchers( return request.Reply(result); } -cmServerProtocol1_0::GeneratorInformation::GeneratorInformation( +cmServerProtocol1::GeneratorInformation::GeneratorInformation( const std::string& generatorName, const std::string& extraGeneratorName, const std::string& toolset, const std::string& platform, const std::string& sourceDirectory, const std::string& buildDirectory) @@ -1153,7 +1203,7 @@ cmServerProtocol1_0::GeneratorInformation::GeneratorInformation( { } -void cmServerProtocol1_0::GeneratorInformation::SetupGenerator( +void cmServerProtocol1::GeneratorInformation::SetupGenerator( cmake* cm, std::string* errorMessage) { const std::string fullGeneratorName = diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h index 83b3d58..4e57bb6 100644 --- a/Source/cmServerProtocol.h +++ b/Source/cmServerProtocol.h @@ -98,7 +98,7 @@ private: friend class cmServer; }; -class cmServerProtocol1_0 : public cmServerProtocol +class cmServerProtocol1 : public cmServerProtocol { public: std::pair<int, int> ProtocolVersion() const override; diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 0be659c..e739d18 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -120,4 +120,10 @@ private: // TODO: Factor out into platform information modules. #define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$" +#define CM_SOURCE_REGEX \ + "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|hpj" \ + "|bat)$" + +#define CM_RESOURCE_REGEX "\\.(pdf|plist|png|jpeg|jpg|storyboard|xcassets)$" + #endif diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index c2ff664..7168f26 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -1,6 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmVSSetupHelper.h" +#include "cmSystemTools.h" #ifndef VSSetupConstants #define VSSetupConstants @@ -240,6 +241,22 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() setupHelper == NULL) return false; + std::string envVSCommonToolsDir; + + // FIXME: When we support VS versions beyond 2017, the version + // to choose will be passed in by the caller. We need to map that + // to a per-version name of this environment variable. + if (cmSystemTools::GetEnv("VS150COMNTOOLS", envVSCommonToolsDir)) { + cmSystemTools::ConvertToUnixSlashes(envVSCommonToolsDir); + } + // FIXME: If the environment variable value changes between runs + // of CMake within a given build tree the results are not defined. + // Instead we should save a CMAKE_GENERATOR_INSTANCE value in the cache + // (similar to CMAKE_GENERATOR_TOOLSET) to hold it persistently. + // Unfortunately doing so will require refactoring elsewhere in + // order to make sure the value is available in time to create + // the generator. + std::vector<VSInstanceInfo> vecVSInstances; SmartCOMPtr<IEnumSetupInstances> enumInstances = NULL; if (FAILED( @@ -263,6 +280,17 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() instance = instance2 = NULL; if (isInstalled) { + if (!envVSCommonToolsDir.empty()) { + std::string currentVSLocation(instanceInfo.VSInstallLocation.begin(), + instanceInfo.VSInstallLocation.end()); + cmSystemTools::ConvertToUnixSlashes(currentVSLocation); + currentVSLocation += "/Common7/Tools"; + if (cmSystemTools::ComparePath(currentVSLocation, + envVSCommonToolsDir)) { + chosenInstanceInfo = instanceInfo; + return true; + } + } vecVSInstances.push_back(instanceInfo); } } diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 075faa7..8537cd9 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -356,6 +356,8 @@ endwhile() set(SHOULD_BE_ZERO ) set(SHOULD_BE_ONE 1) +set(SHOULD_BE_ZERO_AND_INDENTED ) +set(SHOULD_BE_ONE_AND_INDENTED 1) # test elseif functionality, the mess below tries to catch problem # of clauses being executed early or late etc diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 3b09229..ca39870 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -261,6 +261,12 @@ int main() cmPassed("ONE_VAR is defined."); #endif +#ifndef ONE_VAR_AND_INDENTED + cmFailed("cmakedefine is broken, ONE_VAR_AND_INDENTED is not defined."); +#else + cmPassed("ONE_VAR_AND_INDENTED is defined."); +#endif + #ifndef ONE_VAR_IS_DEFINED cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, " "ONE_VAR_IS_DEFINED is not defined."); @@ -274,6 +280,12 @@ int main() cmPassed("ZERO_VAR is not defined."); #endif +#ifdef ZERO_VAR_AND_INDENTED + cmFailed("cmakedefine is broken, ZERO_VAR_AND_INDENTED is defined."); +#else + cmPassed("ZERO_VAR_AND_INDENTED is not defined."); +#endif + #ifndef STRING_VAR cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined."); #else @@ -1030,6 +1042,16 @@ int main() } else { cmFailed("cmakedefine01 is not working for 1"); } + if (SHOULD_BE_ZERO_AND_INDENTED == 0) { + cmPassed("cmakedefine01 is working for 0 and indented"); + } else { + cmFailed("cmakedefine01 is not working for 0 and indented"); + } + if (SHOULD_BE_ONE_AND_INDENTED == 1) { + cmPassed("cmakedefine01 is working for 1 and indented"); + } else { + cmFailed("cmakedefine01 is not working for 1 and indented"); + } #ifdef FORCE_TEST cmFailed("CMake SET CACHE FORCE"); #else diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake index 8be59be..9761986 100644 --- a/Tests/Complex/VarTests.cmake +++ b/Tests/Complex/VarTests.cmake @@ -2,6 +2,7 @@ # Test SET # set (ZERO_VAR 0) +set (ZERO_VAR_AND_INDENTED 0) set (ZERO_VAR2 0) if(ZERO_VAR) @@ -11,6 +12,7 @@ else() endif() set(ONE_VAR 1) +set(ONE_VAR_AND_INDENTED 1) set(ONE_VAR2 1) set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index d7424b1..72317bc 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -1,8 +1,10 @@ // Test SET, VARIABLE_REQUIRES #cmakedefine ONE_VAR +# cmakedefine ONE_VAR_AND_INDENTED #cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ZERO_VAR +# cmakedefine ZERO_VAR_AND_INDENTED #define STRING_VAR "${STRING_VAR}" @@ -32,6 +34,8 @@ #cmakedefine01 SHOULD_BE_ZERO #cmakedefine01 SHOULD_BE_ONE +# cmakedefine01 SHOULD_BE_ZERO_AND_INDENTED +# cmakedefine01 SHOULD_BE_ONE_AND_INDENTED // Needed to check for files #define BINARY_DIR "${Complex_BINARY_DIR}" diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 1b833b2..4cd0bae 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -313,6 +313,8 @@ endwhile() set(SHOULD_BE_ZERO ) set(SHOULD_BE_ONE 1) +set(SHOULD_BE_ZERO_AND_INDENTED ) +set(SHOULD_BE_ONE_AND_INDENTED 1) # test elseif functionality, the mess below tries to catch problem # of clauses being executed early or late etc diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 9e4eaad..9b94962 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -261,6 +261,12 @@ int main() cmPassed("ONE_VAR is defined."); #endif +#ifndef ONE_VAR_AND_INDENTED + cmFailed("cmakedefine is broken, ONE_VAR_AND_INDENTED is not defined."); +#else + cmPassed("ONE_VAR_AND_INDENTED is defined."); +#endif + #ifndef ONE_VAR_IS_DEFINED cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, " "ONE_VAR_IS_DEFINED is not defined."); @@ -274,6 +280,12 @@ int main() cmPassed("ZERO_VAR is not defined."); #endif +#ifdef ZERO_VAR_AND_INDENTED + cmFailed("cmakedefine is broken, ZERO_VAR_AND_INDENTED is defined."); +#else + cmPassed("ZERO_VAR_AND_INDENTED is not defined."); +#endif + #ifndef STRING_VAR cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined."); #else @@ -1030,6 +1042,16 @@ int main() } else { cmFailed("cmakedefine01 is not working for 1"); } + if (SHOULD_BE_ZERO_AND_INDENTED == 0) { + cmPassed("cmakedefine01 is working for 0 and indented"); + } else { + cmFailed("cmakedefine01 is not working for 0 and indented"); + } + if (SHOULD_BE_ONE_AND_INDENTED == 1) { + cmPassed("cmakedefine01 is working for 1 and indented"); + } else { + cmFailed("cmakedefine01 is not working for 1 and indented"); + } #ifdef FORCE_TEST cmFailed("CMake SET CACHE FORCE"); #else diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index 7dd8519..42afd19 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/VarTests.cmake @@ -2,6 +2,7 @@ # Test SET # set (ZERO_VAR 0) +set (ZERO_VAR_AND_INDENTED 0) set (ZERO_VAR2 0) if(ZERO_VAR) @@ -11,6 +12,7 @@ else() endif() set(ONE_VAR 1) +set(ONE_VAR_AND_INDENTED 1) set(ONE_VAR2 1) set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index d7424b1..72317bc 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -1,8 +1,10 @@ // Test SET, VARIABLE_REQUIRES #cmakedefine ONE_VAR +# cmakedefine ONE_VAR_AND_INDENTED #cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ZERO_VAR +# cmakedefine ZERO_VAR_AND_INDENTED #define STRING_VAR "${STRING_VAR}" @@ -32,6 +34,8 @@ #cmakedefine01 SHOULD_BE_ZERO #cmakedefine01 SHOULD_BE_ONE +# cmakedefine01 SHOULD_BE_ZERO_AND_INDENTED +# cmakedefine01 SHOULD_BE_ONE_AND_INDENTED // Needed to check for files #define BINARY_DIR "${Complex_BINARY_DIR}" diff --git a/Tests/MFC/CMakeLists.txt.in b/Tests/MFC/CMakeLists.txt.in index e6bfabd..bf98e91 100644 --- a/Tests/MFC/CMakeLists.txt.in +++ b/Tests/MFC/CMakeLists.txt.in @@ -45,6 +45,11 @@ set(files set(CMAKE_MFC_FLAG "@CMAKE_MFC_FLAG_VALUE@") +FIND_PACKAGE(MFC) +IF (NOT MFC_FOUND) + MESSAGE(FATAL_ERROR "MFC Could not be found during the MFC test") +ENDIF() + if("${CMAKE_MFC_FLAG}" STREQUAL "1") msvc_link_to_static_crt() else() diff --git a/Tests/QtAutogen/mocDepends/CMakeLists.txt b/Tests/QtAutogen/mocDepends/CMakeLists.txt index 8bd72eb..a67dcfe 100644 --- a/Tests/QtAutogen/mocDepends/CMakeLists.txt +++ b/Tests/QtAutogen/mocDepends/CMakeLists.txt @@ -28,6 +28,7 @@ add_executable(mocDepends1 test1.cpp ) target_link_libraries(mocDepends1 ${QT_CORE_TARGET}) set_target_properties(mocDepends1 PROPERTIES AUTOMOC TRUE) +set_property(TARGET mocDepends1 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1) # -- Test 2 using generated library # This tests the dependency of AUTOMOC of mocDepends2 to the @@ -43,3 +44,4 @@ add_library(SimpleLib STATIC simpleLib.hpp simpleLib.cpp) add_executable(mocDepends2 test2.cpp ) target_link_libraries(mocDepends2 SimpleLib ${QT_CORE_TARGET}) set_target_properties(mocDepends2 PROPERTIES AUTOMOC TRUE) +set_property(TARGET mocDepends2 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1) diff --git a/Tests/QtAutogen/mocRerun/CMakeLists.txt b/Tests/QtAutogen/mocRerun/CMakeLists.txt index 69ea8d7..14b077b 100644 --- a/Tests/QtAutogen/mocRerun/CMakeLists.txt +++ b/Tests/QtAutogen/mocRerun/CMakeLists.txt @@ -27,6 +27,7 @@ add_executable(mocRerun ${CMAKE_CURRENT_BINARY_DIR}/main.cpp res1.qrc ) +set_property(TARGET mocRerun PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1) target_include_directories(mocRerun PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(mocRerun ${QT_CORE_TARGET}) # Write target name to text file diff --git a/Tests/RunCMake/AutoExportDll/foo.c b/Tests/RunCMake/AutoExportDll/foo.c index e70fbb5..4b1318b 100644 --- a/Tests/RunCMake/AutoExportDll/foo.c +++ b/Tests/RunCMake/AutoExportDll/foo.c @@ -13,5 +13,3 @@ int bar() { return 5; } - -const char testconst[] = "testconst"; diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx index eb9c0ff..51060e8 100644 --- a/Tests/RunCMake/AutoExportDll/say.cxx +++ b/Tests/RunCMake/AutoExportDll/say.cxx @@ -13,14 +13,6 @@ int WINAPI foo(); int bar(); int objlib(); void justnop(); - -// test const export -#ifdef _WIN32 -// data symbols must be explicitly imported -__declspec(dllimport) extern const char testconst[]; -#else -extern const char testconst[]; -#endif } // test c++ functions @@ -51,8 +43,6 @@ int main() bar(); objlib(); printf("\n"); - printf("%s", testconst); - printf("\n"); #ifdef HAS_JUSTNOP justnop(); #endif diff --git a/Tests/RunCMake/VSSolution/MorePost-check.cmake b/Tests/RunCMake/VSSolution/MorePost-check.cmake index 0f7e370..d239b28 100644 --- a/Tests/RunCMake/VSSolution/MorePost-check.cmake +++ b/Tests/RunCMake/VSSolution/MorePost-check.cmake @@ -1,5 +1,5 @@ parseGlobalSections(pre post MorePost) testGlobalSection(post TestSec2 Key1=Value1 "Key2=Value with spaces") testGlobalSection(post TestSec4 Key6=Value1 "Key7=Value with spaces" Key8=ValueWithoutSpaces) -testGlobalSection(post ExtensibilityGlobals) +testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}") testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/VSSolution/MorePre-check.cmake b/Tests/RunCMake/VSSolution/MorePre-check.cmake index 45e7419..89b3c7e 100644 --- a/Tests/RunCMake/VSSolution/MorePre-check.cmake +++ b/Tests/RunCMake/VSSolution/MorePre-check.cmake @@ -1,5 +1,5 @@ parseGlobalSections(pre post MorePre) testGlobalSection(pre TestSec1 Key1=Value1 "Key2=Value with spaces") testGlobalSection(pre TestSec3 Key3=Value1 "Key4=Value with spaces" Key5=ValueWithoutSpaces) -testGlobalSection(post ExtensibilityGlobals) +testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}") testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/VSSolution/OnePost-check.cmake b/Tests/RunCMake/VSSolution/OnePost-check.cmake index 6af5156..f7d3712 100644 --- a/Tests/RunCMake/VSSolution/OnePost-check.cmake +++ b/Tests/RunCMake/VSSolution/OnePost-check.cmake @@ -1,4 +1,4 @@ parseGlobalSections(pre post OnePost) testGlobalSection(post TestSec2 Key1=Value1 "Key2=Value with spaces") -testGlobalSection(post ExtensibilityGlobals) +testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}") testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/VSSolution/OnePre-check.cmake b/Tests/RunCMake/VSSolution/OnePre-check.cmake index 70b18b2..c5db139 100644 --- a/Tests/RunCMake/VSSolution/OnePre-check.cmake +++ b/Tests/RunCMake/VSSolution/OnePre-check.cmake @@ -1,4 +1,4 @@ parseGlobalSections(pre post OnePre) testGlobalSection(pre TestSec1 Key1=Value1 "Key2=Value with spaces") -testGlobalSection(post ExtensibilityGlobals) +testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}") testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/VSSolution/Override1-check.cmake b/Tests/RunCMake/VSSolution/Override1-check.cmake index a19e2e1..5905204 100644 --- a/Tests/RunCMake/VSSolution/Override1-check.cmake +++ b/Tests/RunCMake/VSSolution/Override1-check.cmake @@ -1,4 +1,4 @@ parseGlobalSections(pre post Override1) testGlobalSection(post TestSec Key2=Value2 Key3=Value3) -testGlobalSection(post ExtensibilityGlobals Key1=Value1) +testGlobalSection(post ExtensibilityGlobals Key1=Value1 "SolutionGuid={00000000-0000-0000-0000-000000000000}") testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/VSSolution/Override2-check.cmake b/Tests/RunCMake/VSSolution/Override2-check.cmake index d9656e1..c981ec0 100644 --- a/Tests/RunCMake/VSSolution/Override2-check.cmake +++ b/Tests/RunCMake/VSSolution/Override2-check.cmake @@ -1,4 +1,4 @@ parseGlobalSections(pre post Override2) testGlobalSection(pre TestSec Key2=Value2 Key3=Value3) -testGlobalSection(post ExtensibilityGlobals) +testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}") testGlobalSection(post ExtensibilityAddIns Key1=Value1) diff --git a/Tests/RunCMake/VSSolution/Override3-check.cmake b/Tests/RunCMake/VSSolution/Override3-check.cmake new file mode 100644 index 0000000..baee9ed --- /dev/null +++ b/Tests/RunCMake/VSSolution/Override3-check.cmake @@ -0,0 +1,3 @@ +parseGlobalSections(pre post Override3) +testGlobalSection(post ExtensibilityGlobals Key1=Value1 "SolutionGuid={custom-guid}") +testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/VSSolution/Override3.cmake b/Tests/RunCMake/VSSolution/Override3.cmake new file mode 100644 index 0000000..a59ce19 --- /dev/null +++ b/Tests/RunCMake/VSSolution/Override3.cmake @@ -0,0 +1,4 @@ +set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_ExtensibilityGlobals + Key1=Value1 + SolutionGuid={custom-guid} + ) diff --git a/Tests/RunCMake/VSSolution/PrePost-check.cmake b/Tests/RunCMake/VSSolution/PrePost-check.cmake index 322a689..957c964 100644 --- a/Tests/RunCMake/VSSolution/PrePost-check.cmake +++ b/Tests/RunCMake/VSSolution/PrePost-check.cmake @@ -2,5 +2,5 @@ parseGlobalSections(pre post PrePost) testGlobalSection(post Postsec Key1=Value2) testGlobalSection(pre Presec Key1=Value1 "Key2=Value with some spaces") testGlobalSection(post Emptysec) -testGlobalSection(post ExtensibilityGlobals) +testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}") testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake index 3a04db4..c25833d 100644 --- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake +++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake @@ -8,6 +8,7 @@ run_cmake(MorePost) run_cmake(PrePost) run_cmake(Override1) run_cmake(Override2) +run_cmake(Override3) run_cmake(StartupProject) run_cmake(StartupProjectMissing) run_cmake(AddPackageToDefault) diff --git a/Tests/RunCMake/VSSolution/solution_parsing.cmake b/Tests/RunCMake/VSSolution/solution_parsing.cmake index 4e5bb59..4b27550 100644 --- a/Tests/RunCMake/VSSolution/solution_parsing.cmake +++ b/Tests/RunCMake/VSSolution/solution_parsing.cmake @@ -44,6 +44,9 @@ macro(parseGlobalSections arg_out_pre arg_out_post testName) endif() string(STRIP "${CMAKE_MATCH_1}" key) string(STRIP "${CMAKE_MATCH_2}" value) + if(key STREQUAL "SolutionGuid" AND value MATCHES "^{[0-9A-F-]+}$") + set(value "{00000000-0000-0000-0000-000000000000}") + endif() list(APPEND ${out_${sectionType}}_${sectionName} "${key}=${value}") endif() endforeach() diff --git a/Tests/RunCMake/find_package/PackageRoot-stderr.txt b/Tests/RunCMake/find_package/PackageRoot-stderr.txt index 07b27bd..409fa89 100644 --- a/Tests/RunCMake/find_package/PackageRoot-stderr.txt +++ b/Tests/RunCMake/find_package/PackageRoot-stderr.txt @@ -1,7 +1,9 @@ Foo_ROOT : ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_FILE_ZOT :FOO_TEST_FILE_ZOT-NOTFOUND FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PATH_ZOT :FOO_TEST_PATH_ZOT-NOTFOUND FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND Foo_ROOT : @@ -13,15 +15,19 @@ FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND BAR_TEST_FILE_BAR :BAR_TEST_FILE_BAR-NOTFOUND +BAR_TEST_FILE_ZOT :BAR_TEST_FILE_ZOT-NOTFOUND BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND BAR_TEST_PATH_BAR :BAR_TEST_PATH_BAR-NOTFOUND +BAR_TEST_PATH_ZOT :BAR_TEST_PATH_ZOT-NOTFOUND BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND BAR_TEST_PROG_BAR :BAR_TEST_PROG_BAR-NOTFOUND Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -33,15 +39,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe Foo_ROOT : ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe Foo_ROOT : @@ -53,15 +63,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/foo/env_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/foo/env_root/bin/bar.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -73,15 +87,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe Foo_ROOT : ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND Foo_ROOT : @@ -93,15 +111,19 @@ FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe Foo_ROOT : ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND Foo_ROOT : @@ -113,15 +135,19 @@ FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe Foo_ROOT : ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND Foo_ROOT : @@ -133,15 +159,19 @@ FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -153,15 +183,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe Foo_ROOT : ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe Foo_ROOT : @@ -173,15 +207,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -193,15 +231,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -213,15 +255,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe Foo_ROOT : ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe Foo_ROOT : @@ -233,15 +279,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -253,15 +303,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} : FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -273,15 +327,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe Foo_ROOT : ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe Foo_ROOT : @@ -293,15 +351,19 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe Foo_ROOT :.*/PackageRoot/foo/cmake_root @@ -313,7 +375,9 @@ FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot.cmake b/Tests/RunCMake/find_package/PackageRoot.cmake index d9f41f8..421c243 100644 --- a/Tests/RunCMake/find_package/PackageRoot.cmake +++ b/Tests/RunCMake/find_package/PackageRoot.cmake @@ -37,7 +37,9 @@ macro(RunPackageRootTest) message("Foo_ROOT :${Foo_ROOT}") message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") + message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}") message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") + message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}") message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") CleanUpPackageRootTest() message("") @@ -57,8 +59,10 @@ macro(RunPackageRootTest) message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}") message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}") + message("BAR_TEST_FILE_ZOT :${BAR_TEST_FILE_ZOT}") message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}") message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}") + message("BAR_TEST_PATH_ZOT :${BAR_TEST_PATH_ZOT}") message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}") message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}") CleanUpPackageRootTest() diff --git a/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake index eefa49c..72774a7 100644 --- a/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake +++ b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake @@ -1,6 +1,8 @@ find_file(BAR_TEST_FILE_FOO foo.h) find_file(BAR_TEST_FILE_BAR bar.h) +find_file(BAR_TEST_FILE_ZOT zot.h PATH_SUFFIXES zot) find_path(BAR_TEST_PATH_FOO foo.h) find_path(BAR_TEST_PATH_BAR bar.h) +find_path(BAR_TEST_PATH_ZOT zot.h PATH_SUFFIXES zot) find_program(BAR_TEST_PROG_FOO foo.exe) find_program(BAR_TEST_PROG_BAR bar.exe) diff --git a/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake index cb62390..e160a1d 100644 --- a/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake +++ b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake @@ -1,5 +1,7 @@ find_file(FOO_TEST_FILE_FOO foo.h) +find_file(FOO_TEST_FILE_ZOT zot.h PATH_SUFFIXES zot) find_path(FOO_TEST_PATH_FOO foo.h) +find_path(FOO_TEST_PATH_ZOT zot.h PATH_SUFFIXES zot) find_program(FOO_TEST_PROG_FOO foo.exe) if ("Bar" IN_LIST Foo_FIND_COMPONENTS) diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/zot/zot.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/zot/zot.h diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/zot/zot.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/zot/zot.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/zot/zot.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/zot/zot.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/zot/zot.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/zot/zot.h diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 72f9c4d..7875db6 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -17,3 +17,5 @@ run_cmake(PackageRoot) run_cmake(PolicyPush) run_cmake(PolicyPop) run_cmake(SetFoundFALSE) +run_cmake(WrongVersion) +run_cmake(WrongVersionConfig) diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt new file mode 100644 index 0000000..695f645 --- /dev/null +++ b/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt @@ -0,0 +1,9 @@ +CMake Warning at SetFoundFALSE.cmake:2 \(find_package\): + Found package configuration file: + + .*/Tests/RunCMake/find_package/SetFoundFALSEConfig.cmake + + but it set SetFoundFALSE_FOUND to FALSE so package "SetFoundFALSE" is + considered to be NOT FOUND. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt deleted file mode 100644 index 37e6e7e..0000000 --- a/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- Could NOT find SetFoundFALSE \(missing: SetFoundFALSE_DIR\) diff --git a/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake diff --git a/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake new file mode 100644 index 0000000..2dbcfb2 --- /dev/null +++ b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake @@ -0,0 +1,4 @@ +set(PACKAGE_VERSION 1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif() diff --git a/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake diff --git a/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake new file mode 100644 index 0000000..7eb8332 --- /dev/null +++ b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake @@ -0,0 +1,4 @@ +set(PACKAGE_VERSION 2) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif() diff --git a/Tests/RunCMake/find_package/WrongVersion-stderr.txt b/Tests/RunCMake/find_package/WrongVersion-stderr.txt new file mode 100644 index 0000000..ae9fc4a --- /dev/null +++ b/Tests/RunCMake/find_package/WrongVersion-stderr.txt @@ -0,0 +1,11 @@ +^CMake Warning at WrongVersion.cmake:[0-9]+ \(find_package\): + Could not find a configuration file for package "VersionedA" that is + compatible with requested version "3". + + The following configuration files were considered but not accepted: + + .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12] + .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12] + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/find_package/WrongVersion.cmake b/Tests/RunCMake/find_package/WrongVersion.cmake new file mode 100644 index 0000000..5bc711f --- /dev/null +++ b/Tests/RunCMake/find_package/WrongVersion.cmake @@ -0,0 +1,2 @@ +set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +find_package(VersionedA 3) diff --git a/Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt b/Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt new file mode 100644 index 0000000..1b84233 --- /dev/null +++ b/Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt @@ -0,0 +1,11 @@ +^CMake Warning at WrongVersionConfig.cmake:[0-9]+ \(find_package\): + Could not find a configuration file for package "VersionedA" that is + compatible with requested version "3". + + The following configuration files were considered but not accepted: + + .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12] + .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12] + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/find_package/WrongVersionConfig.cmake b/Tests/RunCMake/find_package/WrongVersionConfig.cmake new file mode 100644 index 0000000..5bc711f --- /dev/null +++ b/Tests/RunCMake/find_package/WrongVersionConfig.cmake @@ -0,0 +1,2 @@ +set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +find_package(VersionedA 3) |