Permalink
Browse files

Merge branch 'master' of https://github.com/RuntimeCompiledCPlusPlus/…

  • Loading branch information...
2 parents c3e8ec3 + 1c0a51a commit bfebc8caef81ab3881742586f3eb5834357c468c Doug Binks committed Mar 18, 2013
Showing with 215 additions and 103 deletions.
  1. +138 −102 Aurora/CMakeLists.txt
  2. +64 −0 Aurora/cmake/ProjectFiles.cmake
  3. +13 −1 readme.md
View
@@ -1,104 +1,140 @@
cmake_minimum_required(VERSION 2.8)
-add_subdirectory(External/libRocket/Build)
-
-include_directories(
- External/libRocket/Include
-)
-
-set(RCC_SOURCE
- Renderer/AURenderContext.cpp
- Renderer/AURenMesh.cpp
- RuntimeCompiler/BuildTool.cpp
- RuntimeCompiler/Compiler_PlatformPosix.cpp
- RuntimeCompiler/FileChangeNotifier.cpp
- RuntimeCompiler/FileMonitor.cpp
- RuntimeCompiler/SimpleFileWatcher/FileWatcher.cpp
- RuntimeCompiler/SimpleFileWatcher/FileWatcherLinux.cpp
- RuntimeObjectSystem/ObjectFactorySystem/ObjectFactorySystem.cpp
- RuntimeObjectSystem/ObjectInterfacePerModuleSource.cpp
- RuntimeObjectSystem/RuntimeObjectSystem.cpp
- RuntimeObjectSystem/RuntimeObjectSystem_PlatformPosix.cpp
- RuntimeObjectSystem/SimpleSerializer/SimpleSerializer.cpp
-)
-
-
-set(CONSOLE_EXAMPLE_SOURCE
- Examples/ConsoleExample/ConsoleExample.cpp
- Examples/ConsoleExample/ConsoleGame.cpp
- Examples/ConsoleExample/RuntimeObject01.cpp
- Examples/ConsoleExample/StdioLogSystem.cpp
-)
-
-set(SIMPLE_TEST_SOURCE
- Examples/SimpleTest/Behavior_Infected_Approach.cpp
- Examples/SimpleTest/Behavior_Infected_Combat.cpp
- Examples/SimpleTest/Behavior_Infected_HuntRBC.cpp
- Examples/SimpleTest/Behavior_Infected_HuntWBC.cpp
- Examples/SimpleTest/Behavior_Infected_Idle.cpp
- Examples/SimpleTest/Behavior_RBC_Approach.cpp
- Examples/SimpleTest/Behavior_RBC_Combat.cpp
- Examples/SimpleTest/Behavior_RBC_Evade.cpp
- Examples/SimpleTest/Behavior_RBC_Idle.cpp
- Examples/SimpleTest/BehaviorTree_Infected.cpp
- Examples/SimpleTest/BehaviorTreeManager.cpp
- Examples/SimpleTest/BehaviorTree_RBC.cpp
- Examples/SimpleTest/BehaviorTree_Virus.cpp
- Examples/SimpleTest/BehaviorTree_WBC.cpp
- Examples/SimpleTest/Behavior_Virus_Approach.cpp
- Examples/SimpleTest/Behavior_Virus_Combat.cpp
- Examples/SimpleTest/Behavior_Virus_HuntRBC.cpp
- Examples/SimpleTest/Behavior_Virus_HuntWBC.cpp
- Examples/SimpleTest/Behavior_Virus_Idle.cpp
- Examples/SimpleTest/Behavior_WBC_Approach.cpp
- Examples/SimpleTest/Behavior_WBC_Combat.cpp
- Examples/SimpleTest/Behavior_WBC_Idle.cpp
- Examples/SimpleTest/Behavior_WBC_Patrol.cpp
- Examples/SimpleTest/BlackboardManager.cpp
- Examples/SimpleTest/CameraControl.cpp
- Examples/SimpleTest/CompilerLogger.cpp
- Examples/SimpleTest/CompilingNotification.cpp
- Examples/SimpleTest/Console.cpp
- Examples/SimpleTest/Environment.cpp
- Examples/SimpleTest/FPSCounter.cpp
- Examples/SimpleTest/Game.cpp
- Examples/SimpleTest/GameManager.cpp
- Examples/SimpleTest/GameObject.cpp
- Examples/SimpleTest/InputManager.cpp
- Examples/SimpleTest/LightingControl.cpp
- Examples/SimpleTest/Main.cpp
- Examples/SimpleTest/MainMenu.cpp
- Examples/SimpleTest/MainObject.cpp
- Examples/SimpleTest/PerceptionManager.cpp
- Examples/SimpleTest/PhysicsManager.cpp
- Examples/SimpleTest/SplashScreen.cpp
- Systems/AssetSystem/AssetSystem.cpp
- Systems/EntitySystem/EntitySystem.cpp
- Systems/GUISystem/GUIDocument.cpp
- Systems/GUISystem/GUIElement.cpp
- Systems/GUISystem/GUISystem.cpp
- Systems/GUISystem/ReferenceCountable.cpp
- Systems/LogSystem/FileLogSystem/FileLogSystem.cpp
- Systems/LogSystem/MultiLogSystem/MultiLogSystem.cpp
- Systems/LogSystem/RocketLogSystem/RocketLogSystem.cpp
- Systems/LogSystem/ThreadsafeLogSystem/ThreadsafeLogSystem_PlatformWindows.cpp
- Systems/RocketLibSystem/Input.cpp
- Systems/RocketLibSystem/InputGLFW.cpp
- Systems/RocketLibSystem/RocketLibSystem.cpp
- Systems/RocketLibSystem/RocketLibSystemFileInterface.cpp
- Systems/RocketLibSystem/RocketLibSystemGLFW.cpp
- Systems/RocketLibSystem/RocketLibSystemRenderInterfaceOpenGL.cpp
- Systems/RocketLibSystem/RocketLibSystemSystemInterface.cpp
- Systems/Systems.cpp
- Systems/TimeSystem/TimeSystem.cpp
- Renderer/AURenderContext.cpp
- Renderer/AURenMesh.cpp
-)
-
-add_library(RCC SHARED ${RCC_SOURCE} )
-
-add_executable(ConsoleExample ${CONSOLE_EXAMPLE_SOURCE})
-target_link_libraries(ConsoleExample RCC RocketCore RocketControls RocketDebugger GL glfw)
-
-add_executable(SimpleTest ${SIMPLE_TEST_SOURCE})
-target_link_libraries(SimpleTest RCC RocketCore RocketControls RocketDebugger GL glfw)
+#
+# Options
+#
+option(BUILD_EXAMPLES "Build example applications" ON)
+option(GLFW_SYSTEM "Use the oprating system glfw library" OFF)
+
+find_package(OpenGL REQUIRED)
+
+if(UNIX)
+ set(BUILD_TYPE SHARED)
+else()
+ set(BUILD_TYPE STATIC)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+endif()
+
+include(cmake/ProjectFiles.cmake)
+
+#
+# RuntimeCompiler
+#
+add_library(RuntimeCompiler ${BUILD_TYPE} ${RuntimeCompiler_SRCS})
+
+#
+# RuntimeObjectSystem
+#
+add_library(RuntimeObjectSystem ${BUILD_TYPE} ${RuntimeObjectSystem_SRCS})
+target_link_libraries(RuntimeObjectSystem RuntimeCompiler)
+if(UNIX)
+ target_link_libraries(RuntimeObjectSystem dl)
+endif()
+
+if(BUILD_EXAMPLES)
+
+ #
+ # ConsoleExample
+ #
+
+ add_executable(ConsoleExample ${ConsoleExample_SRCS})
+ target_link_libraries(ConsoleExample RuntimeCompiler RuntimeObjectSystem)
+
+ #
+ # Renderer
+ #
+
+ add_library(Renderer ${BUILD_TYPE} ${Renderer_SRCS})
+ target_link_libraries(Renderer ${OPENGL_LIBRARIES} ${ASSIMP_LIBRARIES})
+
+ #
+ # Systems
+ #
+
+ add_library(Systems ${BUILD_TYPE} ${Systems_SRCS})
+
+ #
+ # Freetype WIN32
+ #
+
+ if(WIN32)
+ set(FREETYPE_INCLUDE_DIR_freetype2 ${CMAKE_SOURCE_DIR}/External/support/freetype/include/freetype)
+ set(FREETYPE_INCLUDE_DIR_ft2build ${CMAKE_SOURCE_DIR}/External/support/freetype/include)
+ if(${CMAKE_CL_64})
+ set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/freetype2410MTx64.lib)
+ else()
+ set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/freetype2410MT.lib)
+ endif()
+ endif()
+
+ #
+ # glfw
+ #
+ if(GLFW_SYSTEM)
+ set(GLFW_LIBRARIES glfw)
+ else()
+ include_directories(External/glfw/include)
+ add_library( glfw STATIC IMPORTED )
+ if(APPLE)
+ set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libOSX/libglfw.a )
+ set(GLFW_LIBRARIES glfw)
+ elseif(WIN32)
+ set(GLFW_LIBRARIES glfw)
+ if(${CMAKE_CL_64})
+ set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libWin/GLFWx64.lib )
+ else()
+ set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libWin/GLFWx86.lib )
+ endif()
+ else()
+ set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libX11/libglfw.a )
+ set(GLFW_LIBRARIES glfw X11)
+ endif()
+ endif()
+
+ #
+ # assimp
+ #
+
+ if(WIN32)
+ add_library( assimp STATIC IMPORTED )
+ set(ASSIMP_LIBRARIES assimp)
+ if(${CMAKE_CL_64})
+ set_target_properties( assimp PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/assimp/lib/assimp_release-dll_x64/assimp.lib )
+ file(COPY ${CMAKE_SOURCE_DIR}/External/assimp/bin/assimp_release-dll_win32/Assimp64.dll DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
+ else()
+ set_target_properties( assimp PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/assimp/lib/assimp_release-dll_win32/assimp.lib )
+ file(COPY ${CMAKE_SOURCE_DIR}/External/assimp/bin/assimp_release-dll_win32/Assimp32.dll DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
+ endif()
+ endif()
+
+ #
+ # SimpleTest
+ #
+
+ add_subdirectory(External/libRocket/Build)
+ include_directories(
+ ${OPENGL_INCLUDE_DIR}
+ External/libRocket/Include
+ External/assimp/include
+ )
+ if(WIN32)
+ add_executable(SimpleTest WIN32 ${SimpleTest_SRCS})
+ else()
+ add_executable(SimpleTest ${SimpleTest_SRCS})
+ endif()
+ target_link_libraries(SimpleTest
+ RuntimeCompiler
+ RuntimeObjectSystem
+ Renderer
+ Systems
+ RocketCore
+ RocketControls
+ RocketDebugger
+ ${OPENGL_LIBRARIES}
+ ${GLFW_LIBRARIES}
+ ${ASSIMP_LIBRARIES}
+ )
+
+endif()
@@ -0,0 +1,64 @@
+
+#
+# RuntimeCompiler Source
+#
+
+aux_source_directory(RuntimeCompiler RuntimeCompiler_SRCS)
+aux_source_directory(RuntimeCompiler/SimpleFileWatcher SimpleFileWatcher_SRCS)
+
+if(UNIX)
+ list(REMOVE_ITEM RuntimeCompiler_SRCS "RuntimeCompiler/Compiler_PlatformWindows.cpp")
+ list(REMOVE_ITEM SimpleFileWatcher_SRCS "RuntimeCompiler/SimpleFileWatcher/FileWatcherWin32.cpp")
+ if(APPLE)
+ list(REMOVE_ITEM SimpleFileWatcher_SRCS "RuntimeCompiler/SimpleFileWatcher/FileWatcherLinux.cpp")
+ else()
+ list(REMOVE_ITEM SimpleFileWatcher_SRCS "RuntimeCompiler/SimpleFileWatcher/FileWatcherOSX.cpp")
+ endif()
+else()
+ list(REMOVE_ITEM RuntimeCompiler_SRCS "RuntimeCompiler/Compiler_PlatformPosix.cpp")
+ list(REMOVE_ITEM SimpleFileWatcher_SRCS "RuntimeCompiler/SimpleFileWatcher/FileWatcherOSX.cpp")
+ list(REMOVE_ITEM SimpleFileWatcher_SRCS "RuntimeCompiler/SimpleFileWatcher/FileWatcherLinux.cpp")
+endif()
+
+set(RuntimeCompiler_SRCS ${RuntimeCompiler_SRCS} ${SimpleFileWatcher_SRCS})
+
+#
+# RuntimeObjectSystem Source
+#
+
+aux_source_directory(RuntimeObjectSystem RuntimeObjectSystem_SRCS)
+aux_source_directory(RuntimeObjectSystem/ObjectFactorySystem ObjectFactorySystem_SRCS)
+aux_source_directory(RuntimeObjectSystem/SimpleSerializer SimpleSerializer_SRCS)
+
+set(RuntimeCompiler_SRCS ${RuntimeCompiler_SRCS} ${ObjectFactorySystem_SRCS} ${SimpleSerializer_SRCS})
+
+if(UNIX)
+ list(REMOVE_ITEM RuntimeObjectSystem_SRCS "RuntimeObjectSystem/RuntimeObjectSystem_PlatformWindows.cpp")
+else()
+ list(REMOVE_ITEM RuntimeObjectSystem_SRCS "RuntimeObjectSystem/RuntimeObjectSystem_PlatformPosix.cpp")
+endif()
+
+#
+# Example applications
+#
+
+if(BUILD_EXAMPLES)
+ #
+ # ConsoleExample Source
+ #
+ aux_source_directory(Examples/ConsoleExample ConsoleExample_SRCS)
+ #
+ # SimpleTest Source
+ #
+ aux_source_directory(Examples/SimpleTest SimpleTest_SRCS)
+ #
+ # Renderer Source
+ #
+ aux_source_directory(Renderer Renderer_SRCS)
+ #
+ # Systems Source
+ #
+ #aux_source_directory(Systems Systems_SRCS)
+ file(GLOB_RECURSE Systems_SRCS "Systems/*.cpp")
+endif()
+
View
@@ -12,8 +12,20 @@ Runtime-Compiled C++ is a way to reliably make major changes to your C++ code at
- Windows XP+, Visual Studio 2008+. Note we currently distribute only the VS 2010 solution and projects.
- Mac OS X 10.7+ with XCode 4.
- Linux using Eclipse CDT (tested Ubuntu 12.04 64bit).
+- cmake (many thanks to user join_the_fun from reddit)
-For Visual Studio and XCode the main project file is found in the Aurora directory. For Eclipse use File->Import->General->Existing Projects into Workspace and select the RuntimeCompiledCPlusPlus directory and import all projects it finds (best not to copy so you can keep everything up to date with git).
+For Visual Studio and XCode the main project file is found in the Aurora directory. All dependencies should be normally present.
+
+Linux requires the following dependencies installed for the SimpleTest project (use "sudo apt-get install NAME"):
+- libfreetype6-dev
+- libx11-dev
+- libgl1-mesa-dev
+- libgl1u-mesa-dev
+- libglfw-dev, if using system glfw, otherwise this comes prebuilt for 64bit Linux. To use the system glfw set the option GLFW_SYSTEM to ON - cmake .. -DGLFW_SYSTEM=ON
+
+For Eclipse use File->Import->General->Existing Projects into Workspace and select the RuntimeCompiledCPlusPlus directory and import all projects it finds (best not to copy so you can keep everything up to date with git).
+
+For cmake, create a folder called build in the Aurora directory and run cmake from there followed by make: on Linux run "mkdir build && cd build && cmake .. && make" from Aurora dir.
## License (zlib)

0 comments on commit bfebc8c

Please sign in to comment.