-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
41 lines (32 loc) · 1.48 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
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.0)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
project(rgb)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CXX_COMPILER_VERSION VERSION_LESS 4.7)
message(STATUS "GCC version must be at least 4.7!")
endif()
set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -fcilkplus -O3 -lm -DNDEBUG -std=c++17 -DHAVE_CXX0X -march=native")
set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -fcilkplus -ggdb -lm -std=c++17 -DHAVE_CXX0X -march=native")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CXX_COMPILER_VERSION VERSION_LESS 4.2.1)
message(STATUS "Clang version must be at least 4.2.1!" )
endif()
set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -fcilkplus -O3 -DNDEBUG -std=c++17 -DHAVE_CXX0X -msse4.1 -march=native")
set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -fcilkplus -ggdb -std=c++17 -DHAVE_CXX0X -msse4.1 -march=native")
else ()
message(FATAL_ERROR "Please, use GCC or Clang compiler!")
endif()
include_directories(include)
add_library(rgb INTERFACE)
target_include_directories(rgb INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
)
include(external/external.cmake)
add_subdirectory(src)
enable_testing()
add_subdirectory(test)