# CMakeLists.txt # Written by JackCarterSmith, 2021 # This code is released under the RSE license. cmake_minimum_required(VERSION 3.1) cmake_policy(VERSION 3.1) set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) # define project add_definitions(-DCONF_NO_GL) if(DEFINED ENV{CI}) project(rse-model VERSION 1.0.0.$ENV{CI_BUILD_NUMBER} DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C) set(RSE_MOD_NAME $ENV{CI_OUTPUT_NAME}-${PROJECT_VERSION}) else() project(rse-model VERSION 1.0.0 DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C) set(RSE_MOD_NAME RSE_Model-${PROJECT_VERSION}) endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY) include(CheckIncludeFile) include(CheckCSourceCompiles) # needed packages find_package(GLEW REQUIRED) include_directories(${GLEW_INCLUDE_DIR}) # define src/headers files FILE(GLOB_RECURSE RSE_MOD_SRCS src/*.c) FILE(GLOB_RECURSE RSE_MOD_HRDS src/*.h) SOURCE_GROUP("Source Files" FILES ${RSE_MOD_SRCS}) SOURCE_GROUP("Header Files" FILES ${RSE_MOD_HRDS}) # begin building RSE-Model #set(CMAKE_BUILD_TYPE Debug) #include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_executable(rse-model ${RSE_MOD_SRCS} ${RSE_MOD_HRDS}) #set_property(TARGET rse-model PROPERTY C_STANDARD 99) set_target_properties(rse-model PROPERTIES OUTPUT_NAME ${RSE_MOD_NAME}) if(MSVC) # msvc does not append 'lib' - do it here to have consistent name set_target_properties(rse-model PROPERTIES PREFIX "lib") set_target_properties(rse-model PROPERTIES IMPORT_PREFIX "lib") endif() target_link_libraries(rse-model ${GLEW_LIBRARIES}) # add GPG signature command #add_custom_command( # OUTPUT "" # COMMAND gpg --batch --detach-sign # -o ${RSE_MOD_NAME}_${CI_SYS_TARGET}.gpg # ${RSE_MOD_NAME} # DEPENDS ${RSE_MOD_NAME} # VERBATIM #) # install executable install(TARGETS rse-model RUNTIME DESTINATION bin )