2016-11-30 13:32:06 +00:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
project(Indivisible)
|
|
|
|
|
2016-11-30 21:20:46 +00:00
|
|
|
cmake_policy(SET CMP0012 OLD)
|
|
|
|
|
2016-11-30 13:32:06 +00:00
|
|
|
set(TARGET_NAME indivisible)
|
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
endif()
|
|
|
|
|
2016-12-02 15:31:12 +00:00
|
|
|
set(CMAKE_MODULE_PATH
|
|
|
|
${CMAKE_MODULE_PATH}
|
|
|
|
${CMAKE_SOURCE_DIR}/cmake/)
|
|
|
|
|
2016-11-30 21:20:46 +00:00
|
|
|
find_package(OpenMP REQUIRED)
|
2016-12-02 15:31:12 +00:00
|
|
|
find_package(GMP REQUIRED)
|
2016-11-30 21:20:46 +00:00
|
|
|
|
2016-11-30 13:32:06 +00:00
|
|
|
set(SRCS
|
|
|
|
src/Main.cpp)
|
|
|
|
|
2016-12-02 14:55:29 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "-std=c++11 ${OpenMP_CXX_FLAGS} -fno-elide-constructors -pedantic-errors -Wall -Wextra -Werror -Wpedantic -Winit-self -Wmissing-declarations -Wuninitialized -Wfatal-errors")
|
2016-11-30 13:32:06 +00:00
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -O0")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -g -O3")
|
|
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -Os")
|
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE MATCHES Debug AND NOT CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
|
|
|
add_definitions(-DNDEBUG)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(${TARGET_NAME} ${SRCS})
|