-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
44 lines (36 loc) · 1.11 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
42
43
44
# CMakeLists.txt
#
# Author: Fabian Meyer
# Created On: 23 May 2018
# License: MIT
cmake_minimum_required(VERSION 3.5)
project(lsqcpp)
option(BUILD_TESTS "Enables if tests should be built" OFF)
option(BUILD_EXAMPLES "Enables if examples should be built" OFF)
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
if(MSVC)
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX /wd4127 /wd26495 /wd26451 /wd26812)
else()
# lots of warnings and all warnings as errors
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()
# find OpenMP
find_package(OpenMP)
if(OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif(OPENMP_FOUND)
add_subdirectory(dep)
add_subdirectory(include)
add_subdirectory(cmake)
if(${BUILD_TESTS})
# Compile tests
add_subdirectory(tests)
endif(${BUILD_TESTS})
if(${BUILD_EXAMPLES})
# Compile examples
add_subdirectory(examples)
endif(${BUILD_EXAMPLES})