Handle missing libopenglrecorder gracefully (#2867)

* Handle missing libopenglrecorder gracefully

* Tweak readme

* Change version to "git"

* fail when version !== git

* oops

gota do my research :/
This commit is contained in:
QwertyChouskie 2017-06-22 17:27:29 -07:00 committed by auriamg
parent 72358371f7
commit a2d831c1ea
2 changed files with 15 additions and 12 deletions

View File

@ -1,6 +1,6 @@
# root CMakeLists for the SuperTuxKart project # root CMakeLists for the SuperTuxKart project
project(SuperTuxKart) project(SuperTuxKart)
set(PROJECT_VERSION "0.9.1") set(PROJECT_VERSION "git")
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.4)
if(NOT (CMAKE_MAJOR_VERSION VERSION_LESS 3)) if(NOT (CMAKE_MAJOR_VERSION VERSION_LESS 3))
@ -83,10 +83,6 @@ if(DISABLE_VPX)
add_definitions(-DNO_VPX) add_definitions(-DNO_VPX)
endif() endif()
if(BUILD_RECORDER)
add_definitions(-DENABLE_RECORDER)
endif()
# Build the Bullet physics library # Build the Bullet physics library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src") include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
@ -139,11 +135,19 @@ if (BUILD_RECORDER)
find_library(OPENGLRECORDER_LIBRARY NAMES openglrecorder libopenglrecorder PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") find_library(OPENGLRECORDER_LIBRARY NAMES openglrecorder libopenglrecorder PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
find_path(OPENGLRECORDER_INCLUDEDIR NAMES openglrecorder.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include") find_path(OPENGLRECORDER_INCLUDEDIR NAMES openglrecorder.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include")
if (NOT OPENGLRECORDER_LIBRARY OR NOT OPENGLRECORDER_INCLUDEDIR) if (NOT OPENGLRECORDER_LIBRARY OR NOT OPENGLRECORDER_INCLUDEDIR)
message(FATAL_ERROR "libopenglrecorder not found. " if(PROJECT_VERSION STREQUAL "git")
"Either install libopenglrecorder or disable ingame recorder with -DBUILD_RECORDER=0") message(WARNING "libopenglrecorder not found, disabling in-game recorder. "
"To use recorder, install libopenglrecorder.")
option(BUILD_RECORDER "Build opengl recorder" OFF)
else()
message(FATAL_ERROR "libopenglrecorder not found. "
"Either install libopenglrecorder or disable in-game recorder with -DBUILD_RECORDER=0")
endif()
else()
include_directories(${OPENGLRECORDER_INCLUDEDIR})
mark_as_advanced(OPENGLRECORDER_LIBRARY OPENGLRECORDER_INCLUDEDIR)
add_definitions(-DENABLE_RECORDER)
endif() endif()
include_directories(${OPENGLRECORDER_INCLUDEDIR})
mark_as_advanced(OPENGLRECORDER_LIBRARY OPENGLRECORDER_INCLUDEDIR)
endif() endif()
if(NOT SERVER_ONLY AND NOT USE_GLES2) if(NOT SERVER_ONLY AND NOT USE_GLES2)

View File

@ -65,9 +65,8 @@ mesa-common-dev pkg-config zlib1g-dev
### In-game recorder ### In-game recorder
In order to build the in-game recorder for STK, you have to install In order to build the in-game recorder for STK, you have to install
libopenglrecorder from your distribution or compile it yourself, get it [here](https://github.com/Benau/libopenglrecorder). libopenglrecorder from your distribution, or compile it yourself from [here](https://github.com/Benau/libopenglrecorder).
Compilation instruction is explained there, if you don't need such feature, Compilation instruction is explained there. If you don't need this feature, pass `-DBUILD_RECORDER=off` to cmake.
pass `-DBUILD_RECORDER=off` to cmake.
### Compiling ### Compiling