2022-11-24 02:08:04 +01:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2020-09-03 13:05:49 +02:00
|
|
|
|
2022-11-24 02:08:04 +01:00
|
|
|
project(cnorxz)
|
2017-02-17 18:10:03 +01:00
|
|
|
|
2020-09-03 13:05:49 +02:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
|
|
|
|
message(FATAL_ERROR "require gcc version >= 7.0")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(WARNING "compiler ${CMAKE_CXX_COMPILER_ID} officially not supported")
|
|
|
|
endif()
|
|
|
|
|
2022-12-04 21:57:18 +01:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++17 -Wpedantic -O2 -march=native -faligned-new -funroll-loops -fopenmp")
|
2020-09-03 13:05:49 +02:00
|
|
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14 -g -Wpedantic -Ofast -march=native -faligned-new -funroll-loops -fopenmp -ftemplate-backtrace-limit=0")
|
2019-05-17 15:10:33 +02:00
|
|
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14 -g -Wpedantic -O0 -march=native -faligned-new -funroll-loops -fopenmp")
|
2017-02-17 18:10:03 +01:00
|
|
|
|
2017-03-23 21:05:40 +01:00
|
|
|
enable_testing()
|
|
|
|
|
2018-11-05 15:43:31 +01:00
|
|
|
if(IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
|
|
|
set(INSTALL_PATH ${CMAKE_INSTALL_PREFIX})
|
|
|
|
else()
|
|
|
|
#set(INSTALL_PATH ${CMAKE_SOURCE_DIR}/install)
|
|
|
|
get_filename_component(INSTALL_PATH ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX} ABSOLUTE)
|
|
|
|
endif()
|
2022-11-24 02:08:04 +01:00
|
|
|
message(STATUS "found absolute install path '${INSTALL_PATH}'")
|
2018-02-14 16:44:55 +01:00
|
|
|
|
2017-02-17 18:10:03 +01:00
|
|
|
find_package( GTest REQUIRED )
|
|
|
|
if(GTest_FOUND)
|
|
|
|
include_directories(${GTEST_INCLUDE_DIRS})
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "GTest not found")
|
|
|
|
endif()
|
|
|
|
|
2017-11-20 22:30:07 +01:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
if(Threads_FOUND)
|
2017-12-18 14:02:37 +01:00
|
|
|
#include_directories(${Threads_INCLUDE_DIRS})
|
2017-11-20 22:30:07 +01:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Threads not found")
|
|
|
|
endif()
|
|
|
|
|
2018-02-14 16:44:55 +01:00
|
|
|
add_subdirectory(src)
|