Some checks failed
JCS-Prod/RSE-Model/pipeline/head There was a failure building this commit
59 lines
1.9 KiB
CMake
59 lines
1.9 KiB
CMake
# CMakeLists.txt
|
|
|
|
####################################################
|
|
# Written by JackCarterSmith, 2023
|
|
# This code is released under the RSE license.
|
|
####################################################
|
|
|
|
|
|
# General configuration
|
|
include(CheckIncludeFile)
|
|
include(CheckCSourceCompiles)
|
|
|
|
if(BUILD_TOOLS)
|
|
# Import needed packages and references their include path
|
|
find_package(GLEW REQUIRED)
|
|
include_directories(${GLEW_INCLUDE_DIR})
|
|
#find_package(Vulkan REQUIRED)
|
|
#include_directories(${Vulkan_INCLUDE_DIR})
|
|
#find_package(vulkan-memory-allocator REQUIRED)
|
|
#include_directories(${vulkan-memory-allocator_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})
|
|
|
|
if(MSVC)
|
|
# msvc does not append 'lib' - do it here to have consistent name
|
|
set_target_properties(rse-model PROPERTIES IMPORT_PREFIX "lib")
|
|
elseif(UNIX)
|
|
set(AUX_LIBS m dl)# add math.lib for GL processing and dl.lib for dynamic loading
|
|
endif()
|
|
|
|
# Link externals libraries to the linker
|
|
if (TARGET GLEW::GLEW)
|
|
if(RSPMODEL_SHARED)
|
|
#target_link_libraries(rse-model PRIVATE rsp-model-lib ${GLEW_LIBRARIES} ${Vulkan_LIBRARIES} ${AUX_LIBS})
|
|
target_link_libraries(rse-model PRIVATE rsp-model-lib GLEW::GLEW ${AUX_LIBS})
|
|
elseif(RSPMODEL_STATIC)
|
|
#target_link_libraries(rse-model PRIVATE rsp-model-libstatic ${GLEW_LIBRARIES} ${Vulkan_LIBRARIES} ${AUX_LIBS})
|
|
target_link_libraries(rse-model PRIVATE rsp-model-libstatic GLEW::GLEW ${AUX_LIBS})
|
|
endif()
|
|
endif()
|
|
endif()
|