-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (28 loc) · 1 KB
/
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
32
33
cmake_minimum_required(VERSION "3.12")
project("HelloWorld" VERSION 0.3.0)
add_library(sse sse/sse.cpp)
set_target_properties(sse PROPERTIES PUBLIC_HEADER sse/sse.hpp)
# Set up library includes
target_include_directories(sse
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/helloworld
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/helloworld>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/helloworld>
)
add_executable(helloworld main.cpp)
target_link_libraries(helloworld PRIVATE sse)
# Create install targets
include(GNUInstallDirs)
install(TARGETS helloworld sse
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/helloworld
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/helloworld
)
# Packaging section
# Adding other cmake modules
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Include our packaging module
include(Packaging)