Skip to content

Commit bdd8107

Browse files
committed
Add cmake files from repo q4a/xray-16, branch linux. Authors: Ilya Orlov (eagleivg) and Aleksey Komarov (q4a)
1 parent c31911f commit bdd8107

File tree

24 files changed

+433
-22
lines changed

24 files changed

+433
-22
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,29 @@ cmake_minimum_required(VERSION 2.8.0)
22
project(OpenXRay)
33

44
include(${PROJECT_SOURCE_DIR}/cmake/utils.cmake)
5+
56
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
67

8+
find_program(CCACHE_FOUND ccache)
9+
if(CCACHE_FOUND)
10+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
11+
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
12+
endif(CCACHE_FOUND)
13+
714
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++17")
15+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") This is for the future versions
16+
#set(CMAKE_CXX_STANDARD 14) #Otherwise adds -std=gnu++11 and breaks successful building
17+
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
18+
#set(CMAKE_CXX_EXTENSIONS OFF)
819

920
add_definitions(-D_MT -D_CPPUNWIND -DPURE_DYNAMIC_CAST -DDECLARE_SPECIALIZATION -DM_NOSTDCONTAINERS_EXT -DUSE_OGL)
1021

1122
set(LUA_INCLUDE_DIR Externals/LuaJIT/src)
1223
set(LUA_LIBRARIES luajit)
1324
set(LUA_FOUND 1)
1425
if (NOT WIN32)
15-
find_package(OpenSSL REQUIRED)
26+
find_package(Crypto++ REQUIRED)
27+
find_package(PugiXML REQUIRED)
1628
find_package(Theora REQUIRED)
1729
find_package(OGG REQUIRED)
1830
find_package(SDL2 REQUIRED)

Externals/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ add_subdirectory(luabind)
33
add_subdirectory(lzo)
44
add_subdirectory(cximage)
55
add_subdirectory(NVTT)
6+
add_subdirectory(OPCODE)
7+
add_subdirectory(ode)
8+
#add_subdirectory(pugixml)
69
#add_subdirectory(gli)
710
#add_subdirectory(glew)

Externals/OPCODE/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
project(OPCODE)
2+
add_dir (
3+
"."
4+
)
5+
6+
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
7+
8+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src ${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include)
9+
10+
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})
11+
12+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
13+
target_link_libraries(${PROJECT_NAME} xrCore)

Externals/ode/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
project(ODE)
2+
3+
list(APPEND DIRS
4+
"ode/src"
5+
"include/ode"
6+
"contrib/msvc7/ode_default"
7+
)
8+
9+
add_dir("${DIRS}")
10+
11+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include )
12+
13+
add_definitions(-DdSINGLE -D_SECURE_SCL=0 -DLINUX -D_cdecl= -D__forceinline=inline)
14+
15+
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

