diff options
Diffstat (limited to 'Tests')
4 files changed, 86 insertions, 2 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/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 () |