summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2022-10-29 10:57:37 (GMT)
committerCraig Scott <craig.scott@crascit.com>2022-10-29 11:05:30 (GMT)
commit96d7b5a6d1f789e9cef5fc9316c7caedb5b4d3ea (patch)
treeb4ee66e45a3f33811fe1286c942920b29dc519e8 /Tests
parentafd1b28cea982824ee29994ae7408d6f6ca92d06 (diff)
downloadCMake-96d7b5a6d1f789e9cef5fc9316c7caedb5b4d3ea.zip
CMake-96d7b5a6d1f789e9cef5fc9316c7caedb5b4d3ea.tar.gz
CMake-96d7b5a6d1f789e9cef5fc9316c7caedb5b4d3ea.tar.bz2
Tests: pkg_check_modules() doesn't allow spaces in a moduleSpec
The documentation of pkg_check_modules() is a little ambiguous about whether spaces are allowed in a moduleSpec that includes a version constraint. All examples in the docs do not have spaces, so it could be claimed spaces are not supported. The tests fail on Windows when spaces are included, likely because some pkg-config implementations don't support that. Update the tests to not assume spaces are supported as part of a moduleSpec.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake21
1 files changed, 11 insertions, 10 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake
index 2a505c6..f7a9815 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake
@@ -20,14 +20,15 @@ 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)
+cmake_path(CONVERT "${fakePkgDir}/lib/pkgconfig" TO_NATIVE_PATH_LIST confPath)
+set(ENV{PKG_CONFIG_PATH} "${confPath}")
-pkg_check_modules(FakePackageGE REQUIRED QUIET "cmakeinternalfakepackage >= 8")
+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")
+pkg_check_modules(FakePackageGE_FAIL QUIET "cmakeinternalfakepackage>=8.10")
if (FakePackageGE_FAIL_FOUND)
message(FATAL_ERROR "fake package >= 8.10 found")
endif()
@@ -37,17 +38,17 @@ if (NOT FakePackageLE_FOUND)
message(FATAL_ERROR "fake package <= 9 not found")
endif()
-pkg_check_modules(FakePackageLE_FAIL QUIET "cmakeinternalfakepackage <= 8.1")
+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")
+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")
+pkg_check_modules(FakePackageGT_FAIL QUIET "cmakeinternalfakepackage>8.9")
if (FakePackageGT_FAIL_FOUND)
message(FATAL_ERROR "fake package > 8.9 found")
endif()
@@ -57,7 +58,7 @@ if (NOT FakePackageLT_FOUND)
message(FATAL_ERROR "fake package < 9 not found")
endif()
-pkg_check_modules(FakePackageLT_FAIL QUIET "cmakeinternalfakepackage < 8.9")
+pkg_check_modules(FakePackageLT_FAIL QUIET "cmakeinternalfakepackage<8.9")
if (FakePackageLT_FAIL_FOUND)
message(FATAL_ERROR "fake package < 8.9 found")
endif()
@@ -67,17 +68,17 @@ if (NOT FakePackageEQ_FOUND)
message(FATAL_ERROR "fake package = 8.9 not found")
endif()
-pkg_check_modules(FakePackageEQ_FAIL QUIET "cmakeinternalfakepackage = 8.8")
+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")
+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")
+pkg_check_modules(FakePackageLLT_INV QUIET "cmakeinternalfakepackage<<=9")
if (FakePackageLLT_FAIL_FOUND)
message(FATAL_ERROR "fake package <<= 9 found")
endif()