-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
31 lines (28 loc) · 885 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
add_library(Bar "")
target_sources(Bar
PRIVATE
include/bar/Bar.hpp
src/Bar.cpp)
target_include_directories(Bar
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
#target_compile_features(Bar PUBLIC cxx_std_17)
set_target_properties(Bar PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
PUBLIC_HEADER include/bar/Bar.hpp)
#target_link_libraries(Bar PUBLIC ...)
add_library(${PROJECT_NAMESPACE}::Bar ALIAS Bar)
add_subdirectory(tests)
# Install
include(GNUInstallDirs)
install(TARGETS Bar
EXPORT ${PROJECT_NAME}Targets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/bar
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
#RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)