Skip to content

Commit

Permalink
Fixed CMakeFiles, add cmake directory with Find*.cmake, add Linux bui…
Browse files Browse the repository at this point in the history
…ld instructions
  • Loading branch information
q4a committed May 14, 2018
1 parent 76c6967 commit 4af858f
Show file tree
Hide file tree
Showing 25 changed files with 595 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "Externals/luajit"]
path = Externals/luajit
url = https://github.com/Xottab-DUTY/LuaJIT.git
url = https://github.com/vincent-t/LuaJIT.git
[submodule "Externals/luabind"]
path = Externals/luabind
url = https://github.com/Xottab-DUTY/luabind-deboostified.git
Expand Down
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 2.8.0)
project(OpenXRay)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++11")

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

find_package(Lua51 REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Theora REQUIRED)
find_package(OGG REQUIRED)
find_package(SDL2 REQUIRED)
find_package(LZO REQUIRED)
find_package(JPEG REQUIRED)

include_directories(${LUA_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR} {CMAKE_SOURCE_DIR}/Common ${CMAKE_SOURCE_DIR}/Externals ${CMAKE_SOURCE_DIR}/Externals/gli/external/glm ${CMAKE_SOURCE_DIR}/../sdk/include/loki)

add_subdirectory(Externals)
add_subdirectory(src)
2 changes: 1 addition & 1 deletion Externals/AGS_SDK
Submodule AGS_SDK updated 95 files
+1 −0 .gitignore
+39 −1 CHANGELOG.md
+1 −1 LICENSE.txt
+55 −22 README.md
+2 −0 ags_lib/.gitattributes
+55 −0 ags_lib/CHANGELOG.md
+1 −1 ags_lib/LICENSE.txt
+6 −2 ags_lib/README.md
+ ags_lib/doc/AGS Documentation.pdf
+10 −0 ags_lib/doc/README.txt
+ ags_lib/doc/amd_ags.chm
+ ags_lib/doc/amd_logo_black.png
+3,156 −0 ags_lib/hlsl/ags_shader_intrinsics_dx11.hlsl
+3,127 −0 ags_lib/hlsl/ags_shader_intrinsics_dx12.hlsl
+836 −322 ags_lib/inc/amd_ags.h
+ ags_lib/lib/amd_ags_uwp_x64.dll
+ ags_lib/lib/amd_ags_uwp_x64.lib
+ ags_lib/lib/amd_ags_uwp_x86.dll
+ ags_lib/lib/amd_ags_uwp_x86.lib
+ ags_lib/lib/amd_ags_x64.dll
+ ags_lib/lib/amd_ags_x64.lib
+ ags_lib/lib/amd_ags_x64_2015_MD.lib
+ ags_lib/lib/amd_ags_x64_2015_MT.lib
+ ags_lib/lib/amd_ags_x64_2017_MD.lib
+ ags_lib/lib/amd_ags_x64_2017_MT.lib
+ ags_lib/lib/amd_ags_x86.dll
+ ags_lib/lib/amd_ags_x86.lib
+ ags_lib/lib/amd_ags_x86_2015_MD.lib
+ ags_lib/lib/amd_ags_x86_2015_MT.lib
+ ags_lib/lib/amd_ags_x86_2017_MD.lib
+ ags_lib/lib/amd_ags_x86_2017_MT.lib
+2 −2 ags_sample/build/AGSSample_2013.vcxproj
+1 −1 ags_sample/build/AGSSample_2013.vcxproj.filters
+2 −2 ags_sample/build/AGSSample_2015.vcxproj
+1 −1 ags_sample/build/AGSSample_2015.vcxproj.filters
+2 −2 ags_sample/build/AGSSample_2017.sln
+13 −14 ags_sample/build/AGSSample_2017.vcxproj
+1 −1 ags_sample/build/AGSSample_2017.vcxproj.filters
+3 −3 ags_sample/build/Windows10SDKVS13_x64.props
+5 −3 ags_sample/premake/premake5.lua
+102 −89 ags_sample/src/AGSSample.cpp
+3 −7 crossfire_sample/Readme.html
+2 −2 crossfire_sample/build/CrossfireSample_2013.vcxproj
+6 −6 crossfire_sample/build/CrossfireSample_2013.vcxproj.filters
+2 −2 crossfire_sample/build/CrossfireSample_2015.vcxproj
+6 −6 crossfire_sample/build/CrossfireSample_2015.vcxproj.filters
+2 −2 crossfire_sample/build/CrossfireSample_2017.sln
+12 −14 crossfire_sample/build/CrossfireSample_2017.vcxproj
+6 −6 crossfire_sample/build/CrossfireSample_2017.vcxproj.filters
+3 −3 crossfire_sample/build/Windows10SDKVS13_x64.props
+5 −3 crossfire_sample/premake/premake5.lua
+147 −93 crossfire_sample/src/CFXAPISample.cpp
+31 −30 crossfire_sample/src/CFXAPISample.h
+2 −2 crossfire_sample/src/Window.h
+6 −5 eyefinity_sample/build/EyefinitySample_2013.vcxproj
+12 −9 eyefinity_sample/build/EyefinitySample_2013.vcxproj.filters
+6 −5 eyefinity_sample/build/EyefinitySample_2015.vcxproj
+12 −9 eyefinity_sample/build/EyefinitySample_2015.vcxproj.filters
+4 −4 eyefinity_sample/build/EyefinitySample_2017.sln
+17 −18 eyefinity_sample/build/EyefinitySample_2017.vcxproj
+12 −9 eyefinity_sample/build/EyefinitySample_2017.vcxproj.filters
+3 −3 eyefinity_sample/build/Windows10SDKVS13_x64.props
+34 −2 eyefinity_sample/dxut/Core/DDSTextureLoader.cpp
+1 −1 eyefinity_sample/dxut/Core/DDSTextureLoader.h
+23 −2 eyefinity_sample/dxut/Core/DXUT.cpp
+22 −8 eyefinity_sample/dxut/Core/DXUT.h
+12 −1 eyefinity_sample/dxut/Core/DXUTDevice11.cpp
+0 −125 eyefinity_sample/dxut/Core/DXUT_2010.vcxproj
+2 −2 eyefinity_sample/dxut/Core/DXUT_2013.vcxproj
+2 −2 eyefinity_sample/dxut/Core/DXUT_2015.vcxproj
+16 −10 eyefinity_sample/dxut/Core/DXUT_2017.vcxproj
+14 −1 eyefinity_sample/dxut/Core/ScreenGrab.cpp
+1 −1 eyefinity_sample/dxut/Core/ScreenGrab.h
+1 −1 eyefinity_sample/dxut/Core/WICTextureLoader.h
+3 −3 eyefinity_sample/dxut/Core/Windows10SDKVS13_x64.props
+6 −4 eyefinity_sample/dxut/Core/dxerr.cpp
+0 −2 eyefinity_sample/dxut/Core/dxerr.h
+11 −3 eyefinity_sample/dxut/Core/premake5.lua
+0 −130 eyefinity_sample/dxut/Optional/DXUTOpt_2010.vcxproj
+2 −2 eyefinity_sample/dxut/Optional/DXUTOpt_2013.vcxproj
+2 −2 eyefinity_sample/dxut/Optional/DXUTOpt_2015.vcxproj
+16 −10 eyefinity_sample/dxut/Optional/DXUTOpt_2017.vcxproj
+4 −0 eyefinity_sample/dxut/Optional/DXUTsettingsdlg.cpp
+4 −0 eyefinity_sample/dxut/Optional/DXUTsettingsdlg.h
+3 −3 eyefinity_sample/dxut/Optional/Windows10SDKVS13_x64.props
+11 −3 eyefinity_sample/dxut/Optional/premake5.lua
+5 −1 eyefinity_sample/dxut/ReadMe.txt
+ eyefinity_sample/media/amd/AMD.ico
+5 −3 eyefinity_sample/premake/premake5.lua
+241 −178 eyefinity_sample/src/EyefinitySample.cpp
+32 −0 eyefinity_sample/src/Shaders/Line.hlsl
+1 −1 premake/LICENSE.txt
+5 −8 premake/ags_update_vs_files.bat
+3 −8 premake/amd_premake_util.lua
+ premake/premake5.exe
7 changes: 7 additions & 0 deletions Externals/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_subdirectory(luajit)
add_subdirectory(luabind)
add_subdirectory(lzo)
add_subdirectory(cximage)
add_subdirectory(NVTT)
#add_subdirectory(gli)
#add_subdirectory(glew)
7 changes: 7 additions & 0 deletions Externals/NVTT/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8.0)
project(nvtt)
add_definitions(-DHAVE_SIGNAL_H -DHAVE_EXECINFO_H)
add_subdirectory(src/nvcore)
add_subdirectory(src/nvimage)
add_subdirectory(src/nvmath)
add_subdirectory(src/nvtt)
2 changes: 1 addition & 1 deletion Externals/cryptopp
Submodule cryptopp updated 311 files
39 changes: 39 additions & 0 deletions Externals/cximage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 2.8.0)
project(cximage)

