|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
# User config between these lines |
|
|
|
|
# ------------------------------------------ |
|
|
|
|
# User config between these lines |
|
|
|
|
|
|
|
|
|
# Set project name |
|
|
|
|
set(PROJECT "stowage") |
|
|
|
@ -16,8 +16,7 @@ add_custom_target(run
|
|
|
|
|
# ------------------------------------------ |
|
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.16 FATAL_ERROR) |
|
|
|
|
|
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
|
|
|
|
project(${PROJECT} CXX) |
|
|
|
|
|
|
|
|
|
# Check if the build should include debugging symbols |
|
|
|
|
option(DEBUG "" ${DEBUG}) |
|
|
|
@ -42,7 +41,19 @@ else()
|
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# Include all headers |
|
|
|
|
# ------------------------------------------ |
|
|
|
|
# Setup C++ compiler |
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17) |
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF) |
|
|
|
|
|
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
|
# Configure source |
|
|
|
|
|
|
|
|
|
# Define include files |
|
|
|
|
include_directories( |
|
|
|
|
"src" |
|
|
|
|
"test" |
|
|
|
@ -59,21 +70,14 @@ set(TEST_SOURCES ${TEST_SOURCES} ${MAIN_SOURCES})
|
|
|
|
|
list(REMOVE_ITEM TEST_SOURCES "${CMAKE_SOURCE_DIR}/src/main.cpp") |
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17) |
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF) |
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
|
|
|
|
|
|
project(${PROJECT} CXX) |
|
|
|
|
# Application target |
|
|
|
|
|
|
|
|
|
add_executable(${PROJECT} ${PROJECT_SOURCES}) |
|
|
|
|
target_link_libraries(${PROJECT}) |
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
|
|
|
|
|
|
project(test CXX) |
|
|
|
|
# ------------------------------------------ |
|
|
|
|
# Unit test target |
|
|
|
|
|
|
|
|
|
add_executable(test ${TEST_SOURCES}) |
|
|
|
|
target_link_libraries(test) |
|
|
|
|