Skip to content
This repository
Browse code

Fixed Player version checking

  • Loading branch information...
commit 9a02678b4661df47ec21c6dd5a9f6b1d16e0390a 1 parent bdcee98
jeremy_asher authored

Showing 2 changed files with 23 additions and 7 deletions. Show diff stats Hide diff stats

  1. +23 6 CMakeLists.txt
  2. +0 1  libstageplugin/CMakeLists.txt
29 CMakeLists.txt
@@ -8,7 +8,7 @@ SET( VERSION ${V_MAJOR}.${V_MINOR}.${V_BUGFIX} )
8 8 SET( APIVERSION ${V_MAJOR}.${V_MINOR} )
9 9
10 10 # minimum version of Player to build the plugin
11   -SET( MIN_PLAYER 2.2.0 ) # change once plugin is fixed
  11 +SET( MIN_PLAYER 2.1.0 )
12 12
13 13 cmake_minimum_required( VERSION 2.4 FATAL_ERROR )
14 14
@@ -30,7 +30,25 @@ include(FindPkgConfig)
30 30 pkg_search_module( GLIB REQUIRED glib-2.0 )
31 31 find_package( OpenGL REQUIRED )
32 32
33   -pkg_search_module( PLAYER playercore )
  33 +# Look for player v${MIN_PLAYER} or higher and set flags
  34 +# built-ins don't work properly, so use pkg-config directly
  35 +FIND_PROGRAM (PKGCONFIG NAMES pkg-config)
  36 +IF (PKGCONFIG)
  37 + EXECUTE_PROCESS (COMMAND pkg-config --atleast-version=${MIN_PLAYER} playercore --silence-errors
  38 + RESULT_VARIABLE PLAYER_NOT_FOUND)
  39 + IF (PLAYER_NOT_FOUND EQUAL 0)
  40 + # found the correct version
  41 + pkg_search_module( PLAYER playercore )
  42 + MESSAGE(STATUS " Player headers found in ${PLAYER_INCLUDE_DIRS}")
  43 + MESSAGE(STATUS " Player libs found in ${PLAYER_LIBRARY_DIRS}")
  44 + SET (PLAYER_FOUND TRUE)
  45 + ELSE (PLAYER_NOT_FOUND EQUAL 0)
  46 + MESSAGE(STATUS "Player >=v${MIN_PLAYER} not found, skipping Player plugin")
  47 + SET (PLAYER_FOUND FALSE)
  48 + ENDIF (PLAYER_NOT_FOUND EQUAL 0)
  49 +ELSE (PKGCONFIG)
  50 + MESSAGE (STATUS "pkg-config not found, skipping Player plugin")
  51 +ENDIF (PKGCONFIG)
34 52
35 53
36 54 # find FLTK and set flags
@@ -79,10 +97,9 @@ link_directories(${GLIB_LIBRARY_DIRS}
79 97 # work through these subdirs
80 98 ADD_SUBDIRECTORY(libstage)
81 99 ADD_SUBDIRECTORY(examples)
82   -
83   -if( PLAYER_FOUND )
84   -ADD_SUBDIRECTORY(libstageplugin)
85   -endif( PLAYER_FOUND )
  100 +IF ( PLAYER_FOUND )
  101 + ADD_SUBDIRECTORY(libstageplugin)
  102 +ENDIF ( PLAYER_FOUND )
86 103
87 104
88 105 INSTALL(FILES rgb.txt stagelogo.png
1  libstageplugin/CMakeLists.txt
... ... @@ -1,7 +1,6 @@
1 1
2 2 link_directories( ${PLAYER_LIBDIR} )
3 3 include_directories( ${PLAYER_INCLUDE_DIRS})
4   -message( PLAYER INCLUDE ${PLAYER_INCLUDE_DIRS} )
5 4
6 5 add_library( stageplugin MODULE
7 6 p_driver.cc

0 comments on commit 9a02678

Please sign in to comment.
Something went wrong with that request. Please try again.