diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1bdff15..1b407ee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,8 +6,8 @@ configure_file("fs-compat.hpp.in" "fs-compat.hpp" @ONLY) # The library is only here for the tests. add_library(${PROJECT_NAME}_lib STATIC) -file(GLOB_RECURSE sources_src *.cpp) -file(GLOB_RECURSE headers_src *.hpp) +file(GLOB sources_src CONFIGURE_DEPENDS *.cpp) +file(GLOB headers_src CONFIGURE_DEPENDS *.hpp) list(REMOVE_ITEM sources_src "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp") target_sources(${PROJECT_NAME}_lib diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index febd11f..1ca00f1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,6 @@ include(CTest) -file(GLOB sources_tests test_*.cpp) +file(GLOB sources_tests CONFIGURE_DEPENDS test_*.cpp) file(COPY "test.zip" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY "test.epub2" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY "test.epub3" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt index 58060b6..8513ad2 100644 --- a/translations/CMakeLists.txt +++ b/translations/CMakeLists.txt @@ -1,6 +1,7 @@ set(potfile "${PROJECT_SOURCE_DIR}/translations/${PROJECT_NAME}.pot") -file(GLOB po_src_files "../src/*pp") -file(GLOB po_src_files_relative RELATIVE "${PROJECT_SOURCE_DIR}" "../src/*pp") +file(GLOB po_src_files CONFIGURE_DEPENDS "../src/*pp") +file(GLOB po_src_files_relative CONFIGURE_DEPENDS + RELATIVE "${PROJECT_SOURCE_DIR}" "../src/*pp") add_custom_command(OUTPUT ${potfile} COMMAND "${XGETTEXT_CMD}" @@ -24,7 +25,7 @@ add_custom_target(${PROJECT_NAME}_pot unset(po_src_files) unset(po_src_files_relative) -file(GLOB po_files "*.po") +file(GLOB po_files CONFIGURE_DEPENDS "*.po") # Hack to prevent GETTEXT_CREATE_TRANSLATIONS from updating the .po files. set(backup_GETTEXT_MSGMERGE_EXECUTABLE ${GETTEXT_MSGMERGE_EXECUTABLE})