Skip to content

Commit

Permalink
Merge pull request #363 from michaelheilmann/master
Browse files Browse the repository at this point in the history
Update for latest versions of dependencies
  • Loading branch information
michaelheilmann committed Mar 11, 2018
2 parents bd35da9 + d3e2db1 commit f4579e1
Show file tree
Hide file tree
Showing 634 changed files with 2,751 additions and 6,637 deletions.
75 changes: 49 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
# CMake/Doxygen.
CMakeDoxyfile\.in
CMakeDoxygenDefaults\.cmake

# CMake/CTest/Google test.
CTestTestfile\.cmake
gmock.pc
gmock_main.pc
gtest.pc
gtest_main.pc
DartConfiguration.tcl

# CMake/CPack.
cmake_install.cmake
install_manifest*.txt
CPackConfig\.cmake
CPackSourceConfig\.cmake
_CPack_Packages

# GNU Make.
Makefile

# CMake/Visual Studio.
**/x64/Debug
**/x64/MinSizeRel
**/x64/Release
**/x64/RelWithDebInfo
**/Win32/Debug
**/Win32/MinSizeRel
**/Win32/Release
**/Win32/RelWithDebInfo
*\.dir

# Visual Studio 2017.
\.vs
*.ilk
*.pdb
*.lib
*.sdf
*.opensdf
*.suo
*.VC.db
*.VC.VC.opendb
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*.sln
*.vcxproj.filters
*.VC.db
*.VC.VC.opendb
/intermediate
/products
Win32/Debug
Win32/Release
egolib/Debug
egolib/Release
egoboo/Debug
egoboo/Release

# CMake.
CMakeDoxyfile.in
CMakeDoxygenDefaults.cmake
cmake_install.cmake

# Google Mock, Google Test.
gmock.pc
gmock_main.pc
gtest.pc
gtest_main.pc

# CMake.
*\.dir/
CMakeFiles
CMakeCache.txt
*.sln
*.exe.gta.testdurations
**/Temporary

# Code::Blocks.
*.layout
Expand All @@ -54,3 +70,10 @@ xcuserdata

# Doxygen.
/doc/doxygen

# Generated files.
gen

# CMake.
CMakeFiles
CMakeCache.txt
51 changes: 44 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,56 @@ cmake_minimum_required(VERSION 3.6)

project(egoboo)

# Add Idlib.
add_subdirectory(idlib)
# Set path to Idlib.
set(IDLIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/idlib)

include(${CMAKE_CURRENT_SOURCE_DIR}/idlib/buildsystem/set_project_default_properties.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/idlib-game-engine/buildsystem/download_and_unpack.cmake)
# Set path to Idlib: Game Engine.
set(IDLIB_GAME_ENGINE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/idlib-game-engine)

# Add Idlib.
set(idlib-with-tests OFF CACHE BOOL
"enable/disable compilation of tests. ON enables compilation of tests, OFF disables compilation of tests. Initial value is OFF." FORCE)
set(idlib-with-demos OFF CACHE BOOL
"enable/disable compilation of demos. ON enables compilation of demos, OFF disables compilation of demos. Initial value is OFF." FORCE)
set(idlib-with-documentation OFF CACHE BOOL
"enable/disable compilation of documentation. ON enables compilation of documentation, OFF disables compilation of documentation. Initial value is OFF." FORCE)
add_subdirectory(${IDLIB_PATH})

# Add Idlib: Game Engine.
set(idlib-with-tests OFF CACHE BOOL "enable/disable compilation of tests. ON enables compilation of tests, OFF disables compilation of tests. Initial value is OFF." FORCE)
set(IDLIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/idlib)
add_subdirectory(idlib-game-engine)
set(idlib-game-engine-with-tests OFF CACHE BOOL
"enable/disable compilation of tests. ON enables compilation of tests, OFF disables compilation of tests. Initial value is OFF." FORCE)
set(idlib-game-engine-with-demos OFF CACHE BOOL
"enable/disable compilation of demos. ON enables compilation of demos, OFF disables compilation of demos. Initial value is OFF." FORCE)
add_subdirectory(${IDLIB_GAME_ENGINE_PATH})

include(${IDLIB_PATH}/buildsystem/set_project_default_properties.cmake)
include(${IDLIB_GAME_ENGINE_PATH}/buildsystem/download_and_unpack.cmake)

# Add Egolib.
add_subdirectory(egolib)

# Add Egoboo.
add_subdirectory(egoboo)

# Define installer (for MSCV only atm)
if (${IDLIB_CXX_COMPILER_ID} EQUAL ${IDLIB_CXX_COMPILER_ID_MSVC})
set(CPACK_PACKAGE_NAME "Egoboo")
set(CPACK_PACKAGE_VENDOR "https://egoboo.org/")
if (${IDLIB_PLATFORM_ID} EQUAL ${IDLIB_PLATFORM_ID_X64})
#message("building Windows 10 x64 installer")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Egoboo - Windows 10 x64 Installer")
else()
#message("building Windows 10 x86 installer")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Egoboo - Windows 10 x86 Installer")
endif()
set(CPACK_PACKAGE_VERSION "1.0.0")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Egoboo")

set(CPACK_COMPONENTS_ALL applications libraries headers)
endif()

# This must always be last!
include(CPack)
10 changes: 0 additions & 10 deletions egoboo.workspace

This file was deleted.

35 changes: 20 additions & 15 deletions egoboo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# Minimum required CMake version.
cmake_minimum_required(VERSION 3.8)

# Project name and language.
# Project name and settings.
project(egoboo CXX)

# Project compiles against C++ 17.
if (NOT MSVC)
set(CMAKE_CXX_STANDARD 17)
endif()

# Set the default properties.
message("building Egoboo Executable")
set_project_default_properties()

