Commit a7330a96 authored by Frank Osterfeld's avatar Frank Osterfeld Committed by unknown

generate all config files from the .in files. Set some of the required...

generate all config files from the .in files. Set some of the required variables replaced in the .in files by configure_file (cherry picked from commit 4980ffa1093877af182e032a13f6162df57be09f)
parent 115891d3
......@@ -494,6 +494,14 @@ else(splitlib AND MSVC)
set(DBUS_1 dbus-1)
endif(splitlib AND MSVC)
if (DBUS_BUILD_TESTS)
# set variables used for the .in files (substituted by configure_file) in test/data:
set(TEST_VALID_SERVICE_DIR ${CMAKE_BINARY_DIR}/test/data/valid-service-files)
set(TEST_VALID_SERVICE_SYSTEM_DIR ${CMAKE_BINARY_DIR}/test/data/valid-service-files-system)
# TODO: TEST_SOCKET_DIR
# TODO: TEST_LAUNCH_HELPER_BINARY
endif (DBUS_BUILD_TESTS)
########### subdirs ###############
add_subdirectory( dbus )
......
......@@ -178,11 +178,30 @@ FOREACH(FILE_TYPE *.message *.message-raw *.auth-script *.sha1 *.txt *.conf *.se
ENDFOREACH(DIR)
ENDFOREACH(FILE_TYPE)
### generate test files
SET (CONFIG_FILES test/data/valid-config-files)
configure_file(${CMAKE_SOURCE_DIR}/${CONFIG_FILES}/debug-allow-all-sha1.conf.cmake ${CMAKE_BINARY_DIR}/${CONFIG_FILES}/debug-allow-all-sha1.conf )
configure_file(${CMAKE_SOURCE_DIR}/${CONFIG_FILES}/debug-allow-all.conf.cmake ${CMAKE_BINARY_DIR}/${CONFIG_FILES}/debug-allow-all.conf )
FOREACH(FILE_TYPE *.conf.in *.service.in)
FOREACH(DIR ${TESTDIRS})
FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${DIR}/${FILE_TYPE}" )
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
FOREACH(FILE ${FILES})
GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
STRING(REGEX REPLACE "\\.in$" "" FILENAME ${FILENAME})
SET (TARGET ${CMAKE_BINARY_DIR}/${DIR}/${FILENAME})
configure_file(${FILE} ${TARGET} @ONLY IMMEDIATE)
IF (CONFIG_VERBOSE)
MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
ENDIF (CONFIG_VERBOSE)
ENDFOREACH(FILE)
ENDFOREACH(DIR)
ENDFOREACH(FILE_TYPE)
# (rh) disabled copying because bus-test could not parse this files for unknown reasons
FILE(GLOB FILES "${CMAKE_BINARY_DIR}/bus/*.conf" )
FOREACH(FILE ${FILES})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment