2019-10-21 17:23:07 +02:00
|
|
|
cmake_minimum_required(VERSION 3.7.2)
|
2019-10-16 16:52:36 +02:00
|
|
|
|
2019-10-24 13:19:17 +02:00
|
|
|
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
|
|
|
message(FATAL_ERROR "In-source builds are disabled.
|
|
|
|
Please create a subfolder called build and use `cmake ..` inside it.
|
|
|
|
NOTE: cmake will now create CMakeCache.txt and CMakeFiles/*.
|
|
|
|
You must delete them, or cmake will refuse to work.")
|
|
|
|
endif()
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "bin" "doc" "CMakeFiles" "lib" "include")
|
|
|
|
|
|
|
|
|
2019-10-16 16:52:36 +02:00
|
|
|
project(GUI)
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
2019-11-16 19:27:16 +01:00
|
|
|
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;")
|
|
|
|
set(CMAKE_CXX_CLANG_TIDY clang-tidy;-header-filter=.;)
|
2019-10-24 13:19:17 +02:00
|
|
|
|
|
|
|
file(GLOB_RECURSE SOURCES src/*.cpp)
|
2019-11-16 19:27:16 +01:00
|
|
|
file(GLOB_RECURSE HEADERS src/*.hpp)
|
2019-10-24 13:19:17 +02:00
|
|
|
file(GLOB_RECURSE TESTS test/*.cpp)
|
|
|
|
|
|
|
|
set(LIB_PATH "${CMAKE_SOURCE_DIR}/../library")
|
|
|
|
|
|
|
|
include_directories(${LIB_PATH}/include)
|
2019-11-18 14:56:11 +01:00
|
|
|
add_executable(GUI ${SOURCES} ${HEADERS} main/main.cpp src/Statusbar.cpp src/GUI_Window.cpp src/Image.cpp src/GUI.hpp src/GUI.cpp)
|
2019-10-16 16:52:36 +02:00
|
|
|
|
2019-10-24 13:19:17 +02:00
|
|
|
target_link_libraries(GUI ${LIB_PATH}/lib/liblibrary.a)
|
|
|
|
|
2019-10-23 13:32:13 +02:00
|
|
|
set(FLTK_SKIP_FLUID true)
|
2019-11-27 12:18:11 +01:00
|
|
|
if(FALSE)
|
|
|
|
include_directories(../fltk-1.3.5/FL)
|
|
|
|
link_directories(${PROJECT_NAME} ../fltk-1.3.5/lib)
|
|
|
|
target_link_libraries(${PROJECT_NAME} fltk)
|
|
|
|
else()
|
2019-10-23 13:32:13 +02:00
|
|
|
find_package(FLTK REQUIRED)
|
|
|
|
include_directories(${FLTK_INCLUDE_DIR})
|
2019-10-26 16:39:25 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES} ${OPENGL_LIBRARIES})
|
2019-11-27 12:18:11 +01:00
|
|
|
endif()
|
2019-10-16 16:52:36 +02:00
|
|
|
|
2019-10-24 13:19:17 +02:00
|
|
|
enable_testing()
|
|
|
|
find_package(Catch2 REQUIRED)
|
|
|
|
add_executable(UnitTests ${SOURCES} ${HEADERS} ${TESTS})
|
|
|
|
target_link_libraries(UnitTests Catch2::Catch2)
|
|
|
|
|
|
|
|
include(CTest)
|
|
|
|
include(Catch)
|
|
|
|
catch_discover_tests(UnitTests)
|
2019-10-16 16:52:36 +02:00
|
|
|
|