Patched library garbage #23
@ -33,6 +33,7 @@ set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation d
|
||||
# Compilation option
|
||||
option(RSPMODEL_SHARED "Build shared lib" ON)
|
||||
option(RSPMODEL_STATIC "Build static lib" ON)
|
||||
option(BUILD_TOOLS "Build lib tools" ON)
|
||||
|
||||
|
||||
# Push compile infos to source
|
||||
@ -45,10 +46,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DI
|
||||
# It is intended to be used by others apps like rendering engine or others.
|
||||
# - RSEModel is the standalone application of the library, take HOB file in argument and output OBJ/MTL file.
|
||||
# Artists or users can directly use this program to retrieve data in common datas format.
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||
unset(RSE_MODEL_TARGETS_LIST)
|
||||
if(BUILD_TOOLS)
|
||||
set(RSE_MODEL_TARGETS_LIST rse-model)
|
||||
endif()
|
||||
add_subdirectory(RSPModelLib)
|
||||
add_subdirectory(RSEModel)
|
||||
if(RSPMODEL_SHARED)
|
||||
list(APPEND RSE_MODEL_TARGETS_LIST rsp-model-lib)
|
||||
endif()
|
||||
@ -61,11 +64,10 @@ if(NOT RSE_MODEL_TARGETS_LIST)
|
||||
"Please enable at least one of the following options: "
|
||||
"RSPMODEL_STATIC, RSPMODEL_SHARED")
|
||||
endif()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||
add_subdirectory(RSPModelLib)
|
||||
add_subdirectory(RSEModel)
|
||||
if(BUILD_TOOLS)
|
||||
list(APPEND RSE_MODEL_TARGETS_LIST rse-model)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# GPG signature custom command
|
||||
|
@ -10,41 +10,41 @@
|
||||
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})
|
||||
if(BUILD_TOOLS)
|
||||
# Import needed packages and references their include path
|
||||
find_package(GLEW REQUIRED)
|
||||
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})
|
||||
# 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(RSPMODEL_SHARED)
|
||||
target_link_libraries(rse-model PRIVATE rsp-model-lib ${GLEW_LIBRARIES} ${AUX_LIBS})
|
||||
elseif(RSPMODEL_STATIC)
|
||||
target_link_libraries(rse-model PRIVATE rsp-model-libstatic ${GLEW_LIBRARIES} ${AUX_LIBS})
|
||||
# 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(RSPMODEL_SHARED)
|
||||
target_link_libraries(rse-model PRIVATE rsp-model-lib ${GLEW_LIBRARIES} ${AUX_LIBS})
|
||||
elseif(RSPMODEL_STATIC)
|
||||
target_link_libraries(rse-model PRIVATE rsp-model-libstatic ${GLEW_LIBRARIES} ${AUX_LIBS})
|
||||
endif()
|
||||
endif()
|
||||
|
@ -34,24 +34,29 @@ typedef union u_rspmodel_parameters {
|
||||
// Lib's structure definitions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef MEMFILE
|
||||
#ifndef MEMFILE_DEF
|
||||
typedef char* MEMFILE;
|
||||
#define MEMFILE_DEF
|
||||
#endif
|
||||
|
||||
#ifndef T_RGBA
|
||||
#ifndef T_RGBA_DEF
|
||||
typedef unsigned int T_RGBA;
|
||||
#define T_RGBA_DEF
|
||||
#endif
|
||||
|
||||
#ifndef T_VECTOR3
|
||||
#ifndef T_VECTOR3_DEF
|
||||
typedef struct vector3 { float x,y,z; } T_VECTOR3;
|
||||
#define T_VECTOR3_DEF
|
||||
#endif
|
||||
|
||||
#ifndef T_VERTEX
|
||||
#ifndef T_VERTEX_DEF
|
||||
typedef struct vertex { short x,y,z,w; } T_VERTEX;
|
||||
#define T_VERTEX_DEF
|
||||
#endif
|
||||
|
||||
#ifndef T_TEXCOORD
|
||||
#ifndef T_TEXCOORD_DEF
|
||||
typedef struct tex_coord { short u,v; } T_TEXCOORD;
|
||||
#define T_TEXCOORD_DEF
|
||||
#endif
|
||||
|
||||
typedef struct face_flags {
|
||||
|
Loading…
x
Reference in New Issue
Block a user