-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (25 loc) · 994 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
32
33
cmake_minimum_required (VERSION 3.7.2)
project (netstore-2 CXX)
find_package ( Threads REQUIRED )
find_package ( Boost COMPONENTS program_options filesystem REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})
#set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -O2 -std=c++17 -l stdc++fs")
add_library(nssockets src/sockets.cc)
add_library(nsaux src/aux.cc)
add_library(nscmd src/cmd.cc)
target_link_libraries(nsaux stdc++fs)
target_link_libraries(nssockets stdc++fs)
# http://stackoverflow.com/questions/10555706/
macro (add_executable _name)
# invoke built-in add_executable
_add_executable(${ARGV})
if (TARGET ${_name})
target_link_libraries(${_name} ${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES} stdc++fs nssockets nsaux nscmd)
endif()
endmacro()
add_executable(netstore-server src/server.cc)
add_executable(netstore-client src/client.cc)
install(TARGETS DESTINATION .)