63 lines
1.7 KiB
CMake
63 lines
1.7 KiB
CMake
cmake_minimum_required(VERSION 3.28)
|
|
|
|
# define project metadata
|
|
|
|
project(iue-modules LANGUAGES CXX C
|
|
DESCRIPTION "modules"
|
|
HOMEPAGE_URL "https://sgit.iue.tuwien.ac.at/360050/modules")
|
|
|
|
# setting required language standards
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_C_STANDARD_REQUIRED True)
|
|
set(CMAKE_C_EXTENSIONS OFF)
|
|
|
|
# misc settings
|
|
|
|
# avoid ctest-dashboard spcific targets
|
|
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
|
|
# generate a compile_commands.json
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
# make all symbols visible on windows (which is default on unix)
|
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
|
|
|
# options
|
|
|
|
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
|
|
option(BUILD_TESTING "enable testing with ctest" ON)
|
|
|
|
# external dependencies
|
|
|
|
#find_package(OpenMP COMPONENTS C CXX REQUIRED)
|
|
|
|
# testing
|
|
|
|
include(CTest)
|
|
|
|
# include modules in order of dependence
|
|
|
|
add_subdirectory(iue-other)
|
|
add_subdirectory(iue-io)
|
|
add_subdirectory(iue-po)
|
|
add_subdirectory(iue-num)
|
|
add_subdirectory(iue-rnd)
|
|
add_subdirectory(iue-svg)
|
|
|
|
# packaging for consuming an install-tree via find_package
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/iue-modules-config.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/iue-modules-config.cmake
|
|
INSTALL_DESTINATION "./"
|
|
)
|
|
|
|
install(FILES
|
|
"${CMAKE_CURRENT_BINARY_DIR}/iue-modules-config.cmake"
|
|
DESTINATION "./"
|
|
)
|