Browse Source

Use CMake's FeatureSummary tool to provide more info about dependencies

Michael Hansen 10 years ago
parent
commit
5b6896123b
  1. 157
      CMakeLists.txt
  2. 7
      Sources/Plasma/Apps/plClient/CMakeLists.txt
  3. 5
      Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt
  4. 31
      Sources/Tools/CMakeLists.txt

157
CMakeLists.txt

@ -1,6 +1,8 @@
project(Plasma)
cmake_minimum_required(VERSION 2.8.11.2)
include(FeatureSummary)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
@ -41,25 +43,128 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plasma_BINARY_DIR}/bin)
# Find all 3rd-party libraries that are required
set(Python_ADDITIONAL_VERSIONS 2.7)
find_package(OpenSSL REQUIRED)
set_package_properties(OpenSSL PROPERTIES
URL "https://www.openssl.org/"
DESCRIPTION "OpenSSL libraries for SSL/TLS"
TYPE REQUIRED
)
find_package(OpenAL REQUIRED)
set_package_properties(OpenAL PROPERTIES
URL "http://www.openal.org/"
DESCRIPTION "3D audio and EAX library"
TYPE REQUIRED
)
set(Python_ADDITIONAL_VERSIONS 2.7)
find_package(PythonLibs REQUIRED)
set_package_properties(PythonLibs PROPERTIES
URL "http://www.python.org"
DESCRIPTION "Python Scripting language C bindings"
TYPE REQUIRED
)
find_package(EXPAT REQUIRED)
set_package_properties(EXPAT PROPERTIES
URL "http://expat.sourceforge.net/"
DESCRIPTION "Expat XML Parser for C"
TYPE REQUIRED
)
find_package(ZLIB REQUIRED)
set_package_properties(ZLIB PROPERTIES
URL "http://www.zlib.net"
DESCRIPTION "Fast (de)compression library"
TYPE REQUIRED
)
find_package(JPEG REQUIRED)
set_package_properties(JPEG PROPERTIES
URL "http://libjpeg-turbo.virtualgl.org/"
DESCRIPTION "JPEG encoding and decoding library. libjpeg-turbo is recommended for better performance"
TYPE REQUIRED
)
find_package(PNG REQUIRED)
find_package(Ogg REQUIRED) #TODO: Not required if we aren't building the client
find_package(Vorbis REQUIRED) #TODO: Not required if we aren't building the client
find_package(Speex REQUIRED) #TODO: Not required if we aren't building the client
set_package_properties(PNG PROPERTIES
URL "http://www.libpng.org/pub/png/libpng.html"
DESCRIPTION "Efficient lossless image library"
TYPE REQUIRED
)
#TODO: Not required if we aren't building the client
find_package(Ogg REQUIRED)
set_package_properties(Ogg PROPERTIES
URL "https://xiph.org/ogg/"
DESCRIPTION "Ogg multimedia container library for various audio and video codecs"
TYPE REQUIRED
PURPOSE "Required for audio support in the client"
)
#TODO: Not required if we aren't building the client
find_package(Vorbis REQUIRED)
set_package_properties(Vorbis PROPERTIES
URL "https://xiph.org/vorbis/"
DESCRIPTION "Free and open audio codec for mid-to-high quality audio"
TYPE REQUIRED
PURPOSE "Required for audio support in the client"
)
#TODO: Not required if we aren't building the client
find_package(Speex REQUIRED)
set_package_properties(Speex PROPERTIES
URL "http://www.speex.org/"
DESCRIPTION "Free and open audio codec specifically designed for speech"
TYPE REQUIRED
PURPOSE "Required for in-game voice chat in the client"
)
find_package(VPX)
set_package_properties(VPX PROPERTIES
URL "http://www.webmproject.org/"
DESCRIPTION "VP8 and VP9 video codec"
TYPE OPTIONAL
PURPOSE "Required for in-game video playback support"
)
find_package(Opus)
set_package_properties(Opus PROPERTIES
URL "https://www.opus-codec.org/"
DESCRIPTION "Versatile free and open audio codec"
TYPE OPTIONAL
PURPOSE "Required for in-game video playback support"
)
find_package(CURL REQUIRED)
set_package_properties(CURL PROPERTIES
URL "http://curl.haxx.se/libcurl/"
DESCRIPTION "Multi-protocol file transfer library"
TYPE REQUIRED
)
find_package(Freetype)
set_package_properties(Freetype PROPERTIES
URL "http://www.freetype.org/"
DESCRIPTION "Library for rendering fonts"
TYPE OPTIONAL
PURPOSE "Required in order to build the plFontConverter tool"
)
if(WIN32)
find_package(PhysX REQUIRED) #TODO: Not required if we aren't building the client
#TODO: Not required if we aren't building the client
find_package(PhysX REQUIRED)
set_package_properties(PhysX PROPERTIES
URL "https://developer.nvidia.com/physx-sdk"
DESCRIPTION "Library for hardware-accelerated physics simulation for gaming"
TYPE REQUIRED
)
find_package(DirectX REQUIRED)
set_package_properties(DirectX PROPERTIES
DESCRIPTION "Framework for hardware-accelerated 3D graphics on Microsoft platforms"
TYPE REQUIRED
)
endif(WIN32)
if(VPX_FOUND AND Opus_FOUND)
@ -115,28 +220,44 @@ option(PLASMA_BUILD_RESOURCE_DAT "Do we want to build resource.dat?" ON)
option(PLASMA_BUILD_LAUNCHER "Do we want to build plUruLauncher?" ON)
option(PLASMA_BUILD_TOOLS "Do we want to build the Plasma tools?" ON)
option(PLASMA_BUILD_TESTS "Do we want to build the unit tests?" OFF)
if(WIN32)
option(3dsm_BUILD_PLUGIN "Do we want to build the 3ds Max plugin?" OFF)
else()
set(3dsm_BUILD_PLUGIN OFF)
endif()
if(PLASMA_BUILD_TOOLS)
# Custom dummy target for compiling all tools
add_custom_target(tools)
endif()
if(3dsm_BUILD_PLUGIN)
find_package(MaxSDK REQUIRED)
if(WIN32)
find_package(MaxSDK)
set_package_properties(MaxSDK PROPERTIES
URL "http://www.autodesk.com/"
DESCRIPTION "SDK for integrating with the 3DS Max modelling software"
TYPE OPTIONAL
PURPOSE "Required for building the Plasma plugins for 3DS Max"
)
option(3dsm_BUILD_PLUGIN "Do we want to build the 3ds Max plugin?" OFF)
if (3dsm_BUILD_PLUGIN AND 3dsm_FOUND)
add_definitions(-DBUILDING_MAXPLUGIN)
endif(3dsm_BUILD_PLUGIN)
endif()
else()
set(3dsm_BUILD_PLUGIN OFF)
endif()
option(USE_VLD "Build and link with Visual Leak Detector (MSVC only)" OFF)
if(USE_VLD)
if(WIN32)
find_package(VLD)
set_package_properties(VLD PROPERTIES
URL "https://vld.codeplex.com/"
DESCRIPTION "Visual Leak Debugger for software compiled with Microsoft Visual C++"
TYPE OPTIONAL
PURPOSE "Useful for detecting memory leaks (MSVC only)"
)
option(USE_VLD "Build and link with Visual Leak Detector" OFF)
if(USE_VLD AND VLD_FOUND)
add_definitions(-DUSE_VLD)
find_package(VLD REQUIRED)
include_directories(${VLD_INCLUDE_DIR})
endif(USE_VLD)
endif(USE_VLD)
endif()
include(TestBigEndian)
test_big_endian(BIG_ENDIAN)
@ -162,3 +283,5 @@ if(PLASMA_BUILD_TESTS)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
add_subdirectory(Sources/Tests EXCLUDE_FROM_ALL)
endif(PLASMA_BUILD_TESTS)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

