]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use generator expression for ccache location (#878)
authorGregor Jasny <gregor.jasny@logmein.com>
Sat, 3 Jul 2021 18:03:34 +0000 (20:03 +0200)
committerGitHub <noreply@github.com>
Sat, 3 Jul 2021 18:03:34 +0000 (20:03 +0200)
With multi-config generators like Xcode the binary is stored
within an extra Debug / Release directory.

Tested with CMake 3.4.3

test/CMakeLists.txt

index 84a9dc1612d335490520dd48803db99040f888de..bb269cfb9b9d77f37d64a237b9b31d45c89b7432 100644 (file)
@@ -7,7 +7,7 @@ function(addtest name)
   set_tests_properties(
     "test.${name}"
     PROPERTIES
-    ENVIRONMENT "CCACHE=${CMAKE_BINARY_DIR}/ccache;EXIT_IF_SKIPPED=true")
+    ENVIRONMENT "CCACHE=$<TARGET_FILE:ccache>;EXIT_IF_SKIPPED=true")
 
   if(${CMAKE_VERSION} VERSION_LESS "3.9")
     # Older CMake versions treat skipped tests as errors. Therefore, resort to