69 lines
2.5 KiB
CMake
69 lines
2.5 KiB
CMake
# - LF GL ---------------------------------------------------------------------
|
|
|
|
cmake_minimum_required(VERSION 3.17)
|
|
|
|
project(lf_gl VERSION 0.9 LANGUAGES C CXX)
|
|
|
|
#--- set a default build type if none was specified ---------------------------
|
|
set(default_build_type "Release")
|
|
|
|
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
|
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
|
STRING "Choose the type of build." FORCE)
|
|
# Set the possible values of build type for cmake-gui
|
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
|
endif ()
|
|
|
|
#--- check for boost ----------------------------------------------------------
|
|
find_package(Boost REQUIRED
|
|
COMPONENTS
|
|
system
|
|
filesystem
|
|
)
|
|
message(STATUS "Boost libs: ${Boost_LIBRARIES}")
|
|
|
|
#--- check for gsl ------------------------------------------------------------
|
|
find_package(GSL REQUIRED)
|
|
|
|
#--- write summary of the installation
|
|
cmake_host_system_information(RESULT PROCESSOR QUERY PROCESSOR_DESCRIPTION)
|
|
|
|
message("")
|
|
message("|-----------------------------------------------------------------------|")
|
|
message("| |")
|
|
message("| Summary |")
|
|
message("| |")
|
|
message("|-----------------------------------------------------------------------|")
|
|
message("")
|
|
message(" System: ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} - ${CMAKE_HOST_SYSTEM_VERSION}")
|
|
message(" Processor: ${PROCESSOR} (${CMAKE_SYSTEM_PROCESSOR})")
|
|
message(" ----------")
|
|
message("")
|
|
message(" lf_gl Version: ${lf_gl_VERSION}")
|
|
message(" --------------")
|
|
message("")
|
|
message(" Build Type: ${CMAKE_BUILD_TYPE}")
|
|
message(" -----------")
|
|
message("")
|
|
message("-------------------------------------------------------------------------")
|
|
message("")
|
|
message(" GSL found in ${GSL_INCLUDE_DIRS}, Version: ${GSL_VERSION}")
|
|
message(" BOOST found in ${Boost_INCLUDE_DIRS}, Version: ${Boost_VERSION}")
|
|
message("")
|
|
message("-------------------------------------------------------------------------")
|
|
message("")
|
|
|
|
add_executable(lf_gl
|
|
main.cpp
|
|
PGKT_LF.cpp
|
|
)
|
|
set_property(TARGET lf_gl PROPERTY CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
target_include_directories(lf_gl
|
|
BEFORE PRIVATE
|
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
|
)
|
|
target_link_libraries(lf_gl -lm GSL::gsl)
|