7
Sources/Plasma/Apps/plClient/CMakeLists.txt

@ -19,6 +19,13 @@ endif()
# Test for Python Interpreter, which will be used for extra build scripts if available
find_package(PythonInterp)
set_package_properties(PythonInterp PROPERTIES
URL "http://www.python.org"
DESCRIPTION "Python Scripting language interpreter"
TYPE OPTIONAL
PURPOSE "Used to (re-)build some client resource files"
)
if(PYTHONINTERP_FOUND)
include(FindPythonModule)
# Test for Python modules needed to build resource.dat

5
Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt

@ -12,6 +12,11 @@ endif(WIN32)
if(UNIX)
if(NOT APPLE)
find_package(Uuid REQUIRED)
set_package_properties(Uuid PROPERTIES
DESCRIPTION "UUID library for Linux (provided by util-linux)"
TYPE REQUIRED
)
include_directories(${Uuid_INCLUDE_DIR})
endif()

31
Sources/Tools/CMakeLists.txt

@ -1,9 +1,30 @@
if(PLASMA_BUILD_TOOLS)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core)
set_package_properties(Qt5Core PROPERTIES
URL "http://www.qt.io/"
DESCRIPTION "Cross-platform GUI framework for C++"
TYPE OPTIONAL
PURPOSE "Required for building GUI tools for Plasma"
)
find_package(Qt5Widgets)
set_package_properties(Qt5Widgets PROPERTIES
URL "http://www.qt.io/"
DESCRIPTION "Cross-platform GUI framework for C++"
TYPE OPTIONAL
PURPOSE "Required for building GUI tools for Plasma"
)
if(Qt5Core_FOUND AND Qt5Widgets_FOUND)
set(Qt5_LIBS_FOUND 1)
else()
set(Qt5_LIBS_FOUND 0)
endif()
if(PLASMA_BUILD_TOOLS)
if(Qt5_LIBS_FOUND)
add_subdirectory(plLocalizationEditor)
add_subdirectory(plResBrowser)
endif()
add_dependencies(tools
plLocalizationEditor
@ -15,14 +36,14 @@ if(PLASMA_BUILD_TOOLS)
add_dependencies(tools plShaderAssembler)
endif()
if(FREETYPE_FOUND)
if(FREETYPE_FOUND AND Qt5_LIBS_FOUND)
add_subdirectory(plFontConverter)
add_dependencies(tools plFontConverter)
endif()
endif()
# Max Stuff goes below here...
if(3dsm_BUILD_PLUGIN)
if(3dsm_FOUND AND 3dsm_BUILD_PLUGIN)
add_subdirectory(MaxComponent)
add_subdirectory(MaxConvert)
add_subdirectory(MaxExport)

Loading…
Cancel
Save