-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
35 lines (27 loc) · 1.09 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
34
cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
project(punchnat CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(${CMAKE_SYSTEM_NAME} MATCHES "^DragonFly?" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
include_directories("/usr/local/include")
include_directories("/usr/local/include/botan-2")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
include_directories("/usr/pkg/include")
include_directories("/usr/pkg/include/botan-2")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
include_directories("/usr/include/botan-2")
endif()
find_package(Threads REQUIRED)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN)
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
endif()
add_executable(${PROJECT_NAME} src/main.cpp)
add_subdirectory(src)
set_property(TARGET punchnat PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")