-
-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 877 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
34
35
36
37
38
39
cmake_minimum_required(VERSION 2.8)
project(fifo_map LANGUAGES CXX)
add_executable(unit
src/fifo_map.hpp test/thirdparty/catch/catch.hpp test/unit.cpp
)
target_include_directories(unit PRIVATE "test" "src" "test/thirdparty")
if(MSVC)
set(CMAKE_CXX_FLAGS
"/EHsc"
)
STRING(REPLACE "/O2" "/Od" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
else(MSVC)
set(CMAKE_CXX_FLAGS
"-std=c++11"
)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
endif(MSVC)
include_directories(
src test
)
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(
${PROJECT_NAME}
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/>
)