2019-11-20 07:54:04 +01:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2020-09-04 20:54:39 +02:00
|
|
|
project(stc_rpncalc C CXX)
|
2019-04-03 06:07:15 +02:00
|
|
|
# 3rd party tools
|
|
|
|
find_package(Qt5 COMPONENTS Widgets Qml Quick REQUIRED)
|
2019-04-04 06:33:42 +02:00
|
|
|
|
2020-09-09 19:06:49 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
2020-10-12 22:15:39 +02:00
|
|
|
message(STATUS "using address sanitizer")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
|
|
|
link_libraries(asan)
|
2020-09-09 19:06:49 +02:00
|
|
|
endif()
|
|
|
|
|
2020-09-05 10:55:54 +02:00
|
|
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (for tests debug make sense)")
|
|
|
|
|
2019-11-14 08:40:07 +01:00
|
|
|
# Compiler warnings
|
|
|
|
if(MSVC)
|
2020-10-12 22:15:39 +02:00
|
|
|
add_compile_options(/W4 /WX)
|
2019-11-14 08:40:07 +01:00
|
|
|
else()
|
2020-10-12 22:15:39 +02:00
|
|
|
add_compile_options(-Wall -Wextra -pedantic)
|
2019-11-14 08:40:07 +01:00
|
|
|
endif()
|
2019-04-04 06:33:42 +02:00
|
|
|
|
2020-10-12 22:15:39 +02:00
|
|
|
# CTest Catch2 tests
|
|
|
|
enable_testing()
|
|
|
|
|
2019-04-03 06:07:15 +02:00
|
|
|
# Directory with source code
|
|
|
|
add_subdirectory(src)
|
|
|
|
add_subdirectory(qt_gui)
|
|
|
|
|