Skip to content

Commit

Permalink
Merge branch '0.2-Dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DieSlower committed Dec 13, 2019
2 parents aea7254 + 5e7e1fb commit 348ec91
Show file tree
Hide file tree
Showing 299 changed files with 53,753 additions and 53,648 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.vs/*
.vscode/*
bin/*
Ext/*
Ext*
lib/*
x64/*
CMakeFiles/*
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ INCLUDE (UtilityMacros)
INCLUDE (Version)

# Defines the project name
PROJECT (TrueReality-${TR_VERSION_MAJOR}.${TR_VERSION_MINOR} VERSION ${TR_VERSION} LANGUAGES CXX)
PROJECT (TrueReality-${TR_VERSION_MAJOR}.${TR_VERSION_MINOR}.${TR_VERSION_YYMM} VERSION ${TR_VERSION} LANGUAGES CXX)

# Sets up the install options
INCLUDE (InstallMacros)
Expand All @@ -61,6 +61,11 @@ CMAKE_DEPENDENT_OPTION (TR_APP "Enables the building of trApp library" ON "TR_CO
# *****************************************************************************
# Sets Advanced options ***********************************************************
# *****************************************************************************
OPTION (TR_INSTALL_INTEGRATED_EXT "Sets the Ext folder to be integrated on Install into bin/lib/install folders of TR. \
If OFF the folder will be copied unchanged as the whole Ext folder and the user will need to manually setup paths to the Ext resources." ON)
MARK_AS_ADVANCED (TR_INSTALL_INTEGRATED_EXT)
OPTION (TR_INSTALL_ENVIRONMENT_SCRIPTS "Install TR environment scripts into a System folder. You need Admin privleges for this." OFF)
MARK_AS_ADVANCED (TR_INSTALL_ENVIRONMENT_SCRIPTS)
OPTION (TR_USE_DOUBLE_MATRIX "Set to OFF to build TR with float Matrix instead of double." ON)
MARK_AS_ADVANCED (TR_USE_DOUBLE_MATRIX)
OPTION (TR_USE_DOUBLE_VECTOR "Set to OFF to build TR with float Vector instead of double." ON)
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/FindGoogleTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ IF (TR_BUILD_WITH_DEBUG)
ENDIF ()

SET (${DEPENDENCY}_FOUND "NO")
IF (${DEPENDENCY}_INCLUDE_DIR)
IF ((${DEPENDENCY}_LIBRARY OR ${DEPENDENCY}_LIBRARY_DEBUG) AND ${DEPENDENCY}_INCLUDE_DIR)
SET (${DEPENDENCY}_FOUND "YES")
ENDIF ()
2 changes: 1 addition & 1 deletion CMakeModules/FindJsonCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ IF (TR_BUILD_WITH_DEBUG)
ENDIF ()

SET (${DEPENDENCY}_FOUND "NO")
IF (${DEPENDENCY}_INCLUDE_DIR)
IF ((${DEPENDENCY}_LIBRARY OR ${DEPENDENCY}_LIBRARY_DEBUG) AND ${DEPENDENCY}_INCLUDE_DIR)
SET (${DEPENDENCY}_FOUND "YES")
ENDIF ()
2 changes: 1 addition & 1 deletion CMakeModules/FindOSG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ IF (TR_BUILD_WITH_DEBUG)
ENDIF ()

SET (${DEPENDENCY}_FOUND "NO")
IF (${DEPENDENCY}_LIBRARY AND ${DEPENDENCY}_INCLUDE_DIR)
IF ((${DEPENDENCY}_LIBRARY OR ${DEPENDENCY}_LIBRARY_DEBUG) AND ${DEPENDENCY}_INCLUDE_DIR)
SET (${DEPENDENCY}_FOUND "YES")

IF (${DEPENDENCY}_FIND_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/FindOpenThreads.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ IF (TR_BUILD_WITH_DEBUG)
ENDIF ()

SET (${DEPENDENCY}_FOUND "NO")
IF (${DEPENDENCY}_LIBRARY AND ${DEPENDENCY}_INCLUDE_DIR)
IF ((${DEPENDENCY}_LIBRARY OR ${DEPENDENCY}_LIBRARY_DEBUG) AND ${DEPENDENCY}_INCLUDE_DIR)
SET (${DEPENDENCY}_FOUND "YES")
ENDIF ()
23 changes: 20 additions & 3 deletions CMakeModules/InstallMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SET (TR_HEADERS_INSTALLED "0" CACHE INTERNAL "System Use only: flag to show that
# Sets up default Windows install folders
# *****************************************************************************

IF(WIN32 AND NOT PATH_IS_SET)
IF (WIN32 AND NOT PATH_IS_SET)
IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (CMAKE_INSTALL_PREFIX "C:/Program Files/${CMAKE_PROJECT_NAME}" CACHE STRING "Install Path" FORCE)
ELSE ()
Expand All @@ -50,8 +50,12 @@ MACRO (TR_INSTALL_OPTIONS arg)

IF (TR_EXT_INSTALLED EQUAL 0)
INSTALL (CODE "MESSAGE(\"Installing the External Dependencies.\")")
IF(EXISTS "${CMAKE_SOURCE_DIR}/Ext")
INSTALL (DIRECTORY "${CMAKE_SOURCE_DIR}/Ext/" DESTINATION .)
IF (EXISTS "${CMAKE_SOURCE_DIR}/Ext")
IF (TR_INSTALL_INTEGRATED_EXT)
INSTALL (DIRECTORY "${CMAKE_SOURCE_DIR}/Ext/" DESTINATION .)
ELSE ()
INSTALL (DIRECTORY "${CMAKE_SOURCE_DIR}/Ext" DESTINATION .)
ENDIF ()
SET (TR_EXT_INSTALLED "1" CACHE INTERNAL "System Use only: flag to show that the Ext folder was installed" FORCE)
ELSE ()
INSTALL (CODE "MESSAGE(\"Ext folder is missing from ${CMAKE_SOURCE_DIR}\")")
Expand All @@ -77,6 +81,19 @@ MACRO (TR_INSTALL_OPTIONS arg)
)
ENDMACRO ()

# *****************************************************************************
# Configures the installation options for the environment scripts project *****
# *****************************************************************************
MACRO (TR_INSTALL_SCRIPT_FILES filesList)
IF (WIN32)
INSTALL (CODE "MESSAGE(\"Installing the Environment Scripts.\")")
INSTALL (FILES ${filesList} DESTINATION $ENV{windir})
ELSEIF (UNIX)
INSTALL (CODE "MESSAGE(\"Installing the Environment Scripts.\")")
INSTALL (FILES ${filesList} DESTINATION /usr/local/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF ()
ENDMACRO ()

# *****************************************************************************
# Configures the build folder, making sure it has all the needed data files ***
# *****************************************************************************
Expand Down
30 changes: 14 additions & 16 deletions CMakeModules/PlatformConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ELSE ()
ENDIF ()

# Sets the Debug and Release library naming formats, but not executables.
IF (TR_BUILD_VERSIONED_LIBRARIES)
IF (TR_BUILD_VERSIONED_LIBRARIES)
IF (WIN32)
SET (CMAKE_SHARED_LIBRARY_PREFIX ${TR_SO_PREFIX})
SET (CMAKE_STATIC_LIBRARY_PREFIX ${TR_SO_PREFIX})
Expand All @@ -62,7 +62,7 @@ IF (TR_BUILD_VERSIONED_LIBRARIES)
ENDIF ()
ENDIF ()

# Sets the postfix on libraries.
# Sets the postfix on libraries.
SET (CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "Set Debug library postfix" FORCE)
SET (CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set Release library postfix" FORCE)
SET (CMAKE_RELWITHDEBINFO_POSTFIX "-rd" CACHE STRING "Set RelWithDebInfo library postfix" FORCE)
Expand All @@ -86,7 +86,7 @@ ENDIF ()
IF (UNIX)
MESSAGE (STATUS "\nConfiguring for Unix")
READ_GCC_VERSION()
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-non-virtual-dtor -Wreturn-type")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-non-virtual-dtor -Wreturn-type -Werror")
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")

MESSAGE (STATUS "GCC Version: ${GCC_MAJOR}.${GCC_MINOR}")
Expand All @@ -96,39 +96,37 @@ IF (UNIX)
OPTION (CMAKE_VERBOSE_MAKEFILE "Users may enable the option in their local build tree to get more verbose output from Makefile builds and show each command line as it is launched." ON)
OPTION (CMAKE_COLOR_MAKEFILE "When enabled, the generated Makefiles will produce colored output. Default is ON" ON)

IF (CMAKE_INSTALL_PREFIX STREQUAL "/usr/local" OR CMAKE_INSTALL_PREFIX STREQUAL "/usr/local/")
SET (CMAKE_INSTALL_PREFIX "/usr/local/${PROJECT_NAME}" CACHE STRING "TrueReality default install folder" FORCE)
ELSEIF (CMAKE_INSTALL_PREFIX STREQUAL "/opt" OR CMAKE_INSTALL_PREFIX STREQUAL "/opt/")
SET (CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}" CACHE STRING "TrueReality default install folder" FORCE)
ENDIF ()
IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET (CMAKE_INSTALL_PREFIX "/usr/local/${PROJECT_NAME}" CACHE STRING "TrueReality default install folder" FORCE)
ENDIF ()
ENDIF ()

IF (WIN32)
MESSAGE (STATUS "\nConfiguring for Windows")

IF (MSVC_IDE)
# Enables folder creation in VS projects.

# Enables folder creation in VS projects.
SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)

# Set all the initial CXX options
SET (CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /GR /EHsc /nologo")
SET (CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /WX /GR /EHsc /nologo")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /std:c++17") #This is used because cmake 3.14.3 has a bug. Check later if it can be removed

# Enable multi-core builds
OPTION (TR_BUILD_WITH_MP "Enables the /MP multi-processor compiler option for Visual Studio 2005 and above" ON)
OPTION (TR_BUILD_WITH_MP "Enables the /MP multi-processor compiler option for Visual Studio 2005 and above" ON)
MARK_AS_ADVANCED (TR_BUILD_WITH_MP)
IF (TR_BUILD_WITH_MP)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF ()

# Enable strict checking
OPTION (TR_BUILD_WITH_STRICT "Enables the Option STRICT for VS compiler" ON)
MARK_AS_ADVANCED (TR_BUILD_WITH_STRICT)
IF (TR_BUILD_WITH_STRICT)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTRICT")
ENDIF ()

# Reduce the number of default headers included in a VS build
OPTION (TR_BUILD_WITH_LEAN_AND_MEAN "Enables the option LEAN_AND_MEAN for VS compiler, to speed up compilation" ON)
MARK_AS_ADVANCED (TR_BUILD_WITH_LEAN_AND_MEAN)
Expand All @@ -138,7 +136,7 @@ IF (WIN32)

#If we are using Boost
IF (BoostLibs_FOUND)
#Sets temporary warning suppression flags. These should be revisited and rechecked at every VS version and Ext dependency change.
#Sets temporary warning suppression flags. These should be revisited and rechecked at every VS version and Ext dependency change.
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE") #Boost has a bug with using an old config file with VS2017
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DBOOST_ALL_DYN_LINK") #Force only boost dynamic libraries to be used
LINK_DIRECTORIES (${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS}) #Force all projects to have boost dirs as aditional library paths
Expand Down
5 changes: 5 additions & 0 deletions CMakeModules/UtilityMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ MACRO (ADD_TR_SUBFOLDERS)
SET (TR_VERSION_UTIL_AVAILABLE "YES")
ENDIF ()

IF (TR_INSTALL_ENVIRONMENT_SCRIPTS)
ADD_SUBDIRECTORY (Scripts)
SET (TR_INSTALL_ENVIRONMENT_SCRIPTS_AVAILABLE "YES")
ENDIF ()

# Examples folders
MESSAGE (STATUS "Creating Selected Example Folders")

Expand Down
14 changes: 8 additions & 6 deletions Data/FindTR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,16 @@ TR_FIND_LIBRARY(UTIL trUtil)

# Sets TR_FOUND flag if we have TR of the version the user asked for
SET (${DEPENDENCY}_FOUND "NO")
IF (${DEPENDENCY}_APP_LIBRARY_FOUND AND ${DEPENDENCY}_BASE_LIBRARY_FOUND AND ${DEPENDENCY}_CORE_LIBRARY_FOUND AND ${DEPENDENCY}_MANAGER_LIBRARY_FOUND AND ${DEPENDENCY}_SG_LIBRARY_FOUND AND ${DEPENDENCY}_UTIL_LIBRARY_FOUND )
IF ((${DEPENDENCY}_APP_LIBRARY_FOUND AND ${DEPENDENCY}_BASE_LIBRARY_FOUND AND ${DEPENDENCY}_CORE_LIBRARY_FOUND AND ${DEPENDENCY}_MANAGER_LIBRARY_FOUND AND ${DEPENDENCY}_SG_LIBRARY_FOUND AND ${DEPENDENCY}_UTIL_LIBRARY_FOUND) OR
(${DEPENDENCY}_APP_DEBUG_LIBRARY_FOUND AND ${DEPENDENCY}_BASE_DEBUG_LIBRARY_FOUND AND ${DEPENDENCY}_CORE_DEBUG_LIBRARY_FOUND AND ${DEPENDENCY}_MANAGER_DEBUG_LIBRARY_FOUND AND ${DEPENDENCY}_SG_DEBUG_LIBRARY_FOUND AND ${DEPENDENCY}_UTIL_DEBUG_LIBRARY_FOUND))

# All the library header folders should be in the same place, so we can just use the Core libraries path
SET(${DEPENDENCY}_INCLUDE_DIR ${${DEPENDENCY}_CORE_INCLUDE_DIR})

# Detect what version of True Reality was found, if any
SET (TR_VERSION_FILE "${${DEPENDENCY}_INCLUDE_DIR}/../Data/Config/Version.trver")
FILE (READ ${TR_VERSION_FILE} TR_VERSION_CONTENT)
IF (TR_BUILD_WITH_RELEASE)
SET(${DEPENDENCY}_INCLUDE_DIR ${${DEPENDENCY}_CORE_INCLUDE_DIR})
ENDIF ()
IF (TR_BUILD_WITH_DEBUG)
SET(${DEPENDENCY}_INCLUDE_DIR ${${DEPENDENCY}_CORE_DEBUG_INCLUDE_DIR})
ENDIF ()

IF ("${TR_VERSION_CONTENT}" STREQUAL "")
MESSAGE("Missing the version file")
Expand Down
108 changes: 54 additions & 54 deletions Examples/ActorModules/Application.cpp
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
/*
* True Reality Open Source Game and Simulation Engine
* Copyright © 2019 Acid Rain Studios LLC
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3.0 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @author Maxim Serebrennik
*/

