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,23 +1,19 @@
set(SRCS
renderer_base.cpp
renderer_opengl/gl_shader_util.cpp
renderer_opengl/gl_state.cpp
renderer_opengl/renderer_opengl.cpp
video_core.cpp
)
add_library(video_core STATIC
renderer_base.cpp
renderer_base.h
renderer_opengl/gl_resource_manager.h
renderer_opengl/gl_shader_util.cpp
renderer_opengl/gl_shader_util.h
renderer_opengl/gl_state.cpp
renderer_opengl/gl_state.h
renderer_opengl/renderer_opengl.cpp
renderer_opengl/renderer_opengl.h
utils.h
video_core.cpp
video_core.h
)
set(HEADERS
renderer_base.h
renderer_opengl/gl_resource_manager.h
renderer_opengl/gl_shader_util.h
renderer_opengl/gl_state.h
renderer_opengl/renderer_opengl.h
utils.h
video_core.h
)
create_target_directory_groups(video_core)
create_directory_groups(${SRCS} ${HEADERS})
add_library(video_core STATIC ${SRCS} ${HEADERS})
target_link_libraries(video_core PUBLIC common core)
target_link_libraries(video_core PRIVATE glad)