Skip to content

Commit 9850810

Browse files
committed
Step 1
1 parent a2f1a49 commit 9850810

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

CMakeLists.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
cmake_minimum_required(VERSION "3.12")
22

3-
project("HelloWorld")
3+
project("HelloWorld" VERSION 0.1.0)
4+
5+
add_library(sse sse/sse.cpp)
6+
set_target_properties(sse PROPERTIES PUBLIC_HEADER sse/sse.hpp)
7+
# Set up library includes
8+
target_include_directories(sse
9+
PRIVATE
10+
${CMAKE_CURRENT_SOURCE_DIR}/helloworld
11+
PUBLIC
12+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/helloworld>
13+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/helloworld>
14+
)
415

516
add_executable(helloworld main.cpp)
17+
target_link_libraries(helloworld PRIVATE sse)
18+
19+
# Create install targets
20+
include(GNUInstallDirs)
21+
install(TARGETS helloworld sse
22+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
23+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
24+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
25+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/helloworld
26+
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/helloworld
27+
)

main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#include <iostream>
22

3+
#include "sse/sse.hpp"
4+
35
int main(int argc, char *argv[])
46
{
57
std::cout << "Hello World!" << std::endl;
8+
sse();
69
return 0;
710
}

0 commit comments

Comments
 (0)