#include "Application.h"
#include "TestActor.h"
#include "TestDirector.h"

#include <trUtil/Console/TextColor.h>
#include <trManager/SystemManager.h>

const trUtil::RefStr Application::CLASS_TYPE = trUtil::RefStr("Application");

//////////////////////////////////////////////////////////////////////////
Application::Application(const std::string& name) : BaseClass(name)
{
//Create Test Actor 1
trUtil::Console::TextColor(trUtil::Console::TXT_COLOR::BRIGHT_GREEN);
std::cerr << "Creating Test Actor. " << std::endl;
mSysMan->RegisterActor(*new TestActor());

//Create Test Director
trUtil::Console::TextColor(trUtil::Console::TXT_COLOR::BRIGHT_GREEN);
std::cerr << "Creating a Test Director. " << std::endl;
mSysMan->RegisterDirector(*new TestDirector(), trManager::DirectorPriority::NORMAL);
}

//////////////////////////////////////////////////////////////////////////
const std::string& Application::GetType() const
{
return CLASS_TYPE;
}

//////////////////////////////////////////////////////////////////////////
Application::~Application()
{
}
/*
* True Reality Open Source Game and Simulation Engine
* Copyright © 2019 Acid Rain Studios LLC
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3.0 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @author Maxim Serebrennik
*/

#include "Application.h"
#include "TestActor.h"
#include "TestDirector.h"

#include <trUtil/Console/TextColor.h>
#include <trManager/SystemManager.h>

const trUtil::RefStr Application::CLASS_TYPE = trUtil::RefStr("Application");

//////////////////////////////////////////////////////////////////////////
Application::Application(const std::string& name) : BaseClass(name)
{
//Create Test Actor 1
trUtil::Console::TextColor(trUtil::Console::TXT_COLOR::BRIGHT_GREEN);
std::cerr << "Creating Test Actor. " << std::endl;
mSysMan->RegisterActor(*new TestActor());

//Create Test Director
trUtil::Console::TextColor(trUtil::Console::TXT_COLOR::BRIGHT_GREEN);
std::cerr << "Creating a Test Director. " << std::endl;
mSysMan->RegisterDirector(*new TestDirector(), trManager::DirectorPriority::NORMAL);
}

//////////////////////////////////////////////////////////////////////////
const std::string& Application::GetType() const
{
return CLASS_TYPE;
}

//////////////////////////////////////////////////////////////////////////
Application::~Application()
{
}
Loading

0 comments on commit 348ec91

Please sign in to comment.