cmake/FindCrypto++.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#https://raw.githubusercontent.com/harningt/cryptoface/7332799df7d9c78012eaa153f6598dcfa7debbc4/Modules/FindCrypto%2B%2B.cmake
2+
# - Find Crypto++
3+
4+
if(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
5+
set(CRYPTO++_FOUND TRUE)
6+
7+
else(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
8+
find_path(CRYPTO++_INCLUDE_DIR cryptlib.h
9+
/usr/include/crypto++
10+
/usr/include/cryptopp
11+
/usr/local/include/crypto++
12+
/usr/local/include/cryptopp
13+
/opt/local/include/crypto++
14+
/opt/local/include/cryptopp
15+
$ENV{SystemDrive}/Crypto++/include
16+
)
17+
18+
find_library(CRYPTO++_LIBRARIES NAMES cryptopp
19+
PATHS
20+
/usr/lib
21+
/usr/local/lib
22+
/opt/local/lib
23+
$ENV{SystemDrive}/Crypto++/lib
24+
)
25+
26+
if(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
27+
set(CRYPTO++_FOUND TRUE)
28+
message(STATUS "Found Crypto++: ${CRYPTO++_INCLUDE_DIR}, ${CRYPTO++_LIBRARIES}")
29+
else(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
30+
set(CRYPTO++_FOUND FALSE)
31+
message(FATAL_ERROR "Crypto++ not found.")
32+
endif(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
33+
34+
mark_as_advanced(CRYPTO++_INCLUDE_DIR CRYPTO++_LIBRARIES)
35+
36+
endif(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)

cmake/FindPugiXML.cmake

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#https://raw.githubusercontent.com/imageworks/OpenShadingLanguage/1bd2d67d88418544c4990d93513813696c9a8c06/src/cmake/modules/FindPugiXML.cmake
2+
# Find the pugixml XML parsing library.
3+
#
4+
# Sets the usual variables expected for find_package scripts:
5+
#
6+
# PUGIXML_INCLUDE_DIR - header location
7+
# PUGIXML_LIBRARIES - library to link against
8+
# PUGIXML_FOUND - true if pugixml was found.
9+
10+
unset (PUGIXML_LIBRARY CACHE)
11+
unset (PUGIXML_INCLUDE_DIR CACHE)
12+
find_path (PUGIXML_INCLUDE_DIR
13+
NAMES pugixml.hpp
14+
PATHS ${PUGIXML_HOME}/include
15+
/usr/local/include
16+
/usr/local/include/pugixml-1.8)
17+
find_library (PUGIXML_LIBRARY
18+
NAMES pugixml
19+
PATHS ${PUGIXML_HOME}/lib
20+
/usr/local/lib
21+
/usr/local/lib/pugixml-1.8)
22+
23+
# Second chance -- if not found, look in the OIIO distro
24+
if (NOT PUGIXML_INCLUDE_DIR AND OPENIMAGEIO_INCLUDE_DIR)
25+
find_path (PUGIXML_INCLUDE_DIR
26+
NAMES pugixml.hpp
27+
PATHS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO)
28+
set (PUGIXML_LIBRARY ${OPENIMAGEIO_LIBRARIES})
29+
endif ()
30+
31+
32+
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
33+
include (FindPackageHandleStandardArgs)
34+
FIND_PACKAGE_HANDLE_STANDARD_ARGS (PugiXML DEFAULT_MSG PUGIXML_LIBRARY
35+
PUGIXML_INCLUDE_DIR)
36+
37+
if (PUGIXML_FOUND)
38+
set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
39+
if (NOT PugiXML_FIND_QUIETLY)
40+
message (STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}")
41+
message (STATUS "PugiXML library = ${PUGIXML_LIBRARY}")
42+
endif ()
43+
else ()
44+
message (FATAL_ERROR "No PugiXML found")
45+
endif()
46+
47+
mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)

cmake/utils.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
macro(add_dir DIRS)
22
foreach(dir ${DIRS})
3-
message( "adding " ${dir} )
3+
message( "adding ${dir} to ${PROJECT_NAME}")
44
include_directories (${dir} )
5-
file( GLOB ${dir}__INCLUDES_H ${dir} *.h)
6-
file( GLOB ${dir}__INCLUDES_HPP ${dir} *.hpp)
7-
list( APPEND XRCORE__INCLUDES ${${dir}__INCLUDES_H} ${${dir}__INCLUDES_HPP} )
8-
file( GLOB ${dir}__SOURCES ${dir} *.cpp)
9-
list( APPEND XRCORE__SOURCES ${${dir}__SOURCES} )
5+
file( GLOB ${dir}__INCLUDES_H ${dir} ${dir}/*.h)
6+
file( GLOB ${dir}__INCLUDES_HPP ${dir} ${dir}/*.hpp)
7+
list( APPEND ${PROJECT_NAME}__INCLUDES ${${dir}__INCLUDES_H} ${${dir}__INCLUDES_HPP} )
8+
file( GLOB ${dir}__SOURCES ${dir} ${dir}/*.cpp)
9+
list( APPEND ${PROJECT_NAME}__SOURCES ${${dir}__SOURCES} )
1010
endforeach()
1111
endmacro()

src/CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#add_subdirectory(utils)
2-
#add_subdirectory(Layers)
1+
add_subdirectory(utils)
2+
add_subdirectory(Layers)
3+
#add_subdirectory(xr_3da)
34
#add_subdirectory(xrMisc)
4-
#add_subdirectory(xrAICore)
5-
#add_subdirectory(xrCDB)
5+
add_subdirectory(xrAICore)
6+
add_subdirectory(xrCDB)
67
add_subdirectory(xrCore)
78
#add_subdirectory(xrEngine)
89
#add_subdirectory(xrGame)
910
#add_subdirectory(xrNetServer)
10-
#add_subdirectory(xrParticles)
11-
#add_subdirectory(xrPhysics)
12-
#add_subdirectory(xrScriptEngine)
13-
#add_subdirectory(xrSound)
11+
add_subdirectory(xrParticles)
12+
add_subdirectory(xrPhysics)
13+
add_subdirectory(xrScriptEngine)
14+
add_subdirectory(xrSound)

src/Layers/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
add_subdirectory(xrAPI)
2+
#add_subdirectory(xrRenderPC_R1)
3+
#add_subdirectory(xrRenderPC_R2)
4+
#add_subdirectory(xrRenderPC_R3)
5+
#add_subdirectory(xrRenderPC_R4)
6+
#add_subdirectory(xrRenderPC_GL)

src/Layers/xrAPI/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
project(xrAPI)
2+
3+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CURRENT_SOURCE_DIR}/../../../sdk/include)
4+
5+
add_definitions(-DXRAPI_EXPORTS)
6+
7+
add_library(${PROJECT_NAME} SHARED "xrAPI.cpp" "stdafx.h")
8+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")

0 commit comments

Comments
 (0)