Minor settings update

This commit is contained in:
JackCarterSmith 2022-08-11 22:24:13 +02:00
parent 5728046d65
commit 5794e55e59
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
5 changed files with 54 additions and 37 deletions

View File

@ -1,57 +1,69 @@
# CMakeLists.txt # CMakeLists.txt
# Written by JackCarterSmith, 2021 ####################################################
# Written by JackCarterSmith, 2022
# This code is released under the RSE license. # This code is released under the RSE license.
####################################################
cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1) # CMake requirement and general configuration
cmake_minimum_required(VERSION 3.12)
cmake_policy(VERSION 3.12)
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
if(DEFINED ENV{MS_COMPATIBLE})
# define project set(CMAKE_GNUtoMS ON) # Enable compatibility level to exported libraries
add_definitions(-DCONF_NO_GL)
if(DEFINED ENV{CI})
project(rse-model VERSION $ENV{CI_VERSION}.$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() endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY)
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
# needed packages add_definitions(-DCONF_NO_GL) # Used for obj-lib to not compile GL part
#find_package(GLEW REQUIRED)
# Project definition
if(DEFINED ENV{CI}) # Jenkins CI integration mode
project(rse-model VERSION $ENV{CI_VERSION}.$ENV{CI_BUILD_NUMBER} DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C)
set(RSE_MOD_NAME $ENV{CI_OUTPUT_NAME}-${PROJECT_VERSION})
else() # Standalone project mode, should not be used for release.
project(rse-model VERSION 1.0.0 DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C)
set(RSE_MOD_NAME RSE_Model-${PROJECT_VERSION})
endif()
# Push compile infos to source
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY)
# Import needed packages and references their include path
#find_package(GLEW REQUIRED) # Enable when GL rendering is ready
#include_directories(${GLEW_INCLUDE_DIR}) #include_directories(${GLEW_INCLUDE_DIR})
# define src/headers files
FILE(GLOB_RECURSE RSE_MOD_SRCS src/*.c) # Define src/headers files
FILE(GLOB_RECURSE RSE_MOD_HRDS src/*.h) FILE(GLOB_RECURSE RSE_MOD_SOURCES src/*.c)
SOURCE_GROUP("Source Files" FILES ${RSE_MOD_SRCS}) FILE(GLOB_RECURSE RSE_MOD_HEADERS src/*.h)
SOURCE_GROUP("Header Files" FILES ${RSE_MOD_HRDS}) SOURCE_GROUP("Source Files" FILES ${RSE_MOD_SOURCES})
SOURCE_GROUP("Header Files" FILES ${RSE_MOD_HEADERS})
# begin building RSE-Model
#set(CMAKE_BUILD_TYPE Debug) # Building instructions for RSE-Model
if(DEFINED ENV{RSE-WS})
set(CMAKE_BUILD_TYPE DEBUG)
endif()
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}) #include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(rse-model ${RSE_MOD_SRCS} ${RSE_MOD_HRDS}) add_executable(rse-model ${RSE_MOD_SOURCES} ${RSE_MOD_HEADERS}) # Set the inputs for the compiler (srcs&hrds)
#set_property(TARGET rse-model PROPERTY C_STANDARD 99) set_property(TARGET rse-model PROPERTY C_STANDARD 90)
set_target_properties(rse-model PROPERTIES OUTPUT_NAME ${RSE_MOD_NAME}) set_target_properties(rse-model PROPERTIES OUTPUT_NAME ${RSE_MOD_NAME}) # Define the executable file name
# Link externals libraries to the linker
if(MSVC) if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name # 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 PREFIX "lib")
set_target_properties(rse-model PROPERTIES IMPORT_PREFIX "lib") set_target_properties(rse-model PROPERTIES IMPORT_PREFIX "lib")
endif() target_link_libraries(rse-model ${GLEW_LIBRARIES})
if(MSVC)
target_link_libraries(rse-model)
else() else()
target_link_libraries(rse-model m) target_link_libraries(rse-model ${GLEW_LIBRARIES} m)
endif() endif()
# add GPG signature command
# GPG signature custom command
#add_custom_command( #add_custom_command(
# OUTPUT "" # OUTPUT ""
# COMMAND gpg --batch --detach-sign # COMMAND gpg --batch --detach-sign
@ -61,7 +73,8 @@ endif()
# VERBATIM # VERBATIM
#) #)
# install executable
# Install project executable
install(TARGETS rse-model install(TARGETS rse-model
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
) )

3
Jenkinsfile vendored
View File

@ -47,8 +47,7 @@ pipeline {
sh 'cp ../linux/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* .' sh 'cp ../linux/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* .'
} }
dir("zip_win") { dir("zip_win") {
// sh 'cp ../windows/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* ../windows/build/*.dll .' sh 'cp ../windows/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* ../windows/build/*.dll .'
sh 'cp ../windows/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* .'
} }
zip archive: false, dir: 'zip_linux', exclude: '', glob: '', zipFile: 'x64.zip' zip archive: false, dir: 'zip_linux', exclude: '', glob: '', zipFile: 'x64.zip'
sh 'mv x64.zip ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_x64.zip' sh 'mv x64.zip ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_x64.zip'

View File

@ -11,7 +11,7 @@ All modules are independants. This is the **'MODEL'** module.
## MODEL MODULE ## MODEL MODULE
It's extract texture datas from Rogue Squadron 3D (PC) game models files (HOB). It's extract 3D rendering datas from Rogue Squadron 3D (PC) game models files (HOB).
This module can do: This module can do:
- Extract objects inside HOB files to Wavefront OBJ format, - Extract objects inside HOB files to Wavefront OBJ format,
@ -21,7 +21,7 @@ This module can do:
## TODO ## TODO
- Add textures to models. - Add textures to models.
- Discover all unknow fields, animation, bones mesh, etc. - Discover all unknowns fields, animations, bones mesh, etc.
### Using ### Using
@ -35,8 +35,9 @@ Due to issue with copyrights, I can't provide samples... You need to extract HOB
### Options ### Options
- -h Print this message - -h Print this message
- -v Activate verbose output - -v,-vv Activate verbose/debug output mode respectively
- -no-subdir Extract textures directly inside current folder - -no-subdir Extract textures directly inside current folder
- -no-mtl Disable materials datas export with OBJ model
### Dependencies ### Dependencies

View File

@ -9,3 +9,4 @@ cmake_find_package
glew:shared=True glew:shared=True
[imports] [imports]
bin, *.dll -> .

View File

@ -118,9 +118,12 @@ static unsigned char checkInputArgs(T_PROG_OPTIONS* opt_ptr, int p_arg_nbr, char
opt_ptr->verbose_mode = 1; opt_ptr->verbose_mode = 1;
printf("[OPTN] Verbose enabled.\n"); printf("[OPTN] Verbose enabled.\n");
} else if (strcmp(p_args[i], "-vv") == 0) { } else if (strcmp(p_args[i], "-vv") == 0) {
opt_ptr->verbose_mode = 1;
opt_ptr->debug_mode = 1; opt_ptr->debug_mode = 1;
printf("[OPTN] Debug enabled.\n"); printf("[OPTN] Debug enabled.\n");
} else if (strcmp(p_args[i], "-vvv") == 0) { } else if (strcmp(p_args[i], "-vvv") == 0) {
opt_ptr->verbose_mode = 1;
opt_ptr->debug_mode = 1;
opt_ptr->god_mode = 1; opt_ptr->god_mode = 1;
printf("[OPTN] God damn it!\n"); printf("[OPTN] God damn it!\n");
} else if (strcmp(p_args[i], "-no-subdir") == 0) { } else if (strcmp(p_args[i], "-no-subdir") == 0) {