diff options
Diffstat (limited to 'Tests')
31 files changed, 167 insertions, 34 deletions
diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx index 0dfa326..623ad28 100644 --- a/Tests/CMakeLib/testSystemTools.cxx +++ b/Tests/CMakeLib/testSystemTools.cxx @@ -52,7 +52,7 @@ int testSystemTools(int /*unused*/, char* /*unused*/ []) cmAssert(cmSystemTools::strverscmp("99999999999999", "99999999999991") > 0, "strverscmp natural overflow"); cmAssert(cmSystemTools::strverscmp("00000000000009", "00000000000001") > 0, - "strverscmp deciaml precision"); + "strverscmp decimal precision"); cmAssert(cmSystemTools::strverscmp("a.b.c.0", "a.b.c.000") > 0, "strverscmp multiple zeros"); cmAssert(cmSystemTools::strverscmp("lib_1.2_10", "lib_1.2_2") > 0, diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt index f4e1923..d3d4b7c 100644 --- a/Tests/Cuda/Complex/CMakeLists.txt +++ b/Tests/Cuda/Complex/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.7) -project (CudaComplex CXX CUDA) +project (Complex CXX CUDA) #Goal for this example: #build a cpp dynamic library base diff --git a/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt b/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt index 9fda2d0..7098a7d 100644 --- a/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt +++ b/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.7) -project (CudaConsumeCompileFeatures CXX CUDA) +project (ConsumeCompileFeatures CXX CUDA) #Goal for this example: #build a c++11 library that express a c++11 public compile feature diff --git a/Tests/Cuda/MixedStandardLevels/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels/CMakeLists.txt index 683abe7..b399662 100644 --- a/Tests/Cuda/MixedStandardLevels/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.7) -project(CudaComplex CXX CUDA) +project(MixedStandardLevels CXX CUDA) string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30") diff --git a/Tests/Cuda/ObjectLibrary/CMakeLists.txt b/Tests/Cuda/ObjectLibrary/CMakeLists.txt index da5fb87..395bd38 100644 --- a/Tests/Cuda/ObjectLibrary/CMakeLists.txt +++ b/Tests/Cuda/ObjectLibrary/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.7) -project (CudaObjectLibrary CUDA CXX) +project (ObjectLibrary CUDA CXX) #Goal for this example: # #Build C++ and CUDA object files and than use them to make an executable diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt index 831ce12..69aa3f9 100644 --- a/Tests/Cuda/WithC/CMakeLists.txt +++ b/Tests/Cuda/WithC/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.7) -project(CudaComplex CUDA C) +project(WithC CUDA C) string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30") diff --git a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt index c978e51..5e6f7ab 100644 --- a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt +++ b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.7) -project (CudaOnlyCircularLinkLine CUDA) +project (CircularLinkLine CUDA) #Goal for this example: # Verify that we de-duplicate the device link line diff --git a/Tests/CudaOnly/EnableStandard/CMakeLists.txt b/Tests/CudaOnly/EnableStandard/CMakeLists.txt index 35a1deb..54e2c14 100644 --- a/Tests/CudaOnly/EnableStandard/CMakeLists.txt +++ b/Tests/CudaOnly/EnableStandard/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.7) -project (CudaOnlyEnableStandard CUDA) +project (EnableStandard CUDA) #Goal for this example: #build cuda sources that require C++11 to be enabled. diff --git a/Tests/CudaOnly/ExportPTX/CMakeLists.txt b/Tests/CudaOnly/ExportPTX/CMakeLists.txt index 65d5243..ff6e77c 100644 --- a/Tests/CudaOnly/ExportPTX/CMakeLists.txt +++ b/Tests/CudaOnly/ExportPTX/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project (CudaOnlyExportPTX CUDA) +project (ExportPTX CUDA) #Goal for this example: # How to generate PTX files instead of OBJECT files diff --git a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt index 5b96906..fbef15f 100644 --- a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt +++ b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.7) -project (CudaOnlGPUDebugFlag CUDA) +project (GPUDebugFlag CUDA) #Goal for this example: #verify that -G enables gpu debug flags diff --git a/Tests/CudaOnly/LinkSystemDeviceLibraries/CMakeLists.txt b/Tests/CudaOnly/LinkSystemDeviceLibraries/CMakeLists.txt index 62be1e6..7f7f606 100644 --- a/Tests/CudaOnly/LinkSystemDeviceLibraries/CMakeLists.txt +++ b/Tests/CudaOnly/LinkSystemDeviceLibraries/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(CudaOnlyLinkSystemDeviceLibraries CUDA) +project(LinkSystemDeviceLibraries CUDA) string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_35,code=compute_35 -gencode arch=compute_35,code=sm_35") set(CMAKE_CUDA_STANDARD 11) diff --git a/Tests/CudaOnly/PDB/CMakeLists.txt b/Tests/CudaOnly/PDB/CMakeLists.txt index 34e1e5c..6ecf989 100644 --- a/Tests/CudaOnly/PDB/CMakeLists.txt +++ b/Tests/CudaOnly/PDB/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.11) -project (CudaOnlyPDB CUDA) +project (PDB CUDA) add_executable(CudaOnlyPDB main.cu) set_target_properties(CudaOnlyPDB PROPERTIES diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt index 0c453a9..796e133 100644 --- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt +++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.7) -project (CudaOnlyResolveDeviceSymbols CUDA) +project (ResolveDeviceSymbols CUDA) # Find nm and dumpbin if(CMAKE_NM) diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index c934c51..1e574d6 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.7) -project (CudaOnlySeparateCompilation CUDA) +project (SeparateCompilation CUDA) #Goal for this example: #Build a static library that defines multiple methods and kernels that diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt index 926d9ed..e58204d 100644 --- a/Tests/CudaOnly/WithDefs/CMakeLists.txt +++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.7) -project (CudaOnlyWithDefs CUDA) +project (WithDefs CUDA) #verify that we can pass explicit cuda arch flags string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30") diff --git a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt index b1c4fc3..1ad6238 100644 --- a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt +++ b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) set(MOC_INCLUDE_NAME "mocIncludeRelaxed") include(${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/shared.cmake) -# Relaxed ony executable +# Relaxed only executable add_executable(mocIncludeRelaxedOnly RObjA.cpp RObjB.cpp diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake new file mode 100644 index 0000000..2a505c6 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake @@ -0,0 +1,83 @@ +cmake_minimum_required(VERSION 3.12) + +project(FindPkgConfig_IMPORTED_TARGET C) + +find_package(PkgConfig REQUIRED) + +message(STATUS "source: ${CMAKE_CURRENT_SOURCE_DIR} bin ${CMAKE_CURRENT_BINARY_DIR}") + +# Setup for the remaining package tests below +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH) +set(fakePkgDir ${CMAKE_CURRENT_BINARY_DIR}/pc-fakepackage) +file(WRITE ${fakePkgDir}/lib/libcmakeinternalfakepackage.a "") +file(WRITE ${fakePkgDir}/lib/cmakeinternalfakepackage.lib "") +file(WRITE ${fakePkgDir}/lib/pkgconfig/cmakeinternalfakepackage.pc +"Name: CMakeInternalFakePackage +Description: Dummy package for FindPkgConfig VERSION_OPERATORS test +Version: 8.9 +Libs: -lcmakeinternalfakepackage +") + +# Always find the .pc file in the calls further below so that we can test that +# the import target find_library() calls handle the NO...PATH options correctly +set(ENV{PKG_CONFIG_PATH} ${fakePkgDir}/lib/pkgconfig) + +pkg_check_modules(FakePackageGE REQUIRED QUIET "cmakeinternalfakepackage >= 8") +if (NOT FakePackageGE_FOUND) + message(FATAL_ERROR "fake package >= 8 not found") +endif() + +pkg_check_modules(FakePackageGE_FAIL QUIET "cmakeinternalfakepackage >= 8.10") +if (FakePackageGE_FAIL_FOUND) + message(FATAL_ERROR "fake package >= 8.10 found") +endif() + +pkg_check_modules(FakePackageLE REQUIRED QUIET "cmakeinternalfakepackage<=9") +if (NOT FakePackageLE_FOUND) + message(FATAL_ERROR "fake package <= 9 not found") +endif() + +pkg_check_modules(FakePackageLE_FAIL QUIET "cmakeinternalfakepackage <= 8.1") +if (FakePackageLE_FAIL_FOUND) + message(FATAL_ERROR "fake package <= 8.1 found") +endif() + +pkg_check_modules(FakePackageGT REQUIRED QUIET "cmakeinternalfakepackage > 8") +if (NOT FakePackageGT_FOUND) + message(FATAL_ERROR "fake package > 8 not found") +endif() + +pkg_check_modules(FakePackageGT_FAIL QUIET "cmakeinternalfakepackage > 8.9") +if (FakePackageGT_FAIL_FOUND) + message(FATAL_ERROR "fake package > 8.9 found") +endif() + +pkg_check_modules(FakePackageLT REQUIRED QUIET "cmakeinternalfakepackage<9") +if (NOT FakePackageLT_FOUND) + message(FATAL_ERROR "fake package < 9 not found") +endif() + +pkg_check_modules(FakePackageLT_FAIL QUIET "cmakeinternalfakepackage < 8.9") +if (FakePackageLT_FAIL_FOUND) + message(FATAL_ERROR "fake package < 8.9 found") +endif() + +pkg_check_modules(FakePackageEQ REQUIRED QUIET "cmakeinternalfakepackage=8.9") +if (NOT FakePackageEQ_FOUND) + message(FATAL_ERROR "fake package = 8.9 not found") +endif() + +pkg_check_modules(FakePackageEQ_FAIL QUIET "cmakeinternalfakepackage = 8.8") +if (FakePackageEQ_FAIL_FOUND) + message(FATAL_ERROR "fake package = 8.8 found") +endif() + +pkg_check_modules(FakePackageEQ_INV QUIET "cmakeinternalfakepackage == 8.9") +if (FakePackageEQ_FAIL_FOUND) + message(FATAL_ERROR "fake package == 8.9 found") +endif() + +pkg_check_modules(FakePackageLLT_INV QUIET "cmakeinternalfakepackage <<= 9") +if (FakePackageLLT_FAIL_FOUND) + message(FATAL_ERROR "fake package <<= 9 found") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake index e12b52f..671ff51 100644 --- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake @@ -16,4 +16,5 @@ if (PKG_CONFIG_FOUND) run_cmake(FindPkgConfig_GET_VARIABLE) run_cmake(FindPkgConfig_cache_variables) run_cmake(FindPkgConfig_IMPORTED_TARGET) + run_cmake(FindPkgConfig_VERSION_OPERATORS) endif () diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW-stderr.txt new file mode 100644 index 0000000..7f248ae --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW-stderr.txt @@ -0,0 +1,2 @@ +^-->value<-- +-->value<--$ diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW.cmake b/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW.cmake new file mode 100644 index 0000000..b81fd56 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0053 NEW) + +set($ value) +set(dollar $) +message("-->${${dollar}}<--") +message("-->${$}<--") diff --git a/Tests/RunCMake/install/CODE-genex-bad-result.txt b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/install/CODE-genex-bad-result.txt +++ b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-result.txt diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt new file mode 100644 index 0000000..aecd4d3 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt @@ -0,0 +1,24 @@ +^CMake Deprecation Warning at CMP0053-Dollar-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0053 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\) ++ +-->value<-- +CMake Error at CMP0053-Dollar-OLD.cmake:6 \(message\): + Syntax error in cmake code at + + .*CMP0053-Dollar-OLD.cmake:6 + + when parsing string + + -->\${\$}<-- + + syntax error, unexpected \$, expecting } \(7\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake new file mode 100644 index 0000000..647f464 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0053 OLD) + +set($ value) +set(dollar $) +message("-->${${dollar}}<--") +message("-->${$}<--") diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index a397620..8d74dc1 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -111,6 +111,8 @@ run_cmake(CMP0053-NameWithNewlineQuoted) run_cmake(CMP0053-NameWithCarriageReturnQuoted) run_cmake(CMP0053-NameWithEscapedSpacesQuoted) run_cmake(CMP0053-NameWithEscapedTabsQuoted) +run_cmake(CMP0053-Dollar-OLD) +run_cmake(CMP0053-Dollar-NEW) # Variable special types run_cmake(QueryCache) diff --git a/Tests/RunCMake/install/CODE-genex-bad-stderr.txt b/Tests/RunCMake/install/CODE-genex-bad-stderr.txt deleted file mode 100644 index 9844158..0000000 --- a/Tests/RunCMake/install/CODE-genex-bad-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error: - Error evaluating generator expression: - - \$<NOTAGENEX> - - Expression did not evaluate to a known generator expression diff --git a/Tests/RunCMake/install/CODE-genex-bad.cmake b/Tests/RunCMake/install/CODE-genex-bad.cmake deleted file mode 100644 index 1663b39..0000000 --- a/Tests/RunCMake/install/CODE-genex-bad.cmake +++ /dev/null @@ -1 +0,0 @@ -install(CODE "message(\"$<NOTAGENEX>\")") diff --git a/Tests/RunCMake/install/CODE-genex-check.cmake b/Tests/RunCMake/install/CODE-genex-check.cmake deleted file mode 100644 index 422c532..0000000 --- a/Tests/RunCMake/install/CODE-genex-check.cmake +++ /dev/null @@ -1,7 +0,0 @@ -execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake - OUTPUT_VARIABLE out ERROR_VARIABLE err) -if(NOT out MATCHES "-- Install configuration: .*-- codegenexlib") - string(REGEX REPLACE "\n" "\n " out " ${out}") - string(APPEND RunCMake_TEST_FAILED - "\"-- codegenexlib\" was not found:\n${out}") -endif() diff --git a/Tests/RunCMake/install/CODE-genex.cmake b/Tests/RunCMake/install/CODE-genex.cmake deleted file mode 100644 index 3b8513d..0000000 --- a/Tests/RunCMake/install/CODE-genex.cmake +++ /dev/null @@ -1,2 +0,0 @@ -add_library( codegenexlib INTERFACE ) -install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")") diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index 91524a6..ec022ca 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -65,8 +65,6 @@ run_cmake(CMP0062-NEW) run_cmake(CMP0062-WARN) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-all) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc) -run_cmake(CODE-genex) -run_cmake(CODE-genex-bad) if(NOT RunCMake_GENERATOR STREQUAL "Xcode" OR NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]") run_install_test(FILES-TARGET_OBJECTS) diff --git a/Tests/RunCMake/project/ProjectTwice.cmake b/Tests/RunCMake/project/ProjectTwice.cmake new file mode 100644 index 0000000..d053834 --- /dev/null +++ b/Tests/RunCMake/project/ProjectTwice.cmake @@ -0,0 +1,26 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectTwiceTestFirst + VERSION 1.2.3.4 + DESCRIPTION "Test Project" + HOMEPAGE_URL "http://example.com" + LANGUAGES NONE +) + +project(ProjectTwiceTestSecond LANGUAGES NONE) + +foreach(var + PROJECT_VERSION + PROJECT_VERSION_MAJOR + PROJECT_VERSION_MINOR + PROJECT_VERSION_PATCH + PROJECT_VERSION_TWEAK + PROJECT_DESCRIPTION + PROJECT_HOMEPAGE_URL +) + if(${var}) + message(SEND_ERROR "${var} set but should be empty") + endif() + if(CMAKE_${var}) + message(SEND_ERROR "CMAKE_${var} set but should be empty") + endif() +endforeach() diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake index e9fb929..3a8ad4b 100644 --- a/Tests/RunCMake/project/RunCMakeTest.cmake +++ b/Tests/RunCMake/project/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake(ProjectDescriptionNoArg2) run_cmake(ProjectHomepage) run_cmake(ProjectHomepage2) run_cmake(ProjectHomepageNoArg) +run_cmake(ProjectTwice) run_cmake(VersionAndLanguagesEmpty) run_cmake(VersionEmpty) run_cmake(VersionInvalid) |