# CMakeLists.txt #################################################### # Written by JackCarterSmith, 2022 # This code is released under the RSE license. #################################################### # General library configuration if(DEFINED ENV{MS_COMPATIBLE}) set(CMAKE_GNUtoMS ON) # Enable compatibility level to exported libraries endif() include(CheckIncludeFile) include(CheckCSourceCompiles) # Push compile infos to source configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY) # Define src/headers files FILE(GLOB_RECURSE RSP_MOD_SOURCES ./src/*.c) SOURCE_GROUP("Source Files" FILES ${RSP_MOD_SOURCES}) # Building instructions for RSE-Model if(DEFINED ENV{CI}) set(CMAKE_BUILD_TYPE RELEASE) endif() add_library(rsp-model-lib ${RSP_MOD_SOURCES}) set_property(TARGET rsp-model-lib PROPERTY C_STANDARD 90) target_include_directories(rsp-model-lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) set_target_properties(rsp-model-lib PROPERTIES OUTPUT_NAME ${RSP_MODEL_LIB_NAME}) # Link externals libraries to the linker if(MSVC) # msvc does not append 'lib' - do it here to have consistent name set_target_properties(rsp-model-lib PROPERTIES PREFIX "lib") endif()