CMakeLists: Derive the source directory grouping from targets themselves

Removes the need to store to separate SRC and HEADER variables, and then
construct the target in most cases.
This commit is contained in:
Lioncash 2018-01-17 19:37:34 -05:00
parent ee08c39b72
commit e710a1b989
11 changed files with 361 additions and 389 deletions

View file

@ -1,11 +1,9 @@
set(SRCS
getopt.c
)
set(HEADERS
getopt.h
)
add_library(getopt
getopt.c
getopt.h
)
create_target_directory_groups(getopt)
create_directory_groups(${SRCS} ${HEADERS})
add_library(getopt ${SRCS} ${HEADERS})
target_compile_definitions(getopt PUBLIC STATIC_GETOPT)
target_include_directories(getopt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})