set(SOURCE_FILES "")
Expand Down Expand Up @@ -42,23 +36,34 @@ add_executable(egoboo ${SOURCE_FILES})
# Link libraries.
target_link_libraries(egoboo egolib-library)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
# Copy runtime dependencies (e.g. SDL2 DLLs) of idlib-game-engine-library to the executable.
if (${IDLIB_CXX_COMPILER_ID} EQUAL ${IDLIB_CXX_COMPILER_ID_MSVC})
get_property(runtime-libraries TARGET idlib-game-engine-library PROPERTY runtime-libraries)
foreach( runtime-library ${runtime-libraries} )
get_filename_component(barename ${runtime-library} NAME)
message("copying ${runtime-library} to $<TARGET_FILE_DIR:egoboo>/${barename}")
#message("copying ${runtime-library} to $<TARGET_FILE_DIR:egoboo>/${barename}")
add_custom_command(TARGET egoboo
PRE_LINK
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${runtime-library} $<TARGET_FILE_DIR:egoboo>/${barename})
set_target_properties(egoboo PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/data")
endforeach()
set_target_properties(egoboo PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/data")
endif()

# == Doxygen ==================================================================================== #
# Install runtime dependencies (e.g. SDL2 DLLs) of idlib-game-engine-library with the executable.
if (${IDLIB_CXX_COMPILER_ID} EQUAL ${IDLIB_CXX_COMPILER_ID_MSVC})
get_property(runtime-libraries TARGET idlib-game-engine-library PROPERTY runtime-libraries)
foreach( runtime-library ${runtime-libraries} )
install(FILES ${runtime-library}
DESTINATION bin
COMPONENT applications)
endforeach()
endif()

FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
ADD_CUSTOM_TARGET(egoboo-doc ${DOXYGEN_EXECUTABLE} COMMENT "Building documentation")
ELSE(DOXYGEN_FOUND)
MESSAGE(STATUS "Doxygen not found. You won't be able to build documentation.")
ENDIF(DOXYGEN_FOUND)

install(TARGETS egoboo
RUNTIME
DESTINATION bin
COMPONENT applications)
71 changes: 4 additions & 67 deletions egolib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,73 +1,10 @@
# Minimum required CMake version.
cmake_minimum_required(VERSION 3.6)

# Project name and language.
# Project name and settings.
project(egolib-library CXX)
message("building Egolib")

# Project compiles against C++ 17.
if (NOT MSVC)
set(CMAKE_CXX_STANDARD 17)
endif()
add_subdirectory(library)

# Set the default properties.
set_project_default_properties()

set(SOURCE_FILES "")

# Include directories for project.
include_directories(${PROJECT_SOURCE_DIR}/src)

# Enumerate cpp and c files.
file(GLOB_RECURSE CPP_FILES ${PROJECT_SOURCE_DIR}/src/*.cpp)
list(APPEND SOURCE_FILES ${CPP_FILES})

file(GLOB_RECURSE C_FILES ${PROJECT_SOURCE_DIR}/src/*.c)
SET_SOURCE_FILES_PROPERTIES(${C_FILES} PROPERTIES LANGUAGE CXX)
list(APPEND SOURCE_FILES ${C_FILES})

# Exclude OS specific cpp and c files.
list(REMOVE_ITEM SOURCE_FILES "${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_win.c")
list(REMOVE_ITEM SOURCE_FILES "${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_linux.c")

# Enumerate hpp and h files.
file(GLOB_RECURSE HPP_FILES ${PROJECT_SOURCE_DIR}/src/*.hpp)
set_source_files_properties(${HPP_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
set_source_files_properties(${HPP_FILES} PROPERTIES LANGUAGE CXX)
list(APPEND SOURCE_FILES ${HPP_FILES})

file(GLOB_RECURSE H_FILES ${PROJECT_SOURCE_DIR}/src/*.h)
set_source_files_properties(${H_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
set_source_files_properties(${H_FILES} PROPERTIES LANGUAGE CXX)
list(APPEND SOURCE_FILES ${H_FILES})

# Add OS specific files.
if (UNIX AND NOT APPLE)
set(SOURCE_FILES ${SOURCE_FILES} ${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_linux.c)
endif()

if (APPLE)
file(GLOB_RECURSE MM_FILES ${PROJECT_SOURCE_DIR}/src/*.mm)
list(APPEND SOURCE_FILES ${MM_FILES})
SET_SOURCE_FILES_PROPERTIES(${MM_FILES} PROPERTIES COMPILE_FLAGS "-x objective-c++")
endif()

if (WIN32)
set(SOURCE_FILES ${SOURCE_FILES} ${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_win.c)
endif()

# Define product.
add_library(egolib-library STATIC ${SOURCE_FILES})
target_include_directories(egolib-library INTERFACE "${PROJECT_SOURCE_DIR}/src/")
target_link_libraries(egolib-library idlib-game-engine-library)
if (WIN32)
target_link_libraries(egolib-library Shlwapi.lib)
endif()

# == Doxygen ==================================================================================== #

FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
ADD_CUSTOM_TARGET(egolib-doc ${DOXYGEN_EXECUTABLE} COMMENT "Building documentation")
ELSE(DOXYGEN_FOUND)
MESSAGE(STATUS "Doxygen not found. You won't be able to build documentation.")
ENDIF(DOXYGEN_FOUND)
add_subdirectory(tests)
67 changes: 67 additions & 0 deletions egolib/library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Minimum required CMake version.
cmake_minimum_required(VERSION 3.6)

# Project name and settings.
project(egolib-library CXX)
message("building Egolib Library")
set_project_default_properties()

set(SOURCE_FILES "")

# Include directories for project.
include_directories(${PROJECT_SOURCE_DIR}/src)

# Enumerate cpp and c files.
file(GLOB_RECURSE CPP_FILES ${PROJECT_SOURCE_DIR}/src/*.cpp)
list(APPEND SOURCE_FILES ${CPP_FILES})

file(GLOB_RECURSE C_FILES ${PROJECT_SOURCE_DIR}/src/*.c)
SET_SOURCE_FILES_PROPERTIES(${C_FILES} PROPERTIES LANGUAGE CXX)
list(APPEND SOURCE_FILES ${C_FILES})

# Exclude OS specific cpp and c files.
list(REMOVE_ITEM SOURCE_FILES "${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_win.c")
list(REMOVE_ITEM SOURCE_FILES "${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_linux.c")

# Enumerate hpp and h files.
file(GLOB_RECURSE HPP_FILES ${PROJECT_SOURCE_DIR}/src/*.hpp)
set_source_files_properties(${HPP_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
set_source_files_properties(${HPP_FILES} PROPERTIES LANGUAGE CXX)
list(APPEND SOURCE_FILES ${HPP_FILES})

file(GLOB_RECURSE H_FILES ${PROJECT_SOURCE_DIR}/src/*.h)
set_source_files_properties(${H_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
set_source_files_properties(${H_FILES} PROPERTIES LANGUAGE CXX)
list(APPEND SOURCE_FILES ${H_FILES})

# Add OS specific files.
if (UNIX AND NOT APPLE)
set(SOURCE_FILES ${SOURCE_FILES} ${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_linux.c)
endif()

if (APPLE)
file(GLOB_RECURSE MM_FILES ${PROJECT_SOURCE_DIR}/src/*.mm)
list(APPEND SOURCE_FILES ${MM_FILES})
SET_SOURCE_FILES_PROPERTIES(${MM_FILES} PROPERTIES COMPILE_FLAGS "-x objective-c++")
endif()

if (WIN32)
set(SOURCE_FILES ${SOURCE_FILES} ${PROJECT_SOURCE_DIR}/src/egolib/Platform/file_win.c)
endif()

# Define product.
add_library(egolib-library STATIC ${SOURCE_FILES})
target_include_directories(egolib-library INTERFACE "${PROJECT_SOURCE_DIR}/src/")
target_link_libraries(egolib-library idlib-game-engine-library idlib-document-library idlib-math-geometry-library idlib-hll-library idlib-parsing-expression-library idlib-color-library idlib-filesystem-library)
if (WIN32)
target_link_libraries(egolib-library Shlwapi.lib)
endif()

# == Doxygen ==================================================================================== #

FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
ADD_CUSTOM_TARGET(egolib-doc ${DOXYGEN_EXECUTABLE} COMMENT "Building documentation")
ELSE(DOXYGEN_FOUND)
MESSAGE(STATUS "Doxygen not found. You won't be able to build documentation.")
ENDIF(DOXYGEN_FOUND)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AppImpl::AppImpl(const std::string& title, const std::string& version)

auto& renderer = Renderer::get();
// Set clear colour and clear depth.
renderer.getColourBuffer().setClearValue(Math::Colour4f(0, 0, 0, 0)); // Set black/transparent background.
renderer.getColourBuffer().setClearValue(Colour4f(0, 0, 0, 0)); // Set black/transparent background.
renderer.getDepthBuffer().setClearValue(1.0f);

// Enable writing to the depth buffer.
Expand Down Expand Up @@ -54,10 +54,10 @@ AppImpl::AppImpl(const std::string& title, const std::string& version)
GL_DEBUG(glTexGeni)(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); // Set The Texture Generation Mode For T To Sphere Mapping (NEW)

//Initialize the motion blur buffer
renderer.getAccumulationBuffer().setClearValue(Math::Colour4f(0.0f, 0.0f, 0.0f, 1.0f));
renderer.getAccumulationBuffer().setClearValue(Colour4f(0.0f, 0.0f, 0.0f, 1.0f));
renderer.getAccumulationBuffer().clear();

GraphicsSystem::get().window->setTitle(title + " " + version);
GraphicsSystem::get().window->title(title + " " + version);
}

AppImpl::~AppImpl()
Expand Down
Loading

0 comments on commit f4579e1

Please sign in to comment.