set(SOURCES
ximacfg.cpp
ximaenc.cpp
ximaexif.cpp
ximage.cpp
ximainfo.cpp
ximaint.cpp
ximajpg.cpp
ximalpha.cpp
ximalyr.cpp
ximapal.cpp
ximasel.cpp
ximath.cpp
xmemfile.cpp
)

set(HEADERS
xfile.h
ximacfg.h
ximadef.h
ximage.h
ximaiter.h
ximajpg.h
ximath.h
xiofile.h
xmemfile.h
)

add_definitions(-DCXIMAGE_BUILD)

include_directories("." ${CMAKE_SOURCE_DIR})

add_library(cximage STATIC ${SOURCES} ${HEADERS})

set_target_properties(cximage PROPERTIES PREFIX "")
target_link_libraries(cximage)
3 changes: 3 additions & 0 deletions Externals/cximage/ximacfg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#if !defined(__ximaCFG_h)
#define __ximaCFG_h
#if !defined(WIN32)
#include <cstddef>
#endif

extern "C" void* cxalloc(size_t size);
extern "C" void cxfree(void* ptr);
Expand Down
2 changes: 1 addition & 1 deletion Externals/glew
Submodule glew updated from d2df29 to 7c046e
2 changes: 1 addition & 1 deletion Externals/gli
Submodule gli updated 1601 files
2 changes: 1 addition & 1 deletion Externals/glslang
Submodule glslang updated 751 files
2 changes: 1 addition & 1 deletion Externals/libogg
Submodule libogg updated 82 files
+1 −0 .gitignore
+15 −3 .travis.yml
+6 −0 CHANGES
+7 −5 CMakeLists.txt
+2 −1 Makefile.am
+1 −0 autogen.sh
+15 −3 configure.ac
+3 −3 doc/libogg/bitpacking.html
+3 −3 doc/libogg/datastructures.html
+3 −3 doc/libogg/decoding.html
+3 −3 doc/libogg/encoding.html
+3 −3 doc/libogg/general.html
+3 −3 doc/libogg/index.html
+3 −3 doc/libogg/ogg_iovec_t.html
+3 −3 doc/libogg/ogg_packet.html
+3 −3 doc/libogg/ogg_packet_clear.html
+3 −3 doc/libogg/ogg_page.html
+3 −3 doc/libogg/ogg_page_bos.html
+3 −3 doc/libogg/ogg_page_checksum_set.html
+3 −3 doc/libogg/ogg_page_continued.html
+3 −3 doc/libogg/ogg_page_eos.html
+3 −3 doc/libogg/ogg_page_granulepos.html
+3 −3 doc/libogg/ogg_page_packets.html
+3 −3 doc/libogg/ogg_page_pageno.html
+3 −3 doc/libogg/ogg_page_serialno.html
+3 −3 doc/libogg/ogg_page_version.html
+3 −3 doc/libogg/ogg_stream_check.html
+3 −3 doc/libogg/ogg_stream_clear.html
+3 −3 doc/libogg/ogg_stream_destroy.html
+3 −3 doc/libogg/ogg_stream_eos.html
+3 −3 doc/libogg/ogg_stream_flush.html
+3 −3 doc/libogg/ogg_stream_flush_fill.html
+3 −3 doc/libogg/ogg_stream_init.html
+3 −3 doc/libogg/ogg_stream_iovecin.html
+3 −3 doc/libogg/ogg_stream_packetin.html
+3 −3 doc/libogg/ogg_stream_packetout.html
+3 −3 doc/libogg/ogg_stream_packetpeek.html
+3 −3 doc/libogg/ogg_stream_pagein.html
+3 −3 doc/libogg/ogg_stream_pageout.html
+3 −3 doc/libogg/ogg_stream_pageout_fill.html
+3 −3 doc/libogg/ogg_stream_reset.html
+3 −3 doc/libogg/ogg_stream_reset_serialno.html
+3 −3 doc/libogg/ogg_stream_state.html
+3 −3 doc/libogg/ogg_sync_buffer.html
+3 −3 doc/libogg/ogg_sync_check.html
+3 −3 doc/libogg/ogg_sync_clear.html
+3 −3 doc/libogg/ogg_sync_destroy.html
+3 −3 doc/libogg/ogg_sync_init.html
+3 −3 doc/libogg/ogg_sync_pageout.html
+3 −3 doc/libogg/ogg_sync_pageseek.html
+3 −3 doc/libogg/ogg_sync_reset.html
+3 −3 doc/libogg/ogg_sync_state.html
+3 −3 doc/libogg/ogg_sync_wrote.html
+3 −3 doc/libogg/oggpack_adv.html
+3 −3 doc/libogg/oggpack_adv1.html
+3 −3 doc/libogg/oggpack_bits.html
+3 −3 doc/libogg/oggpack_buffer.html
+3 −3 doc/libogg/oggpack_bytes.html
+3 −3 doc/libogg/oggpack_get_buffer.html
+3 −3 doc/libogg/oggpack_look.html
+3 −3 doc/libogg/oggpack_look1.html
+3 −3 doc/libogg/oggpack_read.html
+3 −3 doc/libogg/oggpack_read1.html
+3 −3 doc/libogg/oggpack_readinit.html
+3 −3 doc/libogg/oggpack_reset.html
+3 −3 doc/libogg/oggpack_write.html
+3 −3 doc/libogg/oggpack_writealign.html
+3 −3 doc/libogg/oggpack_writecheck.html
+3 −3 doc/libogg/oggpack_writeclear.html
+3 −3 doc/libogg/oggpack_writecopy.html
+3 −3 doc/libogg/oggpack_writeinit.html
+3 −3 doc/libogg/oggpack_writetrunc.html
+3 −3 doc/libogg/overview.html
+3 −3 doc/libogg/reference.html
+28 −0 doc/release.txt
+0 −1 include/ogg/ogg.h
+1 −2 include/ogg/os_types.h
+2 −2 ogg-uninstalled.pc.in
+3 −0 releases.sha2
+0 −1 src/bitwise.c
+44 −2 src/framing.c
+3 −1 win32/ogg.def
2 changes: 1 addition & 1 deletion Externals/libtheora
2 changes: 1 addition & 1 deletion Externals/libvorbis
Submodule libvorbis updated 118 files
2 changes: 1 addition & 1 deletion Externals/luabind
2 changes: 1 addition & 1 deletion Externals/luajit
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ Changelist is available in [wiki](https://github.com/OpenXRay/xray-16/wiki/Chang

Build instructions (Windows): [doc/howto/build.txt](doc/howto/build.txt)

Build instructions (Linux):
Dependencies (Ubuntu 18.04): sudo apt install git cmake lua5.1-dev libssl-dev libtheora-dev libogg-dev liblzo2-dev libjpeg-dev
Init: git submodule update --init --recursive
Building: mkdir bin && cd bin && cmake ../src
Build instructions (Linux): [doc/howto/build-linux.txt](doc/howto/build-linux.txt)

Current status (Linux):
[ 66%] Building CXX object Externals/cximage/CMakeFiles/cximage.dir/ximaenc.cpp.o
In file included from /home/1/xray-16/Externals/cximage/ximage.h:57:0,
from /home/1/xray-16/Externals/cximage/ximaenc.cpp:6:
/home/1/xray-16/Externals/cximage/xiofile.h:21:12: error: ‘LPCTSTR’ has not been declared
bool Open(LPCTSTR filename, LPCTSTR mode)

Old status (Linux):
Build Failed:
[ 82%] Building CXX object xrCore/CMakeFiles/xrCore.dir/clsid.cpp.o
xray-16/src/xrCore/_types.h:14:24: error: expected initializer before ?s64?
Expand Down
68 changes: 68 additions & 0 deletions cmake/FindLZO.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#https://raw.githubusercontent.com/dfelinto/blender/master/build_files/cmake/Modules/FindLZO.cmake
# - Find LZO library
# Find the native LZO includes and library
# This module defines
# LZO_INCLUDE_DIRS, where to find lzo1x.h, Set when
# LZO_INCLUDE_DIR is found.
# LZO_LIBRARIES, libraries to link against to use LZO.
# LZO_ROOT_DIR, The base directory to search for LZO.
# This can also be an environment variable.
# LZO_FOUND, If false, do not try to use LZO.
#
# also defined, but not for general use are
# LZO_LIBRARY, where to find the LZO library.

#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================

# If LZO_ROOT_DIR was defined in the environment, use it.
IF(NOT LZO_ROOT_DIR AND NOT $ENV{LZO_ROOT_DIR} STREQUAL "")
SET(LZO_ROOT_DIR $ENV{LZO_ROOT_DIR})
ENDIF()

SET(_lzo_SEARCH_DIRS
${LZO_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
)

FIND_PATH(LZO_INCLUDE_DIR lzo/lzo1x.h
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
include
)

FIND_LIBRARY(LZO_LIBRARY
NAMES
lzo2
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)

# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
LZO_LIBRARY LZO_INCLUDE_DIR)

IF(LZO_FOUND)
SET(LZO_LIBRARIES ${LZO_LIBRARY})
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
ENDIF(LZO_FOUND)

MARK_AS_ADVANCED(
LZO_INCLUDE_DIR
LZO_LIBRARY
)
106 changes: 106 additions & 0 deletions cmake/FindOGG.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#https://raw.githubusercontent.com/freeorion/freeorion/master/cmake/FindOgg.cmake
#.rst:
# FindOgg
# -------
#
# Find the native Ogg includes and library.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target ``Ogg::Ogg``, if
# Ogg has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# OGG_INCLUDE_DIRS - where to find ogg.h, etc.
# OGG_LIBRARIES - List of libraries when using ogg.
# OGG_FOUND - True if ogg found.
#
# Hints
# ^^^^^
#
# A user may set ``OGGDIR`` environment to a ogg installation root
# to tell this module where to look.


set(_OGG_SEARCHES)

# Search OGGDIR first when is set.
if(ENV{OGGDIR})
set(_OGG_SEARCH_ROOT PATHS $ENV{OGGDIR} NO_DEFAULT_PATH)
list(APPEND _OGG_SEARCHES _OGG_SEARCH_ROOT)
endif()

# Normal search.
set(_OGG_SEARCH_NORMAL
PATH ""
)
list(APPEND _OGG_SEARCHES _OGG_SEARCH_NORMAL)

set(OGG_NAMES ogg libogg)
set(OGG_NAMES_DEBUG oggd ogg_D oggD ogg_D)

foreach(search ${_OGG_SEARCHES})
find_path(OGG_INCLUDE_DIR NAMES ogg.h ${${search}} PATH_SUFFIXES ogg)
endforeach()

# Allow OGG_LIBRARY to be set manually, as the location of the
# ogg library
if(NOT OGG_LIBRARY)
foreach(search ${_OGG_SEARCHES})
find_library(OGG_LIBRARY_RELEASE NAMES ${OGG_NAMES} ${${search}} PATH_SUFFIXES lib)
find_library(OGG_LIBRARY_DEBUG NAMES ${OGG_NAMES_DEBUG} ${${search}} PATH_SUFFIXES lib)
endforeach()

include(SelectLibraryConfigurations)
select_library_configurations(OGG)
endif()

unset(OGG_NAMES)
unset(OGG_NAMES_DEBUG)

mark_as_advanced(OGG_LIBRARY OGG_INCLUDE_DIR)

# handle the QUIETLY and REQUIRED argument and set OGG_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ogg REQUIRED_VARS OGG_LIBRARY OGG_INCLUDE_DIR)

if(OGG_FOUND)
set(OGG_INCLUDE_DIRS ${OGG_INCLUDE_DIR})

if(NOT OGG_LIBRARIES)
set(OGG_LIBRARIES ${OGG_LIBRARY})
endif()

if(NOT TARGET Ogg::Ogg)
add_library(Ogg::Ogg UNKNOWN IMPORTED)
set_target_properties(Ogg::Ogg PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIRS}")

if(OGG_LIBRARY_RELEASE)
set_property(TARGET Ogg::Ogg APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Ogg::Ogg PROPERTIES
IMPORTED_LOCATION_RELEASE "${OGG_LIBRARY_RELEASE}")
endif()

if(OGG_LIBRARY_DEBUG)
set_property(TARGET Ogg::Ogg APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Ogg::Ogg PROPERTIES
IMPORTED_LOCATION_DEBUG "${OGG_LIBRARY_DEBUG}")
endif()

if(NOT OGG_LIBRARY_RELEASE AND NOT OGG_LIBRARY_DEBUG)
set_property(TARGET Ogg::Ogg APPEND PROPERTY
IMPORTED_LOCATION "${OGG_LIBRARY}")
endif()
endif()
endif()
Loading

0 comments on commit 4af858f

Please sign in to comment.