diff options
Diffstat (limited to 'Tests/RunCMake/project')
42 files changed, 192 insertions, 0 deletions
diff --git a/Tests/RunCMake/project/CMP0048-NEW-stdout.txt b/Tests/RunCMake/project/CMP0048-NEW-stdout.txt new file mode 100644 index 0000000..38261e5 --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-NEW-stdout.txt @@ -0,0 +1,30 @@ +-- PROJECT_VERSION='1.2.3.4' +-- ProjectA_VERSION='1.2.3.4' +-- PROJECT_VERSION_MAJOR='1' +-- ProjectA_VERSION_MAJOR='1' +-- PROJECT_VERSION_MINOR='2' +-- ProjectA_VERSION_MINOR='2' +-- PROJECT_VERSION_PATCH='3' +-- ProjectA_VERSION_PATCH='3' +-- PROJECT_VERSION_TWEAK='4' +-- ProjectA_VERSION_TWEAK='4' +-- PROJECT_VERSION='0.1.2' +-- ProjectB_VERSION='0.1.2' +-- PROJECT_VERSION_MAJOR='0' +-- ProjectB_VERSION_MAJOR='0' +-- PROJECT_VERSION_MINOR='1' +-- ProjectB_VERSION_MINOR='1' +-- PROJECT_VERSION_PATCH='2' +-- ProjectB_VERSION_PATCH='2' +-- PROJECT_VERSION_TWEAK='' +-- ProjectB_VERSION_TWEAK='' +-- PROJECT_VERSION='' +-- ProjectC_VERSION='' +-- PROJECT_VERSION_MAJOR='' +-- ProjectC_VERSION_MAJOR='' +-- PROJECT_VERSION_MINOR='' +-- ProjectC_VERSION_MINOR='' +-- PROJECT_VERSION_PATCH='' +-- ProjectC_VERSION_PATCH='' +-- PROJECT_VERSION_TWEAK='' +-- ProjectC_VERSION_TWEAK='' diff --git a/Tests/RunCMake/project/CMP0048-NEW.cmake b/Tests/RunCMake/project/CMP0048-NEW.cmake new file mode 100644 index 0000000..7e16b70 --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-NEW.cmake @@ -0,0 +1,19 @@ +macro(print_versions name) + foreach(v "" _MAJOR _MINOR _PATCH _TWEAK) + message(STATUS "PROJECT_VERSION${v}='${PROJECT_VERSION${v}}'") + message(STATUS "${name}_VERSION${v}='${${name}_VERSION${v}}'") + endforeach() +endmacro() + +cmake_policy(SET CMP0048 NEW) + +project(ProjectA VERSION 1.2.3.4 LANGUAGES NONE) +print_versions(ProjectA) + +project(ProjectB VERSION 0.1.2 LANGUAGES NONE) +print_versions(ProjectB) + +set(PROJECT_VERSION 1) +set(ProjectC_VERSION 1) +project(ProjectC NONE) +print_versions(ProjectC) diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt b/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt b/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt new file mode 100644 index 0000000..3a13d32 --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0048-OLD-VERSION.cmake:1 \(project\): + VERSION not allowed unless CMP0048 is set to NEW +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake b/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake new file mode 100644 index 0000000..6fbbe0a --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake @@ -0,0 +1,2 @@ +project(MyProject VERSION 1 LANGUAGES NONE) +message("This line not reached.") diff --git a/Tests/RunCMake/project/CMP0048-OLD-stderr.txt b/Tests/RunCMake/project/CMP0048-OLD-stderr.txt new file mode 100644 index 0000000..1fa70f8 --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0048-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0048 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/project/CMP0048-OLD-stdout.txt b/Tests/RunCMake/project/CMP0048-OLD-stdout.txt new file mode 100644 index 0000000..1a25c7b --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-OLD-stdout.txt @@ -0,0 +1,2 @@ +-- PROJECT_VERSION='1' +-- MyProject_VERSION_TWEAK='0' diff --git a/Tests/RunCMake/project/CMP0048-OLD.cmake b/Tests/RunCMake/project/CMP0048-OLD.cmake new file mode 100644 index 0000000..6c32d2c --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-OLD.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0048 OLD) +set(PROJECT_VERSION 1) +set(MyProject_VERSION_TWEAK 0) +project(MyProject NONE) +message(STATUS "PROJECT_VERSION='${PROJECT_VERSION}'") +message(STATUS "MyProject_VERSION_TWEAK='${MyProject_VERSION_TWEAK}'") diff --git a/Tests/RunCMake/project/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project/CMP0048-WARN-stderr.txt new file mode 100644 index 0000000..6d29ad2 --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-WARN-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\) at CMP0048-WARN.cmake:3 \(project\): + Policy CMP0048 is not set: project\(\) command manages VERSION variables. + Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The following variable\(s\) would be set to empty: + + PROJECT_VERSION + MyProject_VERSION_TWEAK +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/project/CMP0048-WARN.cmake b/Tests/RunCMake/project/CMP0048-WARN.cmake new file mode 100644 index 0000000..97359e6 --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-WARN.cmake @@ -0,0 +1,3 @@ +set(PROJECT_VERSION 1) +set(MyProject_VERSION_TWEAK 0) +project(MyProject NONE) diff --git a/Tests/RunCMake/project/CMakeLists.txt b/Tests/RunCMake/project/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/project/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/project/ExplicitRC.cmake b/Tests/RunCMake/project/ExplicitRC.cmake new file mode 100644 index 0000000..b3feaa9 --- /dev/null +++ b/Tests/RunCMake/project/ExplicitRC.cmake @@ -0,0 +1 @@ +project(ExplicitRC C RC) diff --git a/Tests/RunCMake/project/LanguagesEmpty-stdout.txt b/Tests/RunCMake/project/LanguagesEmpty-stdout.txt new file mode 100644 index 0000000..fb9c7e8 --- /dev/null +++ b/Tests/RunCMake/project/LanguagesEmpty-stdout.txt @@ -0,0 +1 @@ +ENABLED_LANGUAGES='NONE' diff --git a/Tests/RunCMake/project/LanguagesEmpty.cmake b/Tests/RunCMake/project/LanguagesEmpty.cmake new file mode 100644 index 0000000..4de2cca --- /dev/null +++ b/Tests/RunCMake/project/LanguagesEmpty.cmake @@ -0,0 +1,3 @@ +project(ProjectA LANGUAGES) +get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) +message(STATUS "ENABLED_LANGUAGES='${langs}'") diff --git a/Tests/RunCMake/project/LanguagesImplicit-stdout.txt b/Tests/RunCMake/project/LanguagesImplicit-stdout.txt new file mode 100644 index 0000000..fb9c7e8 --- /dev/null +++ b/Tests/RunCMake/project/LanguagesImplicit-stdout.txt @@ -0,0 +1 @@ +ENABLED_LANGUAGES='NONE' diff --git a/Tests/RunCMake/project/LanguagesImplicit.cmake b/Tests/RunCMake/project/LanguagesImplicit.cmake new file mode 100644 index 0000000..e408454 --- /dev/null +++ b/Tests/RunCMake/project/LanguagesImplicit.cmake @@ -0,0 +1,3 @@ +project(ProjectA NONE) +get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) +message(STATUS "ENABLED_LANGUAGES='${langs}'") diff --git a/Tests/RunCMake/project/LanguagesNONE-stdout.txt b/Tests/RunCMake/project/LanguagesNONE-stdout.txt new file mode 100644 index 0000000..fb9c7e8 --- /dev/null +++ b/Tests/RunCMake/project/LanguagesNONE-stdout.txt @@ -0,0 +1 @@ +ENABLED_LANGUAGES='NONE' diff --git a/Tests/RunCMake/project/LanguagesNONE.cmake b/Tests/RunCMake/project/LanguagesNONE.cmake new file mode 100644 index 0000000..2c0125f --- /dev/null +++ b/Tests/RunCMake/project/LanguagesNONE.cmake @@ -0,0 +1,3 @@ +project(ProjectA LANGUAGES NONE) +get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) +message(STATUS "ENABLED_LANGUAGES='${langs}'") diff --git a/Tests/RunCMake/project/LanguagesTwice-result.txt b/Tests/RunCMake/project/LanguagesTwice-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/LanguagesTwice-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/LanguagesTwice-stderr.txt b/Tests/RunCMake/project/LanguagesTwice-stderr.txt new file mode 100644 index 0000000..9c69dd0 --- /dev/null +++ b/Tests/RunCMake/project/LanguagesTwice-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at LanguagesTwice.cmake:1 \(project\): + LANGUAGES may be specified at most once. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/project/LanguagesTwice.cmake b/Tests/RunCMake/project/LanguagesTwice.cmake new file mode 100644 index 0000000..6c4a3dc --- /dev/null +++ b/Tests/RunCMake/project/LanguagesTwice.cmake @@ -0,0 +1,2 @@ +project(ProjectA LANGUAGES NONE LANGUAGES) +message("This line not reached.") diff --git a/Tests/RunCMake/project/ProjectDescription-stdout.txt b/Tests/RunCMake/project/ProjectDescription-stdout.txt new file mode 100644 index 0000000..ffa9092 --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription-stdout.txt @@ -0,0 +1 @@ +PROJECT_DESCRIPTION=Test Project diff --git a/Tests/RunCMake/project/ProjectDescription.cmake b/Tests/RunCMake/project/ProjectDescription.cmake new file mode 100644 index 0000000..3a47362 --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" LANGUAGES) +if(NOT PROJECT_DESCRIPTION) + message(FATAL_ERROR "PROJECT_DESCRIPTION expected to be set") +endif() +message(STATUS "PROJECT_DESCRIPTION=${PROJECT_DESCRIPTION}") diff --git a/Tests/RunCMake/project/ProjectDescription2-result.txt b/Tests/RunCMake/project/ProjectDescription2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/ProjectDescription2-stderr.txt b/Tests/RunCMake/project/ProjectDescription2-stderr.txt new file mode 100644 index 0000000..558e2df --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2-stderr.txt @@ -0,0 +1 @@ + DESCRITPION may be specified at most once. diff --git a/Tests/RunCMake/project/ProjectDescription2.cmake b/Tests/RunCMake/project/ProjectDescription2.cmake new file mode 100644 index 0000000..3f186ba --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" DESCRIPTION "Only once allowed" LANGUAGES) diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake new file mode 100644 index 0000000..3d13e2e --- /dev/null +++ b/Tests/RunCMake/project/RunCMakeTest.cmake @@ -0,0 +1,22 @@ +include(RunCMake) + +if(CMake_TEST_RESOURCES) + run_cmake(ExplicitRC) +endif() +run_cmake(LanguagesImplicit) +run_cmake(LanguagesEmpty) +run_cmake(LanguagesNONE) +run_cmake(LanguagesTwice) +run_cmake(ProjectDescription) +run_cmake(ProjectDescription2) +run_cmake(VersionAndLanguagesEmpty) +run_cmake(VersionEmpty) +run_cmake(VersionInvalid) +run_cmake(VersionMissingLanguages) +run_cmake(VersionMissingValueOkay) +run_cmake(VersionTwice) + +run_cmake(CMP0048-OLD) +run_cmake(CMP0048-OLD-VERSION) +run_cmake(CMP0048-WARN) +run_cmake(CMP0048-NEW) diff --git a/Tests/RunCMake/project/VersionAndLanguagesEmpty-stdout.txt b/Tests/RunCMake/project/VersionAndLanguagesEmpty-stdout.txt new file mode 100644 index 0000000..eae7da7 --- /dev/null +++ b/Tests/RunCMake/project/VersionAndLanguagesEmpty-stdout.txt @@ -0,0 +1,2 @@ +-- ENABLED_LANGUAGES='NONE' +-- PROJECT_VERSION='1' diff --git a/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake b/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake new file mode 100644 index 0000000..d6056ce --- /dev/null +++ b/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake @@ -0,0 +1,5 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectA VERSION 1 LANGUAGES NONE) +get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) +message(STATUS "ENABLED_LANGUAGES='${langs}'") +message(STATUS "PROJECT_VERSION='${PROJECT_VERSION}'") diff --git a/Tests/RunCMake/project/VersionEmpty-stdout.txt b/Tests/RunCMake/project/VersionEmpty-stdout.txt new file mode 100644 index 0000000..3ae42e0 --- /dev/null +++ b/Tests/RunCMake/project/VersionEmpty-stdout.txt @@ -0,0 +1,2 @@ +-- ENABLED_LANGUAGES='NONE' +-- PROJECT_VERSION='' diff --git a/Tests/RunCMake/project/VersionEmpty.cmake b/Tests/RunCMake/project/VersionEmpty.cmake new file mode 100644 index 0000000..0cfb291 --- /dev/null +++ b/Tests/RunCMake/project/VersionEmpty.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0048 NEW) +set(PROJECT_VERSION 1) +project(ProjectA VERSION "" LANGUAGES NONE) +get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) +message(STATUS "ENABLED_LANGUAGES='${langs}'") +message(STATUS "PROJECT_VERSION='${PROJECT_VERSION}'") diff --git a/Tests/RunCMake/project/VersionInvalid-result.txt b/Tests/RunCMake/project/VersionInvalid-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/VersionInvalid-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/VersionInvalid-stderr.txt b/Tests/RunCMake/project/VersionInvalid-stderr.txt new file mode 100644 index 0000000..48358d1 --- /dev/null +++ b/Tests/RunCMake/project/VersionInvalid-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at VersionInvalid.cmake:2 \(project\): + VERSION "NONE" format invalid. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/project/VersionInvalid.cmake b/Tests/RunCMake/project/VersionInvalid.cmake new file mode 100644 index 0000000..8d5dd7f --- /dev/null +++ b/Tests/RunCMake/project/VersionInvalid.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectA VERSION NONE) +message("This line not reached.") diff --git a/Tests/RunCMake/project/VersionMissingLanguages-result.txt b/Tests/RunCMake/project/VersionMissingLanguages-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/VersionMissingLanguages-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt b/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt new file mode 100644 index 0000000..52433bc --- /dev/null +++ b/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at VersionMissingLanguages.cmake:2 \(project\): + project with VERSION must use LANGUAGES before language names. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/project/VersionMissingLanguages.cmake b/Tests/RunCMake/project/VersionMissingLanguages.cmake new file mode 100644 index 0000000..dc41514 --- /dev/null +++ b/Tests/RunCMake/project/VersionMissingLanguages.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectA VERSION 1 NONE) +message("This line not reached.") diff --git a/Tests/RunCMake/project/VersionMissingValueOkay-stdout.txt b/Tests/RunCMake/project/VersionMissingValueOkay-stdout.txt new file mode 100644 index 0000000..3ae42e0 --- /dev/null +++ b/Tests/RunCMake/project/VersionMissingValueOkay-stdout.txt @@ -0,0 +1,2 @@ +-- ENABLED_LANGUAGES='NONE' +-- PROJECT_VERSION='' diff --git a/Tests/RunCMake/project/VersionMissingValueOkay.cmake b/Tests/RunCMake/project/VersionMissingValueOkay.cmake new file mode 100644 index 0000000..1fb1437 --- /dev/null +++ b/Tests/RunCMake/project/VersionMissingValueOkay.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0048 NEW) +set(PROJECT_VERSION 1) +project(ProjectA VERSION LANGUAGES NONE) +get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) +message(STATUS "ENABLED_LANGUAGES='${langs}'") +message(STATUS "PROJECT_VERSION='${PROJECT_VERSION}'") diff --git a/Tests/RunCMake/project/VersionTwice-result.txt b/Tests/RunCMake/project/VersionTwice-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/VersionTwice-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/VersionTwice-stderr.txt b/Tests/RunCMake/project/VersionTwice-stderr.txt new file mode 100644 index 0000000..ec07ead --- /dev/null +++ b/Tests/RunCMake/project/VersionTwice-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at VersionTwice.cmake:2 \(project\): + VERSION may be specified at most once. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/project/VersionTwice.cmake b/Tests/RunCMake/project/VersionTwice.cmake new file mode 100644 index 0000000..dc0c996 --- /dev/null +++ b/Tests/RunCMake/project/VersionTwice.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectA VERSION 1 VERSION) +message("This line not reached.") |