39 lines
1.2 KiB
CMake
39 lines
1.2 KiB
CMake
# 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}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h @ONLY)
|
|
|
|
|
|
# Define src/headers files
|
|
FILE(GLOB_RECURSE RSP_MOD_SOURCES ./*.c)
|
|
SOURCE_GROUP("Source Files" FILES ${RSP_MOD_SOURCES})
|
|
|
|
|
|
# Building instructions for RSE-Model
|
|
if(DEFINED ENV{RSE-WS})
|
|
set(CMAKE_BUILD_TYPE DEBUG)
|
|
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})
|
|
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()
|