summaryrefslogtreecommitdiff
path: root/bus
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 /bus
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 'bus')
-rw-r--r--bus/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/bus/CMakeLists.txt b/bus/CMakeLists.txt
index dafee593..febfaeb0 100644
--- a/bus/CMakeLists.txt
+++ b/bus/CMakeLists.txt
@@ -18,7 +18,7 @@ set(SERVICE_FILES test/data/valid-service-files)
file(GLOB FILES "${SERVICE_FILES}/*.service.in" )
foreach(FILE ${FILES})
get_filename_component(FILENAME ${FILE} NAME_WE)
- set(TARGET ${CMAKE_BINARY_DIR}/data/dbus-1/services/${FILENAME}.service)
+ set(TARGET ${PROJECT_BINARY_DIR}/data/dbus-1/services/${FILENAME}.service)
if(CONFIG_VERBOSE)
message("FROM: ${FILE}\nTO: ${TARGET}\n")
endif()
@@ -84,7 +84,7 @@ if(DBUS_ENABLE_STATS)
endif()
include_directories(
- ${CMAKE_BINARY_DIR}
+ ${PROJECT_BINARY_DIR}
${EXPAT_INCLUDE_DIR}
)