summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2021-12-06 12:22:58 +0100
committerSimon McVittie <smcv@collabora.com>2021-12-10 14:16:52 +0000
commit77375263f5a2eaac8dd2f6708109c519e74a3604 (patch)
treef091fd9811befae60ee70e7391143cb4476f8d41
parent203e8a4d757e38d3ff3ddc9acfb608028249e3c6 (diff)
downloaddbus-77375263f5a2eaac8dd2f6708109c519e74a3604.tar.gz
cmake: add option ENABLE_VERBOSE_CONFIG
Checking the filenames of generated configuration files is now optionally possible with this cmake option. They are no longer displayed by default to avoid unnecessarily flooding the output.
-rw-r--r--CMakeLists.txt1
-rw-r--r--README.cmake3
-rw-r--r--test/CMakeLists.txt33
3 files changed, 23 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b57e4e0..c9b3784b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,6 +96,7 @@ endif()
option(DBUS_RELOCATABLE "Attempt to make metadata relocatable" ON)
option(DBUS_ENABLE_PKGCONFIG "Enable pkgconfig support" ON)
+option(ENABLE_VERBOSE_CONFIG "Be verbose on generating config files" OFF)
# For simplicity, we're not relocatable if CMAKE_INSTALL_LIBDIR
# is something more complicated (e.g. Debian multiarch);
diff --git a/README.cmake b/README.cmake
index 1d32302a..a9e4feb7 100644
--- a/README.cmake
+++ b/README.cmake
@@ -158,6 +158,9 @@ ENABLE_SYSTEMD:STRING=AUTO
// Directory for systemd service files
WITH_SYSTEMD_SYSTEMUNITDIR:STRING=
+// Be verbose on generating config files
+ENABLE_VERBOSE_CONFIG:BOOL=OFF
+
// enable user-session semantics for session bus under systemd
ENABLE_USER_SESSION:BOOL=ON
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 20e75d85..4689c78b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -227,7 +227,6 @@ set(TESTDIRS
data/equiv-config-files/entities
data/equiv-config-files/entities/basic.d
)
-set(CONFIG_VERBOSE 1)
foreach(DIR ${TESTDIRS})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
@@ -235,23 +234,32 @@ endforeach()
### copy tests to builddir so that generated tests and static tests
### are all in one place.
-message(STATUS "Copying test files to test directory")
+if(NOT ENABLE_VERBOSE_CONFIG)
+ set(HINT " (use -DENABLE_VERBOSE_CONFIG=ON to see the list of files)")
+endif()
+
+message(STATUS "Copying test files to test directory${HINT}")
+
+macro(dbus_configure_file _src _dest)
+ configure_file(${_src} ${_dest} ${ARGN})
+ if(ENABLE_VERBOSE_CONFIG)
+ message(" generating ${_dest}")
+ endif()
+endmacro()
+
foreach(FILE_TYPE *.message-raw *.auth-script *.sha1 *.txt *.conf *.service)
foreach(DIR ${TESTDIRS})
file(GLOB FILES "${DIR}/${FILE_TYPE}" )
foreach(FILE ${FILES})
get_filename_component(FILENAME ${FILE} NAME)
set(TARGET ${CMAKE_CURRENT_BINARY_DIR}/${DIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} COPYONLY)
- if(CONFIG_VERBOSE)
- message("${FILE}")
- endif()
+ dbus_configure_file(${FILE} ${TARGET} COPYONLY)
endforeach()
endforeach()
endforeach()
### generate test files
-message(STATUS "Generating test files from templates into test directory")
+message(STATUS "Generating test files from templates into test directory${HINT}")
foreach(FILE_TYPE *.conf.in *.service.in)
foreach(DIR ${TESTDIRS})
@@ -260,14 +268,11 @@ foreach(FILE_TYPE *.conf.in *.service.in)
get_filename_component(FILENAME ${FILE} NAME)
string(REGEX REPLACE "\\.in$" "" FILENAME ${FILENAME})
set(TARGET ${CMAKE_CURRENT_BINARY_DIR}/${DIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} @ONLY IMMEDIATE)
- if(CONFIG_VERBOSE)
- message("${FILE}")
- endif()
+ dbus_configure_file(${FILE} ${TARGET} @ONLY IMMEDIATE)
endforeach()
endforeach()
endforeach()
-message(STATUS "Copying generated bus config files to test directory")
-configure_file(../bus/session.conf.in ${CMAKE_BINARY_DIR}/test/data/valid-config-files/session.conf @ONLY)
-configure_file(../bus/system.conf.in ${CMAKE_BINARY_DIR}/test/data/valid-config-files-system/system.conf @ONLY)
+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)