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 2017-12-10 18:55:03 -05:00
parent 9699194b54
commit ab021d163e
14 changed files with 735 additions and 767 deletions

View file

@ -1,18 +1,14 @@
set(SRCS
network.cpp
packet.cpp
room.cpp
room_member.cpp
)
add_library(network STATIC
network.cpp
network.h
packet.cpp
packet.h
room.cpp
room.h
room_member.cpp
room_member.h
)
set(HEADERS
network.h
packet.h
room.h
room_member.h
)
create_target_directory_groups(network)
create_directory_groups(${SRCS} ${HEADERS})
add_library(network STATIC ${SRCS} ${HEADERS})
target_link_libraries(network PRIVATE common enet)