diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,316 +1,316 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.14.3) set(CMAKE_TOOLCHAIN_FILE "cmake/toolchain.cmake" CACHE STRING "Toolchain file for dependencies") set(HUNTER_CONFIGURATION_TYPES "Release" CACHE STRING "Build configuration types") option(HUNTER_BUILD_SHARED_LIBS "Build dependencies as shared libraries" ON) option(HUNTER_STATUS_DEBUG "Print detailed hunter debugging info" OFF) include("cmake/HunterGate.cmake") HunterGate( - URL "https://github.com/ruslo/hunter/archive/v0.23.155.tar.gz" - SHA1 "6421d63cc4fd78b8622e863c6b1dcabce98e1216" - LOCAL + URL "https://github.com/ruslo/hunter/archive/v0.23.164.tar.gz" + SHA1 "7bcf092561389dbd70edb3fc228126ae4605e10c" + LOCAL ) + project(echo3 VERSION 0.1) - ### Require out-of-source builds file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH) if(EXISTS "${LOC_PATH}") message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles.") endif() ### Default build type if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif() ### CMake variables set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON) ### Install dependencies with hunter hunter_add_package(Boost COMPONENTS chrono date_time filesystem random regex system thread timer) hunter_add_package(Box2D) hunter_add_package(bullet) hunter_add_package(freetype) hunter_add_package(glew) hunter_add_package(libogg) hunter_add_package(OpenAL) hunter_add_package(PNG) hunter_add_package(Protobuf) hunter_add_package(RapidJSON) hunter_add_package(tmxparser) hunter_add_package(utf8) hunter_add_package(vorbis) hunter_add_package(websocketpp) hunter_add_package(ZLIB) ### Find dependencies find_package(Boost CONFIG REQUIRED chrono date_time filesystem random regex system thread timer) find_package(Box2D CONFIG REQUIRED) find_package(bullet CONFIG REQUIRED) find_package(freetype CONFIG REQUIRED) find_package(glew CONFIG REQUIRED) find_package(libogg CONFIG REQUIRED) find_package(OpenAL CONFIG REQUIRED) find_package(PNG CONFIG REQUIRED) find_package(Protobuf CONFIG REQUIRED) find_package(RapidJSON CONFIG REQUIRED) find_package(tmxparser CONFIG REQUIRED) find_package(utf8 CONFIG REQUIRED) find_package(vorbis CONFIG REQUIRED) find_package(websocketpp CONFIG REQUIRED) find_package(ZLIB CONFIG REQUIRED) ### Include system libraries ### NOTE ### ### The following packages must be manually installed. On 18.04 they are: libgtkglextmm-x11-1.2-dev libmodplug-dev ### TODO Remove these dependencies ### QT5 exists as a hunter package, Sean said we may be able to use this instead of GTK ### libmodplug can probably be easily hunterised, Sebastien will look into this when he gets time set(ENV{PKG_CONFIG_PATH} "/usr/lib/pkgconfig:/usr/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig") find_package(PkgConfig REQUIRED) pkg_check_modules(gtkglextmm REQUIRED gtkglextmm-1.2) pkg_check_modules(modplug REQUIRED IMPORTED_TARGET libmodplug) add_library(echo3 SHARED proto/Font.proto proto/GUI.proto proto/MappedInputDevice.proto proto/Material.proto src/Animation/Animation.cpp src/Animation/AnimationState.cpp src/Animation/AnimationTrack.cpp src/Animation/BoneAnimationTrack.cpp src/Animation/SkeletonAnimation.cpp src/Animation/SkeletonAnimationState.cpp src/Animation/Skeleton.cpp src/Animation/SpriteAnimation.cpp src/Application.cpp src/Audio/AudioBuffer.cpp src/Audio/Audio.cpp src/Audio/AudioPlayer.cpp src/Audio/AudioSource.cpp src/Audio/AudioStream.cpp src/Chrono/Chrono.cpp src/Chrono/CPUTimer.cpp src/Chrono/FrameRateLimiter.cpp src/FileSystem/File.cpp src/FileSystem/FileReferenceEncrypted.cpp src/FileSystem/FileReferenceFile.cpp src/FileSystem/FileReferenceMemory.cpp src/FileSystem/FileReferenceVFS.cpp src/FileSystem/FileSystem.cpp src/FileSystem/FileSystemSource.cpp src/FileSystem/FileSystemSourceEncrypted.cpp src/FileSystem/FileSystemSourceFile.cpp src/FileSystem/FileSystemSourceMemory.cpp src/FileSystem/FileSystemSourceVFS.cpp src/Graphics/Camera.cpp src/Graphics/CameraDollies.cpp src/Graphics/Colour.cpp src/Graphics/ElementBuffer.cpp src/Graphics/Frustum.cpp src/Graphics/Light.cpp src/Graphics/MaterialAnimation.cpp src/Graphics/Material.cpp src/Graphics/Mesh.cpp src/Graphics/MultipassRenderable.cpp src/Graphics/MultiRenderer.cpp src/Graphics/Node.cpp src/Graphics/PrimitiveTypes.cpp src/Graphics/Renderable.cpp src/Graphics/Renderer.cpp src/Graphics/RenderPass.cpp src/Graphics/RenderTarget.cpp src/Graphics/RenderTargetNotifier.cpp src/Graphics/Scene.cpp src/Graphics/SceneEntity.cpp src/Graphics/SceneRenderable.cpp src/Graphics/Shader.cpp src/Graphics/ShaderProgram.cpp src/Graphics/SkyBox.cpp src/Graphics/Sprite.cpp src/Graphics/StereoscopicRenderer.cpp src/Graphics/SubMesh.cpp src/Graphics/Terrain.cpp src/Graphics/TextMesh.cpp src/Graphics/Texture.cpp src/Graphics/TextureUnit.cpp src/Graphics/VertexAttribute.cpp src/Graphics/VertexBuffer.cpp src/Graphics/Viewport.cpp src/GUI/Button.cpp src/GUI/Container.cpp src/GUI/Cursor.cpp src/GUI/Element.cpp src/GUI/GUI.cpp src/GUI/Image.cpp src/GUI/Layout.cpp src/GUI/Menu.cpp src/GUI/Screen.cpp src/GUI/TextBox.cpp src/GUI/Text.cpp src/Input/GenericInputDevice.cpp src/Input/Input.cpp src/Input/InputDevice.cpp src/Input/MappedInputDevice.cpp src/Input/MappedInputDeviceLoader.cpp src/Input/OnScreenAnalogueStick.cpp src/Input/PseudoKeyboard.cpp src/Input/PseudoMouse.cpp src/Kernel/ExecutionModel.cpp src/Kernel/Kernel.cpp src/Kernel/Task.cpp src/Kernel/TaskGroup.cpp src/Kernel/TaskManager.cpp src/Kernel/Thread.cpp src/Logging/Logging.cpp src/Maths/AxisAlignedBox.cpp src/Maths/EchoMaths.cpp src/Maths/Geometry.cpp src/Maths/Matrix4.cpp src/Maths/Plane.cpp src/Maths/Quaternion.cpp src/Maths/Vector4.cpp src/Network/Connection.cpp src/Network/ConnectionDetails.cpp src/Network/DataPacket.cpp src/Network/NetworkExecutionModel.cpp src/Network/NetworkManager.cpp src/Network/NetworkManagerUpdater.cpp src/Network/NetworkSystem.cpp src/Network/SocketNetworkSystem.cpp src/Network/TCPConnection.cpp src/Network/UDPConnection.cpp src/Network/WebSocketConnection.cpp src/Network/WebSocketNetworkSystem.cpp src/Physics/BulletDynamicMotionState.cpp src/Physics/BulletFactory.cpp src/Physics/BulletKinematicMotionState.cpp src/Physics/BulletMeshDebugDrawer.cpp src/Physics/BulletMeshPhysicsShape.cpp src/Physics/BulletMotionState.cpp src/Physics/BulletPhysicsShape.cpp src/Physics/BulletPhysicsWorld.cpp src/Physics/BulletRigidBody.cpp src/Physics/MotionState.cpp src/Physics/PhysicsBody.cpp src/Physics/PhysicsShape.cpp src/Physics/PhysicsWorld.cpp src/Platforms/AL/OpenALAudioBuffer.cpp src/Platforms/AL/OpenALAudio.cpp src/Platforms/Boost/BoostCPUTimer.cpp src/Platforms/Boost/BoostMutex.cpp src/Platforms/Boost/BoostThread.cpp src/Platforms/GL/FragmentShaderManager.cpp src/Platforms/GL/GLRenderTarget.cpp src/Platforms/GL/GLShader.cpp src/Platforms/GL/GLShaderProgram.cpp src/Platforms/GL/GLTexture.cpp src/Platforms/GL/VertexShaderManager.cpp src/Platforms/GTK/GTKExecutionModel.cpp src/Platforms/GTK/GTKKeyboard.cpp src/Platforms/GTK/GTKMouse.cpp src/Platforms/GTK/GTKWindow.cpp src/Platforms/Linux/Platform.cpp src/Platforms/Linux/SystemInformation.cpp src/Platforms/POSIX/POSIXShell.cpp src/Resource/3dsReader.cpp src/Resource/BitmapLoader.cpp src/Resource/FontManager.cpp src/Resource/MaterialManager.cpp src/Resource/MeshManager.cpp src/Resource/MeshReader.cpp src/Resource/OggAudioSource.cpp src/Resource/PNGLoader.cpp src/Resource/ResourceManager.cpp src/Resource/RIFFReader.cpp src/Resource/SkeletonManager.cpp src/Resource/SkeletonReader.cpp src/Resource/TextureLoader.cpp src/Resource/TextureManager.cpp src/Resource/WavAudioSource.cpp src/Resource/XMAudioSource.cpp src/Shell/Shell.cpp src/Tile/TileLayer.cpp src/Tile/TileLayerMesh.cpp src/Tile/TileMap.cpp src/Tile/TileSet.cpp src/Tile/TMXLoader.cpp src/Util/Configuration.cpp src/Util/ContextSwitcher.cpp src/Util/Parsers.cpp src/Util/RegEx.cpp src/Util/ScenePicker.cpp src/Util/StringSetter.cpp src/Util/StringUtils.cpp src/Util/Texture.cpp ) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/echo/generated) protobuf_generate(TARGET echo3 PROTOC_OUT_DIR ${CMAKE_BINARY_DIR}/include/echo/generated) target_link_libraries( echo3 PUBLIC Boost::chrono Boost::date_time Boost::filesystem Boost::random Boost::regex Boost::system Boost::thread Boost::timer Box2D::Box2D bullet::BulletCollision bullet::BulletDynamics bullet::LinearMath freetype::freetype glew::glew libogg::ogg OpenAL::OpenAL PNG::png protobuf::libprotobuf RapidJSON::rapidjson tmxparser utf8::utf8 vorbis::vorbis vorbis::vorbisfile websocketpp::websocketpp ZLIB::zlib PkgConfig::modplug ${gtkglextmm_LIBRARIES} ) target_include_directories( echo3 PUBLIC $ $ $ $ $ # TODO: Ideally we would not have to include this path ${gtkglextmm_INCLUDE_DIRS} ) target_compile_definitions( echo3 PUBLIC ECHO_PLATFORM_LINUX ) install(TARGETS echo3 EXPORT echo3Targets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) install(EXPORT echo3Targets FILE echo3Targets.cmake NAMESPACE echo3:: DESTINATION lib/cmake/echo3 ) configure_file(cmake/echo3Config.cmake.in echo3Config.cmake @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/echo3Config.cmake" DESTINATION lib/cmake/echo3 ) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/echo/generated/ DESTINATION include/echo/generated PATTERN "*.h") \ No newline at end of file +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/echo/generated/ DESTINATION include/echo/generated PATTERN "*.h") diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake --- a/cmake/Hunter/config.cmake +++ b/cmake/Hunter/config.cmake @@ -1,3 +1,2 @@ hunter_config(Boost VERSION 1.69.0-p0) -hunter_config(tmxparser VERSION 2.1.0-ab4125b-p1) hunter_config(utf8 VERSION 2.3.4-p0) \ No newline at end of file diff --git a/cmake/echo3Config.cmake.in b/cmake/echo3Config.cmake.in --- a/cmake/echo3Config.cmake.in +++ b/cmake/echo3Config.cmake.in @@ -1,19 +1,19 @@ include(CMakeFindDependencyMacro) find_dependency(Boost CONFIG REQUIRED chrono date_time filesystem random regex system thread timer) find_dependency(Box2D CONFIG REQUIRED) find_dependency(bullet CONFIG REQUIRED) find_dependency(freetype CONFIG REQUIRED) find_dependency(glew CONFIG REQUIRED) find_dependency(libogg CONFIG REQUIRED) find_dependency(OpenAL CONFIG REQUIRED) find_dependency(PNG CONFIG REQUIRED) find_dependency(Protobuf CONFIG REQUIRED) find_dependency(RapidJSON CONFIG REQUIRED) find_dependency(tmxparser CONFIG REQUIRED) find_dependency(utf8 CONFIG REQUIRED) find_dependency(vorbis CONFIG REQUIRED) find_dependency(websocketpp CONFIG REQUIRED) find_dependency(ZLIB CONFIG REQUIRED) -include("${CMAKE_CURRENT_LIST_DIR}/EchoTargets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/echo3Targets.cmake")