Use target_sources.

This commit is contained in:
tastytea 2020-01-03 15:58:41 +01:00
parent fd7c2b3a04
commit 2ec7809a7d
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 5 additions and 2 deletions

View File

@ -1,9 +1,12 @@
include(GNUInstallDirs)
add_library(${PROJECT_NAME})
file(GLOB_RECURSE sources_lib *.cpp)
file(GLOB_RECURSE headers_lib ../include/*.hpp)
add_library(${PROJECT_NAME} "${sources_lib}" "${headers_lib}")
target_sources(${PROJECT_NAME}
PRIVATE "${sources_lib}"
PUBLIC "${headers_lib}")
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}