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:
parent
7a8809648c
commit
83ef03c7df
3 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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})
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue