1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-30 21:51:12 +02:00

add CONFIGURE_DEPENDS to glob sources

This commit is contained in:
Lars Melchior 2020-04-14 14:47:26 +02:00
parent 7a8809648c
commit 83ef03c7df
3 changed files with 4 additions and 4 deletions

View file

@ -18,8 +18,8 @@ endif()
# Note: globbing sources is considered bad practice as CMake won't detect new files automatically.
# Remember to always invoke cmake after changing files, or explicitly mention them here.
FILE(GLOB_RECURSE headers "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
FILE(GLOB_RECURSE sources "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
FILE(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
FILE(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
# ---- Add dependencies via CPM ----
# see https://github.com/TheLartians/CPM.cmake for more info

View file

@ -24,7 +24,7 @@ CPMAddPackage(
# ---- Create standalone executable ----
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
add_executable(GreeterStandalone ${sources})

View file

@ -37,7 +37,7 @@ CPMAddPackage(
# ---- Create binary ----
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
add_executable(GreeterTests ${sources})
target_link_libraries(GreeterTests doctest Greeter)