OpenMiner/CMakeLists.txt

78 lines
2.2 KiB
CMake
Raw Permalink Normal View History

#------------------------------------------------------------------------------
# CMakeLists.txt
#------------------------------------------------------------------------------
2018-06-13 17:49:56 -07:00
cmake_minimum_required(VERSION 3.1)
2015-02-15 08:36:03 -08:00
project(openminer)
2015-02-15 08:36:03 -08:00
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2015-02-15 08:36:03 -08:00
2020-05-11 08:30:54 -07:00
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if (APPLE)
add_definitions(-DGL_SILENCE_DEPRECATION=1)
endif ()
2020-03-17 12:35:21 -07:00
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
2020-07-13 14:25:04 -07:00
set(OM_BUILD_TESTS ON CACHE BOOL "Enable building tests if CxxTest is available")
include_directories(external)
2020-02-14 01:36:45 -08:00
#------------------------------------------------------------------------------
# Compiler flags
#------------------------------------------------------------------------------
2021-06-09 09:37:53 -07:00
set(DEBUG_GCC_FLAGS
-g -Og
-Wall -Wextra -Wconversion -Wno-unused-parameter
-Wfatal-errors
-DGK_DEBUG
2021-06-10 06:05:55 -07:00
-DOM_PROFILER_ENABLED
2021-06-09 09:37:53 -07:00
)
set(RELEASE_GCC_FLAGS
-O3
-Wall -Wextra -Wconversion -Wno-unused-parameter
-Wfatal-errors
)
set(RELWITHDEB_GCC_FLAGS
-g -O3
-Wall -Wextra -Wconversion -Wno-unused-parameter
-Wfatal-errors
)
2020-02-14 01:36:45 -08:00
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CLANG_FLAGS
-Wno-sign-conversion
-Wno-implicit-int-float-conversion
-Wno-nested-anon-types
)
endif()
2020-04-12 05:38:26 -07:00
set(CMAKE_CXX_STANDARD 17)
2020-02-14 01:36:45 -08:00
#------------------------------------------------------------------------------
# Setting default build type
#------------------------------------------------------------------------------
set(DEFAULT_BUILD_TYPE RelWithDebInfo)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#------------------------------------------------------------------------------
# Subdirectories
#------------------------------------------------------------------------------
add_subdirectory(external)
2020-03-17 12:35:21 -07:00
add_subdirectory(source/common)
add_subdirectory(source/server)
add_subdirectory(source/client)
add_subdirectory(tests)