59 lines
1.3 KiB
CMake
59 lines
1.3 KiB
CMake
#debian stable (currently bullseye)
|
|
cmake_minimum_required(VERSION 3.18)
|
|
|
|
project(tug CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
find_package(Eigen3 REQUIRED NO_MODULE)
|
|
find_package(OpenMP)
|
|
# find_package(easy_profiler)
|
|
# option(EASY_OPTION_LOG "Verbose easy_profiler" 1)
|
|
|
|
## SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -mfma")
|
|
option(TUG_USE_OPENMP "Compile with OpenMP support" ON)
|
|
|
|
set(CMAKE_CXX_FLAGS_GENERICOPT "-O3 -march=native" CACHE STRING
|
|
"Flags used by the C++ compiler during opt builds."
|
|
FORCE)
|
|
|
|
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel GenericOpt."
|
|
FORCE)
|
|
|
|
option(TUG_USE_UNSAFE_MATH_OPT
|
|
"Use compiler options to break IEEE compliances by
|
|
oenabling reordering of instructions when adding/multiplying of floating
|
|
points."
|
|
OFF)
|
|
|
|
if(TUG_USE_UNSAFE_MATH_OPT)
|
|
add_compile_options(-ffast-math)
|
|
endif()
|
|
|
|
option(TUG_ENABLE_TESTING
|
|
"Run tests after succesfull compilation"
|
|
OFF)
|
|
|
|
option(TUG_HANNESPHILIPP_EXAMPLES
|
|
"Compile example applications"
|
|
OFF)
|
|
|
|
option(TUG_NAAICE_EXAMPLE
|
|
"Enables NAAICE examples with export of CSV files"
|
|
OFF)
|
|
|
|
add_subdirectory(src)
|
|
|
|
if(TUG_ENABLE_TESTING)
|
|
add_subdirectory(test)
|
|
endif()
|
|
|
|
if(TUG_HANNESPHILIPP_EXAMPLES)
|
|
add_subdirectory(examples)
|
|
endif()
|
|
|
|
if (TUG_NAAICE_EXAMPLE)
|
|
add_subdirectory(naaice)
|
|
endif()
|