summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJordan Williams <jordan@jwillikers.com>2022-07-23 06:21:44 -0500
committerJordan Williams <jordan@jwillikers.com>2022-07-25 14:14:57 -0500
commitfac146f44d235a1c8c810de09c9582a0dd28b406 (patch)
treed3cf0a07fc883e29bfacd3cdc68d33647126d295 /test
parentad5836cb0d24b0f4f35ee6d57392e21570f56689 (diff)
downloaddbus-fac146f44d235a1c8c810de09c9582a0dd28b406.tar.gz
Use project relative paths in CMake files
This makes it possible for projects to incorporate D-Bus as a CMake sub-project in a larger CMake project. Before this PR, doing so would result in many errors. This is because CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR would point to directories above the D-Bus project. Using paths relative to the project directory, PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR, corrects for this.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8ea3bb52..cd338a07 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -242,7 +242,7 @@ set(TESTDIRS
)
foreach(DIR ${TESTDIRS})
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
+ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/${DIR})
endforeach()
### copy tests to builddir so that generated tests and static tests
@@ -287,5 +287,5 @@ foreach(FILE_TYPE *.conf.in *.service.in)
endforeach()
message(STATUS "Copying generated bus config files to test directory${HINT}")
-dbus_configure_file(../bus/session.conf.in ${CMAKE_BINARY_DIR}/test/data/valid-config-files/session.conf @ONLY)
-dbus_configure_file(../bus/system.conf.in ${CMAKE_BINARY_DIR}/test/data/valid-config-files-system/system.conf @ONLY)
+dbus_configure_file(../bus/session.conf.in ${PROJECT_BINARY_DIR}/test/data/valid-config-files/session.conf @ONLY)
+dbus_configure_file(../bus/system.conf.in ${PROJECT_BINARY_DIR}/test/data/valid-config-files-system/system.conf @ONLY)