Revision: 6594
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6594&view=rev
Author:   jeremy_asher
Date:     2008-06-16 15:59:12 -0700 (Mon, 16 Jun 2008)

Log Message:
-----------
Fixed player version checking routine in build files

Modified Paths:
--------------
    code/stage/trunk/CMakeLists.txt

Modified: code/stage/trunk/CMakeLists.txt
===================================================================
--- code/stage/trunk/CMakeLists.txt     2008-06-16 22:42:23 UTC (rev 6593)
+++ code/stage/trunk/CMakeLists.txt     2008-06-16 22:59:12 UTC (rev 6594)
@@ -7,8 +7,8 @@
 SET( VERSION ${V_MAJOR}.${V_MINOR}.${V_BUGFIX} )
 SET( APIVERSION ${V_MAJOR}.${V_MINOR} )
 
-SET( MIN_PLAYER_MAJOR 2 )
-SET( MIN_PLAYER_MINOR 1 )
+# minimum version of Player to build the plugin
+SET( MIN_PLAYER 99.0.0 ) # change once plugin is fixed
 
 #SET(CMAKE_BUILD_TYPE debug)
 #SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3")
@@ -29,24 +29,30 @@
                -DINSTALL_PREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\"
                -DVERSION=\\\"${VERSION}\\\" )
 
+
+# find the easy modules
 include(FindPkgConfig)
-
 pkg_search_module( GLIB REQUIRED glib-2.0 )
 find_package( OpenGL REQUIRED )
 
-#pkg_search_module( PLAYER playercore )
-#SET(VER_PATTERN "([0-9]*)\\.([0-9]*)\\.([0-9]*)") 
-#STRING( REGEX REPLACE ${VER_PATTERN} "\\1" PLAYER_MAJOR_VER ${PLAYER_VERSION} 
)
-#MESSAGE( "Major: ${PLAYER_MAJOR_VER}" )
-#STRING( REGEX REPLACE ${VER_PATTERN} "\\2" PLAYER_MINOR_VER ${PLAYER_VERSION} 
)
-#MESSAGE( "Minor: ${PLAYER_MINOR_VER}" )
-#IF( NOT PLAYER_MAJOR_VER LESS MIN_PLAYER_MAJOR )
-#      IF( NOT PLAYER_MINOR_VER LESS MIN_PLAYER_MINOR )
-#              MESSAGE( STATUS "  Player up to date, building plugin")
-#              ADD_SUBDIRECTORY(libstageplugin)
-#      ENDIF( NOT PLAYER_MINOR_VER LESS MIN_PLAYER_MINOR )
-#ENDIF( NOT PLAYER_MAJOR_VER LESS MIN_PLAYER_MAJOR )
+# Look for player v${MIN_PLAYER} or higher and set flags
+#  built-ins don't work properly, so use pkg-config directly
+FIND_PROGRAM (PKGCONFIG NAMES pkg-config)
+IF (PKGCONFIG)
+       EXECUTE_PROCESS (COMMAND pkg-config --atleast-version=${MIN_PLAYER} 
playercore --silence-errors
+               RESULT_VARIABLE PLAYER_FOUND)
+       IF (PLAYER_FOUND EQUAL 0)
+               # found the correct version
+               pkg_search_module( PLAYER playercore )
+               ADD_SUBDIRECTORY( libstageplugin )
+       ELSE (PLAYER_FOUND EQUAL 0)
+               MESSAGE(STATUS "Player >=v${MIN_PLAYER} not found, skipping 
Player plugin")
+       ENDIF (PLAYER_FOUND EQUAL 0)
+ELSE (PKGCONFIG)
+       MESSAGE (STATUS "pkg-config not found, skipping Player plugin")
+ENDIF (PKGCONFIG)
 
+# find FLTK and set flags
 FIND_PROGRAM (FLTKCONFIG NAMES fltk-config)
 IF (FLTKCONFIG)
     EXECUTE_PROCESS (COMMAND fltk-config --cxxflags --use-gl --use-images
@@ -62,8 +68,9 @@
     SET (FLTK_FOUND FALSE)
 ENDIF (FLTKCONFIG)
 
-
 IF (APPLE)
+       # define flags to avoid the error:
+       #  ld: cycle in dylib re-exports with /usr/X11R6/lib/libGL.dylib
        MESSAGE(STATUS "Setting Apple specific flags")
        # work around the OS X 10.5  X11/OpenGL library bug
        SET(APPLE_LIBRARIES 
"-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to