Skip to content

Commit

Permalink
xrCore: fix cmake build
Browse files Browse the repository at this point in the history
OPCODE: fixed for Linux build, add to cmake
  • Loading branch information
eagleivg committed May 30, 2018
1 parent 077478d commit cd1aafe
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 27 deletions.
1 change: 1 addition & 0 deletions Externals/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ add_subdirectory(luabind)
add_subdirectory(lzo)
add_subdirectory(cximage)
add_subdirectory(NVTT)
add_subdirectory(OPCODE)
#add_subdirectory(gli)
#add_subdirectory(glew)
13 changes: 13 additions & 0 deletions Externals/OPCODE/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project(OPCODE)
add_dir (
"."
)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src ${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include)

add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrCore)
2 changes: 1 addition & 1 deletion Externals/OPCODE/OPC_TreeBuilders.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef __OPC_TREEBUILDERS_H__
#define __OPC_TREEBUILDERS_H__

#include "opc_aabbtree.h"
#include "OPC_AABBTree.h"
#include "xrCore/xrPool.h"

//! Tree splitting rules
Expand Down
11 changes: 10 additions & 1 deletion Externals/OPCODE/OPC_Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Include Guard
#pragma once
#if !defined (_MSC_VER)
#include <stdint.h>
#endif
#ifndef __ICETYPES_H__
#define __ICETYPES_H__

Expand Down Expand Up @@ -42,8 +45,13 @@ typedef signed short sword; //!< sizeof(sword) must be 2
typedef unsigned short uword; //!< sizeof(uword) must be 2
typedef signed int sdword; //!< sizeof(sdword) must be 4
typedef unsigned int udword; //!< sizeof(udword) must be 4
#if defined (_MSC_VER)
typedef signed __int64 sqword; //!< sizeof(sqword) must be 8
typedef unsigned __int64 uqword; //!< sizeof(uqword) must be 8
#else
typedef int64_t sqword; //!< sizeof(sqword) must be 8
typedef uint64_t uqword; //!< sizeof(uqword) must be 8
#endif
typedef float float32; //!< sizeof(float32) must be 4
typedef double float64; //!< sizeof(float64) must be 4

Expand All @@ -69,10 +77,11 @@ typedef udword RTYPE; //!< Relationship-type (!) between owners and references
#define INVALID_NUMBER 0xDEADBEEF //!< Standard junk value

// Define BOOL if needed
#if defined (_MSC_VER)
#ifndef BOOL
typedef int BOOL; //!< Another boolean type.
#endif

#endif
//! Union of a float and a sdword
typedef union
{
Expand Down
2 changes: 1 addition & 1 deletion Externals/OPCODE/Opcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ using namespace IceCore;
#endif

#ifndef __ICEMATHS_H__
#include <Math.h>
#include <math.h>
#define ICEMATHS_API OPCODE_API
namespace IceMaths
{
Expand Down
12 changes: 6 additions & 6 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
macro(add_dir DIRS)
foreach(dir ${DIRS})
message( "adding " ${dir} )
message( "adding ${dir} to ${PROJECT_NAME}")
include_directories (${dir} )
file( GLOB ${dir}__INCLUDES_H ${dir} *.h)
file( GLOB ${dir}__INCLUDES_HPP ${dir} *.hpp)
list( APPEND XRCORE__INCLUDES ${${dir}__INCLUDES_H} ${${dir}__INCLUDES_HPP} )
file( GLOB ${dir}__SOURCES ${dir} *.cpp)
list( APPEND XRCORE__SOURCES ${${dir}__SOURCES} )
file( GLOB ${dir}__INCLUDES_H ${dir} ${dir}/*.h)
file( GLOB ${dir}__INCLUDES_HPP ${dir} ${dir}/*.hpp)
list( APPEND ${PROJECT_NAME}__INCLUDES ${${dir}__INCLUDES_H} ${${dir}__INCLUDES_HPP} )
file( GLOB ${dir}__SOURCES ${dir} ${dir}/*.cpp)
list( APPEND ${PROJECT_NAME}__SOURCES ${${dir}__SOURCES} )
endforeach()
endmacro()
2 changes: 1 addition & 1 deletion src/Include/xrRender/Kinematics.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma once

#include "RenderVisual.h"
#include "Layers\xrRender\KinematicsAddBoneTransform.hpp" //--#SM+#--
#include "Layers/xrRender/KinematicsAddBoneTransform.hpp" //--#SM+#--

typedef void (*UpdateCallback)(IKinematics* P);

Expand Down
11 changes: 0 additions & 11 deletions src/utils.cmake

This file was deleted.

14 changes: 8 additions & 6 deletions src/xrCore/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_dir (
project(xrCore)

list(APPEND DIRS
"."
"Animation"
"Compression"
Expand All @@ -10,13 +12,13 @@ add_dir (
"Text"
"Threading"
"XML"
xrCore)
)

message( "path " ${CMAKE_CURRENT_SOURCE_DIR} )
add_dir("${DIRS}")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include)

add_library(xrCore SHARED ${XRCORE__SOURCES} ${XRCORE__INCLUDES})
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(xrCore PROPERTIES PREFIX "")
target_link_libraries(xrCore ${SDL2_LIB} ${OPENSSL_LIBRARIES} ${LZO_LIBRARY} ${CRYPTO_LIBRARY} ${PUGIXML_LIBRARY})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} ${SDL2_LIB} ${OPENSSL_LIBRARIES} ${LZO_LIBRARY} ${CRYPTO_LIBRARY} ${PUGIXML_LIBRARY})

0 comments on commit cd1aafe

Please sign in to comment.