RSE-Model/RSEModel/CMakeLists.txt

44 lines
1.4 KiB
CMake

# CMakeLists.txt
####################################################
# Written by JackCarterSmith, 2022
# This code is released under the RSE license.
####################################################
# General configuration
include(CheckIncludeFile)
include(CheckCSourceCompiles)
add_definitions(-DCONF_NO_GL) # Used for obj-lib to not compile GL part
# Import needed packages and references their include path
#find_package(GLEW REQUIRED) # Enable when GL rendering is ready
#include_directories(${GLEW_INCLUDE_DIR})
# 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 RSE_MOD_SOURCES ./*.c)
SOURCE_GROUP("Source Files" FILES ${RSE_MOD_SOURCES})
# Building instructions for RSE-Model
if(DEFINED ENV{RSE-WS})
set(CMAKE_BUILD_TYPE DEBUG)
endif()
add_executable(rse-model ${RSE_MOD_SOURCES})
set_property(TARGET rse-model PROPERTY C_STANDARD 90)
target_include_directories(rse-model PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(rse-model PROPERTIES OUTPUT_NAME ${RSE_MODEL_NAME})
# Link externals libraries to the linker
if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name
set_target_properties(rse-model PROPERTIES IMPORT_PREFIX "lib")
target_link_libraries(rse-model PRIVATE ${GLEW_LIBRARIES} rsp-model-lib)
else()
target_link_libraries(rse-model PRIVATE ${GLEW_LIBRARIES} m rsp-model-lib)
endif()