diff options
32 files changed, 227 insertions, 137 deletions
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json index a5025bb..e2b1d95 100644 --- a/Help/manual/presets/schema.json +++ b/Help/manual/presets/schema.json @@ -19,7 +19,7 @@ "properties": { "version": { "const": 2, - "description": "A requVired integer representing the version of the JSON schema." + "description": "A required integer representing the version of the JSON schema." }, "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, "vendor": { "$ref": "#/definitions/vendor" }, @@ -450,7 +450,7 @@ }, "inheritConfigureEnvironment": { "type": "boolean", - "description": "An optional Boolean that defaults to true. If true, the environment variables from the associated configure preset are inherited after all inherited build preset environments, but before environment variables explicitly specified in this build preset." + "description": "An optional boolean that defaults to true. If true, the environment variables from the associated configure preset are inherited after all inherited build preset environments, but before environment variables explicitly specified in this build preset." }, "environment": { "type": "object", @@ -498,11 +498,11 @@ }, "cleanFirst": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --clean-first on the command line." + "description": "An optional boolean. If true, equivalent to passing --clean-first on the command line." }, "verbose": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --verbose on the command line." + "description": "An optional boolean. If true, equivalent to passing --verbose on the command line." }, "nativeToolOptions": { "type": "array", @@ -572,7 +572,7 @@ }, "inheritConfigureEnvironment": { "type": "boolean", - "description": "An optional Boolean that defaults to true. If true, the environment variables from the associated configure preset are inherited after all inherited test preset environments, but before environment variables explicitly specified in this test preset." + "description": "An optional boolean that defaults to true. If true, the environment variables from the associated configure preset are inherited after all inherited test preset environments, but before environment variables explicitly specified in this test preset." }, "environment": { "type": "object", @@ -612,7 +612,7 @@ "properties": { "shortProgress": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --progress on the command line." + "description": "An optional boolean. If true, equivalent to passing --progress on the command line." }, "verbosity": { "type": "string", @@ -623,15 +623,15 @@ }, "debug": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --debug on the command line." + "description": "An optional boolean. If true, equivalent to passing --debug on the command line." }, "outputOnFailure": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --output-on-failure on the command line." + "description": "An optional boolean. If true, equivalent to passing --output-on-failure on the command line." }, "quiet": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --quiet on the command line." + "description": "An optional boolean. If true, equivalent to passing --quiet on the command line." }, "outputLogFile": { "type": "string", @@ -639,11 +639,11 @@ }, "labelSummary": { "type": "boolean", - "description": "An optional bool. If false, equivalent to passing --no-label-summary on the command line." + "description": "An optional boolean. If false, equivalent to passing --no-label-summary on the command line." }, "subprojectSummary": { "type": "boolean", - "description": "An optional bool. If false, equivalent to passing --no-subproject-summary on the command line." + "description": "An optional boolean. If false, equivalent to passing --no-subproject-summary on the command line." }, "maxPassedTestOutputSize": { "type": "integer", @@ -713,7 +713,7 @@ }, "useUnion": { "type": "boolean", - "description": "An optional bool. Equivalent to passing --union on the command line." + "description": "An optional boolean. Equivalent to passing --union on the command line." } }, "additionalProperties": false @@ -760,11 +760,11 @@ "properties": { "stopOnFailure": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --stop-on-failure on the command line." + "description": "An optional boolean. If true, equivalent to passing --stop-on-failure on the command line." }, "enableFailover": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing -F on the command line." + "description": "An optional boolean. If true, equivalent to passing -F on the command line." }, "jobs": { "type": "integer", @@ -808,11 +808,11 @@ }, "interactiveDebugging": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --interactive-debug-mode 1 on the command line. If false, equivalent to passing --interactive-debug-mode 0 on the command line." + "description": "An optional boolean. If true, equivalent to passing --interactive-debug-mode 1 on the command line. If false, equivalent to passing --interactive-debug-mode 0 on the command line." }, "scheduleRandom": { "type": "boolean", - "description": "An optional bool. If true, equivalent to passing --schedule-random on the command line." + "description": "An optional boolean. If true, equivalent to passing --schedule-random on the command line." }, "timeout": { "type": "integer", diff --git a/Help/policy/CMP0118.rst b/Help/policy/CMP0118.rst index b43a766..aa7e0f7 100644 --- a/Help/policy/CMP0118.rst +++ b/Help/policy/CMP0118.rst @@ -10,10 +10,16 @@ property of the source. Consequently, the associated ``GENERATED`` property is now visible from any directory scope, not only from the scope for which it was set. +Additionally, the ``GENERATED`` property may now be set only to boolean +values, and may not be turned off once turned on. + The ``OLD`` behavior of this policy is to only allow ``GENERATED`` to be visible from the directory scope for which it was set. The ``NEW`` behavior on the other hand allows it to be visible from any scope. -This policy was introduced in CMake version 3.20. CMake version |release| -warns when the policy is not set and uses ``OLD`` behavior. Use the +This policy was introduced in CMake version 3.20. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. +Unlike many policies, CMake version |release| does *not* warn +when this policy is not set and simply uses ``OLD`` behavior with regard +to visibility of the ``GENERATED`` property. However, CMake does warn +about setting the ``GENERATED`` property to a non-boolean value. diff --git a/Help/release/dev/FindDevIL-imported-targets.rst b/Help/release/dev/FindDevIL-imported-targets.rst new file mode 100644 index 0000000..aa0929e --- /dev/null +++ b/Help/release/dev/FindDevIL-imported-targets.rst @@ -0,0 +1,4 @@ +FindDevIL +--------- + +* The :module:`FindDevIL` module now provides imported targets. diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake index 9984943..c8e5e31 100644 --- a/Modules/FindDevIL.cmake +++ b/Modules/FindDevIL.cmake @@ -10,26 +10,57 @@ FindDevIL This module locates the developer's image library. http://openil.sourceforge.net/ +IMPORTED Targets +^^^^^^^^^^^^^^^^ + +.. versionadded:: 3.21 + +This module defines the :prop_tgt:`IMPORTED` targets: + +``DevIL::IL`` + Defined if the system has DevIL. + +``DevIL::ILU`` + Defined if the system has DevIL Utilities. + +``DevIL::ILUT`` + Defined if the system has DevIL Utility Toolkit. + +Result Variables +^^^^^^^^^^^^^^^^ + This module sets: -:: - - IL_LIBRARIES - the name of the IL library. These include the full path to - the core DevIL library. This one has to be linked into the - application. - ILU_LIBRARIES - the name of the ILU library. Again, the full path. This - library is for filters and effects, not actual loading. It - doesn't have to be linked if the functionality it provides - is not used. - ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the - library interfaces with OpenGL. It is not strictly needed - in applications. - IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files. - DevIL_FOUND - this is set to TRUE if all the above variables were set. - This will be set to false if ILU or ILUT are not found, - even if they are not needed. In most systems, if one - library is found all the others are as well. That's the - way the DevIL developers release it. +``IL_LIBRARIES`` + The name of the IL library. These include the full path to + the core DevIL library. This one has to be linked into the + application. + +``ILU_LIBRARIES`` + The name of the ILU library. Again, the full path. This + library is for filters and effects, not actual loading. It + doesn't have to be linked if the functionality it provides + is not used. + +``ILUT_LIBRARIES`` + The name of the ILUT library. Full path. This part of the + library interfaces with OpenGL. It is not strictly needed + in applications. + +``IL_INCLUDE_DIR`` + where to find the il.h, ilu.h and ilut.h files. + +``DevIL_FOUND`` + This is set to TRUE if all the above variables were set. + This will be set to false if ILU or ILUT are not found, + even if they are not needed. In most systems, if one + library is found all the others are as well. That's the + way the DevIL developers release it. + +``DevIL_ILUT_FOUND`` + .. versionadded:: 3.21 + + This is set to TRUE if the ILUT library is found. #]=======================================================================] # TODO: Add version support. @@ -73,3 +104,36 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(DevIL DEFAULT_MSG IL_INCLUDE_DIR) # provide legacy variable for compatibility set(IL_FOUND ${DevIL_FOUND}) + +# create imported targets ONLY if we found DevIL. +if(DevIL_FOUND) + # Report the ILUT found if ILUT_LIBRARIES contains valid path. + if (ILUT_LIBRARIES) + set(DevIL_ILUT_FOUND TRUE) + else() + set(DevIL_ILUT_FOUND FALSE) + endif() + + if(NOT TARGET DevIL::IL) + add_library(DevIL::IL UNKNOWN IMPORTED) + set_target_properties(DevIL::IL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${IL_INCLUDE_DIR}" + IMPORTED_LOCATION "${IL_LIBRARIES}") + endif() + + # DevIL Utilities target + if(NOT TARGET DevIL::ILU) + add_library(DevIL::ILU UNKNOWN IMPORTED) + set_target_properties(DevIL::ILU PROPERTIES + IMPORTED_LOCATION "${ILU_LIBRARIES}") + target_link_libraries(DevIL::ILU INTERFACE DevIL::IL) + endif() + + # ILUT (if found) + if(NOT TARGET DevIL::ILUT AND DevIL_ILUT_FOUND) + add_library(DevIL::ILUT UNKNOWN IMPORTED) + set_target_properties(DevIL::ILUT PROPERTIES + IMPORTED_LOCATION "${ILUT_LIBRARIES}") + target_link_libraries(DevIL::ILUT INTERFACE DevIL::ILU) + endif() +endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 163224c..88c1631 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 20) -set(CMake_VERSION_PATCH 20210318) +set(CMake_VERSION_PATCH 20210319) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 72bc972..3f3c8d5 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -141,14 +141,21 @@ bool cmSourceFile::FindFullPath(std::string* error, std::vector<std::string> exts = makefile->GetCMakeInstance()->GetAllExtensions(); auto cmp0115 = makefile->GetPolicyStatus(cmPolicies::CMP0115); + auto cmp0118 = makefile->GetPolicyStatus(cmPolicies::CMP0118); + bool const cmp0118new = + cmp0118 != cmPolicies::OLD && cmp0118 != cmPolicies::WARN; // Tries to find the file in a given directory - auto findInDir = [this, &exts, &lPath, cmp0115, cmp0115Warning, + auto findInDir = [this, &exts, &lPath, cmp0115, cmp0115Warning, cmp0118new, makefile](std::string const& dir) -> bool { // Compute full path std::string const fullPath = cmSystemTools::CollapseFullPath(lPath, dir); // Try full path - if (cmSystemTools::FileExists(fullPath)) { + if (cmp0118new && + makefile->GetGlobalGenerator()->IsGeneratedFile(fullPath)) { + this->IsGenerated = true; + } + if (this->IsGenerated || cmSystemTools::FileExists(fullPath)) { this->FullPath = fullPath; return true; } @@ -160,7 +167,11 @@ bool cmSourceFile::FindFullPath(std::string* error, for (std::string const& ext : exts) { if (!ext.empty()) { std::string extPath = cmStrCat(fullPath, '.', ext); - if (cmSystemTools::FileExists(extPath)) { + if (cmp0118new && + makefile->GetGlobalGenerator()->IsGeneratedFile(extPath)) { + this->IsGenerated = true; + } + if (this->IsGenerated || cmSystemTools::FileExists(extPath)) { this->FullPath = extPath; if (cmp0115 == cmPolicies::WARN) { std::string warning = diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0430afb..e532ace 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1424,6 +1424,7 @@ if(BUILD_TESTING) CURL Cups Doxygen + DevIL EnvModules EXPAT Fontconfig diff --git a/Tests/FindDevIL/CMakeLists.txt b/Tests/FindDevIL/CMakeLists.txt new file mode 100644 index 0000000..d37d50f --- /dev/null +++ b/Tests/FindDevIL/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindDevIL.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindDevIL/Test" + "${CMake_BINARY_DIR}/Tests/FindDevIL/Test" + ${build_generator_args} + --build-project TestFindDevIL + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindDevIL/Test/CMakeLists.txt b/Tests/FindDevIL/Test/CMakeLists.txt new file mode 100644 index 0000000..c2c1322 --- /dev/null +++ b/Tests/FindDevIL/Test/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindDevIL C) +include(CTest) + +find_package(DevIL) + +#FIXME: check version too. +# add_definitions( +# -DCMAKE_EXPECTED_SDL_VERSION_MAJOR=${SDL_VERSION_MAJOR} +# -DCMAKE_EXPECTED_SDL_VERSION_MINOR=${SDL_VERSION_MINOR} +# -DCMAKE_EXPECTED_SDL_VERSION_PATCH=${SDL_VERSION_PATCH}) + +add_executable(test_devil_var main.c) +target_include_directories(test_devil_var PRIVATE ${IL_INCLUDE_DIRS}) +target_link_libraries(test_devil_var PRIVATE ${IL_LIBRARIES}) +add_test(NAME test_devil_var COMMAND test_devil_var) + +add_executable(test_devil_il_tgt main.c) +target_link_libraries(test_devil_il_tgt DevIL::IL) +add_test(NAME test_devil_il_tgt COMMAND test_devil_il_tgt) + +add_executable(test_devil_ilu_tgt main_ilu.c) +target_link_libraries(test_devil_ilu_tgt DevIL::ILU) + +add_executable(test_devil_ilu_var main_ilu.c) +target_include_directories(test_devil_ilu_var PRIVATE ${IL_INCLUDE_DIRS} ${ILU_INCLUDE_DIRS}) +target_link_libraries(test_devil_ilu_var ${IL_LIBRARIES} ${ILU_LIBRARIES}) + +#FIXME: Check DevIL::ILUT target diff --git a/Tests/FindDevIL/Test/main.c b/Tests/FindDevIL/Test/main.c new file mode 100644 index 0000000..4a07087 --- /dev/null +++ b/Tests/FindDevIL/Test/main.c @@ -0,0 +1,10 @@ +#include <IL/il.h> + +int main() +{ + // Test 1 requires to link to the library. + ilInit(); + + ilShutDown(); + return 0; +} diff --git a/Tests/FindDevIL/Test/main_ilu.c b/Tests/FindDevIL/Test/main_ilu.c new file mode 100644 index 0000000..a9e7819 --- /dev/null +++ b/Tests/FindDevIL/Test/main_ilu.c @@ -0,0 +1,8 @@ +#include <IL/ilu.h> + +int main() +{ + // IL Utilities requires only initialization. + // Unlike main DevIL there are no shutdown function. + iluInit(); +} diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt index cee4516..2bd1cba 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt @@ -39,13 +39,4 @@ Generated_source6\.txt: # 1b # GENERATED = `1` Generated_source6\.txt: # 2a # GENERATED = `1` Generated_source6\.txt: # 2b # GENERATED = `1` Generated_source6\.txt: # 3a # GENERATED = `0` -Generated_source6\.txt: # 3b # GENERATED = `0` -CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-build/Generated_source4\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test10\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Generate step failed\. Build files cannot be regenerated correctly\.$ +Generated_source6\.txt: # 3b # GENERATED = `0`$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt index 422a3de..05b2353 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt @@ -52,29 +52,4 @@ Generated_source6\.txt: # 1b # GENERATED = `0` Generated_source6\.txt: # 2a # GENERATED = `0` Generated_source6\.txt: # 2b # GENERATED = `0` Generated_source6\.txt: # 3a # GENERATED = `0` -Generated_source6\.txt: # 3b # GENERATED = `0` -CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Generate step failed\. Build files cannot be regenerated correctly\.$ +Generated_source6\.txt: # 3b # GENERATED = `0`$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt index 2f42f36..2bd1cba 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt @@ -39,13 +39,4 @@ Generated_source6\.txt: # 1b # GENERATED = `1` Generated_source6\.txt: # 2a # GENERATED = `1` Generated_source6\.txt: # 2b # GENERATED = `1` Generated_source6\.txt: # 3a # GENERATED = `0` -Generated_source6\.txt: # 3b # GENERATED = `0` -CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-build/Generated_source4\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test14\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Generate step failed\. Build files cannot be regenerated correctly\.$ +Generated_source6\.txt: # 3b # GENERATED = `0`$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt index 65bd577..3166f45 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt @@ -52,29 +52,4 @@ Generated_source6\.txt: # 1b # GENERATED = `0` Generated_source6\.txt: # 2a # GENERATED = `0` Generated_source6\.txt: # 2b # GENERATED = `0` Generated_source6\.txt: # 3a # GENERATED = `0` -Generated_source6\.txt: # 3b # GENERATED = `0` -CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Generate step failed\. Build files cannot be regenerated correctly\.$ +Generated_source6\.txt: # 3b # GENERATED = `0`$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt index 17e2b4a..0c84cfe 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt @@ -33,13 +33,4 @@ Generated_source6\.txt: # 1b # GENERATED = `1` Generated_source6\.txt: # 2a # GENERATED = `1` Generated_source6\.txt: # 2b # GENERATED = `1` Generated_source6\.txt: # 3a # GENERATED = `0` -Generated_source6\.txt: # 3b # GENERATED = `0` -CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-build/Generated_source4\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test6\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Generate step failed\. Build files cannot be regenerated correctly\.$ +Generated_source6\.txt: # 3b # GENERATED = `0`$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt index 7f48bf0..f723875 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt @@ -33,13 +33,4 @@ Generated_source6\.txt: # 1b # GENERATED = `1` Generated_source6\.txt: # 2a # GENERATED = `1` Generated_source6\.txt: # 2b # GENERATED = `1` Generated_source6\.txt: # 3a # GENERATED = `0` -Generated_source6\.txt: # 3b # GENERATED = `0` -CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_custom_target\): - Cannot find source file: - -[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-build/Generated_source4\.txt -Call Stack \(most recent call first\): - CMP0118-NEW-Test8\.cmake:[0-9]+ \(include\) - CMakeLists\.txt:[0-9]+ \(include\) -+ -CMake Generate step failed\. Build files cannot be regenerated correctly\.$ +Generated_source6\.txt: # 3b # GENERATED = `0`$ diff --git a/Tests/RunCMake/CMP0118/CMakeLists.txt b/Tests/RunCMake/CMP0118/CMakeLists.txt index 0d30651..957fe03 100644 --- a/Tests/RunCMake/CMP0118/CMakeLists.txt +++ b/Tests/RunCMake/CMP0118/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required(VERSION 3.19) cmake_policy(SET CMP0115 NEW) project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-Common.cmake b/Tests/RunCMake/CMP0118/GenInSubdir-Common.cmake new file mode 100644 index 0000000..6012c79 --- /dev/null +++ b/Tests/RunCMake/CMP0118/GenInSubdir-Common.cmake @@ -0,0 +1,2 @@ +add_custom_target(top) +add_subdirectory(GenInSubdir) diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-NEW.cmake b/Tests/RunCMake/CMP0118/GenInSubdir-NEW.cmake new file mode 100644 index 0000000..373e73d --- /dev/null +++ b/Tests/RunCMake/CMP0118/GenInSubdir-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0118 NEW) +include(GenInSubdir-Common.cmake) diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt +++ b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-result.txt diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt new file mode 100644 index 0000000..d3aa546 --- /dev/null +++ b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error at GenInSubdir-Common.cmake:[0-9]+ \(add_custom_target\): + Cannot find source file: + + [^ +]*/Tests/RunCMake/CMP0118/GenInSubdir-OLD-build/GenInSubdir/sub.txt +Call Stack \(most recent call first\): + GenInSubdir-OLD.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-OLD.cmake b/Tests/RunCMake/CMP0118/GenInSubdir-OLD.cmake new file mode 100644 index 0000000..48be27e --- /dev/null +++ b/Tests/RunCMake/CMP0118/GenInSubdir-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0118 OLD) +include(GenInSubdir-Common.cmake) diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt b/Tests/RunCMake/CMP0118/GenInSubdir-WARN-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt +++ b/Tests/RunCMake/CMP0118/GenInSubdir-WARN-result.txt diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-WARN-stderr.txt b/Tests/RunCMake/CMP0118/GenInSubdir-WARN-stderr.txt new file mode 100644 index 0000000..5eb8a34 --- /dev/null +++ b/Tests/RunCMake/CMP0118/GenInSubdir-WARN-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error at GenInSubdir-Common.cmake:[0-9]+ \(add_custom_target\): + Cannot find source file: + + [^ +]*/Tests/RunCMake/CMP0118/GenInSubdir-WARN-build/GenInSubdir/sub.txt +Call Stack \(most recent call first\): + GenInSubdir-WARN.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-WARN.cmake b/Tests/RunCMake/CMP0118/GenInSubdir-WARN.cmake new file mode 100644 index 0000000..8e7e395 --- /dev/null +++ b/Tests/RunCMake/CMP0118/GenInSubdir-WARN.cmake @@ -0,0 +1,2 @@ + +include(GenInSubdir-Common.cmake) diff --git a/Tests/RunCMake/CMP0118/GenInSubdir/CMakeLists.txt b/Tests/RunCMake/CMP0118/GenInSubdir/CMakeLists.txt new file mode 100644 index 0000000..3f1ce8d --- /dev/null +++ b/Tests/RunCMake/CMP0118/GenInSubdir/CMakeLists.txt @@ -0,0 +1,9 @@ +add_custom_command( + OUTPUT sub.txt + COMMAND ${CMAKE_COMMAND} -E touch sub.txt + VERBATIM + ) +add_custom_target(gen DEPENDS sub.txt) + +add_dependencies(top gen) +target_sources(top PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/sub.txt) diff --git a/Tests/RunCMake/CMP0118/RunCMakeTest.cmake b/Tests/RunCMake/CMP0118/RunCMakeTest.cmake index 72064bd..f7f135e 100644 --- a/Tests/RunCMake/CMP0118/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0118/RunCMakeTest.cmake @@ -1,5 +1,9 @@ include(RunCMake) +run_cmake(GenInSubdir-OLD) +run_cmake(GenInSubdir-WARN) +run_cmake(GenInSubdir-NEW) + run_cmake(CMP0118-OLD-Test1) run_cmake(CMP0118-OLD-Test2) run_cmake(CMP0118-OLD-Test3) |