RSE-Model/RSEModel/CMakeLists.txt
JackCarterSmith e10e74b8a1
Finished standard lib implement
> static and dynamic linking... Need proper dynamic config
> Standalone app basis... Need more rework
> CMake proper install
2022-08-12 22:19:57 +02:00

46 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})
# Define src/headers files
file(GLOB_RECURSE RSE_MOD_SOURCES ./src/*.c)
source_group("Source Files" FILES ${RSE_MOD_SOURCES})
# Building instructions for RSE-Model
if(DEFINED ENV{CI})
set(CMAKE_BUILD_TYPE RELEASE)
endif()
# Declare standalone application
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}/src)
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 rsp-model-libstatic ${GLEW_LIBRARIES})
else()
target_link_libraries(rse-model PRIVATE rsp-model-libstatic ${GLEW_LIBRARIES} m)
endif()