cmake/Tests/RunCMake/project/RunCMakeTest.cmake

76 lines
2.2 KiB
CMake
Raw Normal View History

2014-08-03 19:52:23 +02:00
include(RunCMake)
2022-08-04 22:12:04 +02:00
# Use an initial cache file to define the project() variables
# to avoid long command lines. Also see the CMakeOnly test case
# which tests some of the individual variables one at a time.
# Here, we are focused on testing that the variables are all injected
# at the expected points in the expected order.
2024-04-14 22:45:38 +02:00
run_cmake_with_options(CodeInjection1
-C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_1.cmake"
)
# This checks that List variables are allowed.
run_cmake_with_options(CodeInjection2
-C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_2.cmake"
)
# This checks that module names are also allowed.
run_cmake_with_options(CodeInjection3
-C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_3.cmake"
2022-08-04 22:12:04 +02:00
)
2016-10-30 18:24:19 +01:00
if(CMake_TEST_RESOURCES)
run_cmake(ExplicitRC)
endif()
2022-11-16 20:14:03 +01:00
set(RunCMake_DEFAULT_stderr .)
run_cmake(LanguagesDuplicate)
unset(RunCMake_DEFAULT_stderr)
2014-08-03 19:52:23 +02:00
run_cmake(LanguagesImplicit)
run_cmake(LanguagesEmpty)
run_cmake(LanguagesNONE)
run_cmake(LanguagesTwice)
2018-08-09 18:06:22 +02:00
run_cmake(LanguagesUnordered)
2022-08-04 22:12:04 +02:00
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
run_cmake(LanguagesUsedButNotEnabled)
endif()
2024-08-30 13:50:19 +02:00
run_cmake(ProjectCMP0126)
2017-07-20 19:35:53 +02:00
run_cmake(ProjectDescription)
run_cmake(ProjectDescription2)
2018-08-09 18:06:22 +02:00
run_cmake(ProjectDescriptionNoArg)
run_cmake(ProjectDescriptionNoArg2)
run_cmake(ProjectHomepage)
run_cmake(ProjectHomepage2)
run_cmake(ProjectHomepageNoArg)
2021-09-14 00:13:48 +02:00
run_cmake(ProjectIsTopLevel)
run_cmake(ProjectIsTopLevelMultiple)
run_cmake(ProjectIsTopLevelSubdirectory)
2018-10-28 12:09:07 +01:00
run_cmake(ProjectTwice)
2014-08-03 19:52:23 +02:00
run_cmake(VersionAndLanguagesEmpty)
run_cmake(VersionEmpty)
run_cmake(VersionInvalid)
run_cmake(VersionMissingLanguages)
run_cmake(VersionMissingValueOkay)
run_cmake(VersionTwice)
2020-02-01 23:06:01 +01:00
run_cmake(VersionMax)
2014-08-03 19:52:23 +02:00
run_cmake(CMP0048-OLD)
run_cmake(CMP0048-OLD-VERSION)
run_cmake(CMP0048-WARN)
run_cmake(CMP0048-NEW)
2020-02-01 23:06:01 +01:00
run_cmake(CMP0096-WARN)
run_cmake(CMP0096-OLD)
run_cmake(CMP0096-NEW)
2023-05-23 16:38:00 +02:00
2024-10-09 08:12:33 +02:00
# We deliberately run these twice to verify behavior of the second CMake run
2024-11-11 15:18:55 +01:00
run_cmake(CMP0180-OLD)
2024-10-09 08:12:33 +02:00
set(RunCMake_TEST_NO_CLEAN 1)
2024-11-11 15:18:55 +01:00
run_cmake(CMP0180-OLD)
set(RunCMake_TEST_NO_CLEAN 0)
run_cmake(CMP0180-NEW)
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake(CMP0180-NEW)
2024-10-09 08:12:33 +02:00
set(RunCMake_TEST_NO_CLEAN 0)
2023-05-23 16:38:00 +02:00
run_cmake(NoMinimumRequired)