RSE-Texture/RSETexture/CMakeLists.txt
JackCarterSmith d6b94f8c79
All checks were successful
JCS-Prod/RSE-Texture/pipeline/pr-master This commit looks good
JCS-Prod/RSE-Texture/pipeline/head This commit looks good
Patched library garbage
2022-09-18 16:01:18 +02:00

49 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)
if(BUILD_TOOLS)
# Import needed packages and references their include path
find_package(PNG 1.6.37 REQUIRED)
include_directories(${PNG_INCLUDE_DIR})
# Define src/headers files
file(GLOB_RECURSE RSE_TEXTURE_SOURCES ./src/*.c)
source_group("Source Files" FILES ${RSE_TEXTURE_SOURCES})
# Building instructions for RSE-Texture
if(DEFINED ENV{CI})
set(CMAKE_BUILD_TYPE RELEASE)
endif()
# Declare standalone application
add_executable(rse-texture ${RSE_TEXTURE_SOURCES})
set_property(TARGET rse-texture PROPERTY C_STANDARD 90)
#target_include_directories(rse-texture PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
set_target_properties(rse-texture PROPERTIES OUTPUT_NAME ${RSE_TEXTURE_NAME})
if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name
set_target_properties(rse-texture PROPERTIES IMPORT_PREFIX "lib")
endif()
# Link externals libraries to the linker
if(RSPTEXTURE_SHARED)
target_link_libraries(rse-texture PRIVATE rsp-texture-lib ${PNG_LIBRARIES})
elseif(RSPTEXTURE_STATIC)
target_link_libraries(rse-texture PRIVATE rsp-texture-libstatic ${PNG_LIBRARIES})
endif()
endif()