You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1010 B
CMake
44 lines
1010 B
CMake
|
|
cmake_minimum_required(VERSION 3.10.0)
|
|
project("SurfaceGrid" VERSION 0.1.0)
|
|
|
|
set(3RD_ROOT_PATH "${CMAKE_SOURCE_DIR}/3rd" CACHE STRING "Root path for 3rd libs which needed by SurfaceGrid")
|
|
|
|
# release type
|
|
if(CMAKE_BUILD_TYPE=="")
|
|
message("DEBUG build for default")
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
|
|
endif()
|
|
|
|
# set c++ standard to C++17 and close extensions
|
|
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
message(STATUS "Compiling with C++ standard: ${CMAKE_CXX_STANDARD}")
|
|
endif()
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
|
|
|
|
if (UNIX)
|
|
# third party
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
find_package(Threads REQUIRED)
|
|
elseif(WIN32)
|
|
add_compile_options("/wd4251")
|
|
# third party
|
|
endif()
|
|
|
|
# enable testing
|
|
option(TESTING "Enable Testing" ON)
|
|
|
|
# third party
|
|
set(THIRD_INC_PATH
|
|
"${3RD_ROOT_PATH}/catch"
|
|
INTERNAL)
|
|
|
|
add_subdirectory(lib)
|
|
add_subdirectory(examples)
|
|
add_subdirectory(tests)
|