List sublibraries automatically & create a top target that depends on everything

This commit is contained in:
Nikita Lisitsa 2020-08-27 15:30:43 +03:00
parent 549f2ada41
commit a2b1d90c48
2 changed files with 18 additions and 5 deletions

View file

@ -11,3 +11,7 @@ if(PSEMEK_BUILD_TYPE STREQUAL "DEBUG")
endif()
add_subdirectory(libs)
add_library(psemek todo.md)
target_link_libraries(psemek INTERFACE ${PSEMEK_LIBRARIES})
set_target_properties(psemek PROPERTIES LINKER_LANGUAGE CXX)

View file

@ -1,5 +1,14 @@
add_subdirectory(util)
add_subdirectory(geom)
add_subdirectory(cg)
add_subdirectory(pcg)
add_subdirectory(gfx)
set(PSEMEK_LIBRARIES
util
geom
cg
pcg
gfx
)
file(GLOB PSEMEK_LIBRARIES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
list(REMOVE_ITEM PSEMEK_LIBRARIES "CMakeLists.txt")
foreach(lib ${PSEMEK_LIBRARIES})
add_subdirectory(${lib})
endforeach()