CMake: Make GLOB work with new files (most of the time).
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Caveats: <https://cmake.org/cmake/help/latest/command/file.html#filesystem>
This commit is contained in:
parent
ea2fbc8dd7
commit
11a8989370
@ -6,8 +6,8 @@ configure_file("fs-compat.hpp.in" "fs-compat.hpp" @ONLY)
|
|||||||
# The library is only here for the tests.
|
# The library is only here for the tests.
|
||||||
add_library(${PROJECT_NAME}_lib STATIC)
|
add_library(${PROJECT_NAME}_lib STATIC)
|
||||||
|
|
||||||
file(GLOB_RECURSE sources_src *.cpp)
|
file(GLOB sources_src CONFIGURE_DEPENDS *.cpp)
|
||||||
file(GLOB_RECURSE headers_src *.hpp)
|
file(GLOB headers_src CONFIGURE_DEPENDS *.hpp)
|
||||||
list(REMOVE_ITEM sources_src "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
|
list(REMOVE_ITEM sources_src "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
|
||||||
|
|
||||||
target_sources(${PROJECT_NAME}_lib
|
target_sources(${PROJECT_NAME}_lib
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
include(CTest)
|
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.zip" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
file(COPY "test.epub2" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
file(COPY "test.epub2" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
file(COPY "test.epub3" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
file(COPY "test.epub3" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
set(potfile "${PROJECT_SOURCE_DIR}/translations/${PROJECT_NAME}.pot")
|
set(potfile "${PROJECT_SOURCE_DIR}/translations/${PROJECT_NAME}.pot")
|
||||||
file(GLOB po_src_files "../src/*pp")
|
file(GLOB po_src_files CONFIGURE_DEPENDS "../src/*pp")
|
||||||
file(GLOB po_src_files_relative RELATIVE "${PROJECT_SOURCE_DIR}" "../src/*pp")
|
file(GLOB po_src_files_relative CONFIGURE_DEPENDS
|
||||||
|
RELATIVE "${PROJECT_SOURCE_DIR}" "../src/*pp")
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${potfile}
|
add_custom_command(OUTPUT ${potfile}
|
||||||
COMMAND "${XGETTEXT_CMD}"
|
COMMAND "${XGETTEXT_CMD}"
|
||||||
@ -24,7 +25,7 @@ add_custom_target(${PROJECT_NAME}_pot
|
|||||||
unset(po_src_files)
|
unset(po_src_files)
|
||||||
unset(po_src_files_relative)
|
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.
|
# Hack to prevent GETTEXT_CREATE_TRANSLATIONS from updating the .po files.
|
||||||
set(backup_GETTEXT_MSGMERGE_EXECUTABLE ${GETTEXT_MSGMERGE_EXECUTABLE})
|
set(backup_GETTEXT_MSGMERGE_EXECUTABLE ${GETTEXT_MSGMERGE_EXECUTABLE})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user