2024-06-10 20:59:01 +08:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
project(ufo VERSION 0 LANGUAGES CXX)
|
|
|
|
enable_testing()
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
|
|
message("Setting build type to 'Release' as none was specified.")
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
|
|
|
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(TBB REQUIRED)
|
|
|
|
find_package(Matplot++ REQUIRED)
|
2024-08-22 22:43:25 +08:00
|
|
|
find_package(biu REQUIRED)
|
|
|
|
find_package(Threads REQUIRED)
|
2024-06-10 20:59:01 +08:00
|
|
|
|
2024-09-12 02:21:20 +08:00
|
|
|
add_executable(ufo src/fold.cpp src/unfold.cpp src/plot.cpp src/main.cpp)
|
2024-08-22 22:43:25 +08:00
|
|
|
target_include_directories(ufo PRIVATE ${PROJECT_SOURCE_DIR}/include)
|
2024-09-12 06:05:27 +08:00
|
|
|
target_link_libraries(ufo PRIVATE TBB::tbb Matplot++::matplot biu::biu)
|
2024-06-10 20:59:01 +08:00
|
|
|
target_compile_features(ufo PRIVATE cxx_std_23)
|
2024-09-12 02:21:20 +08:00
|
|
|
target_compile_options(ufo PRIVATE -fexperimental-library)
|
2024-06-10 20:59:01 +08:00
|
|
|
|
|
|
|
install(TARGETS ufo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
|
|
|
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
|
|
|
|
message("Imported targets: ${ImportedTargets}")
|
|
|
|
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")
|
2024-09-03 15:10:46 +08:00
|
|
|
|
|
|
|
include(CTest)
|
|
|
|
add_test(NAME fold COMMAND ufo fold ${PROJECT_SOURCE_DIR}/test/fold/config.yaml)
|
|
|
|
add_test(NAME fold-compare COMMAND ${CMAKE_COMMAND} -E compare_files fold-output.yaml
|
|
|
|
${PROJECT_SOURCE_DIR}/test/fold/output.yaml)
|
|
|
|
set_tests_properties(fold-compare PROPERTIES DEPENDS fold)
|