Revision: 6514 http://playerstage.svn.sourceforge.net/playerstage/?rev=6514&view=rev Author: gbiggs Date: 2008-06-10 02:46:54 -0700 (Tue, 10 Jun 2008)
Log Message: ----------- Changed to using the new FindPkgConfig module (now requires cmake 2.4.7 minimum). Modified Paths: -------------- code/player/trunk/CMakeLists.txt code/player/trunk/cmake/PlayerUtils.cmake code/player/trunk/cmake/UsePlayerC++.cmake code/player/trunk/cmake/UsePlayerC.cmake code/player/trunk/cmake/UsePlayerPlugin.cmake code/player/trunk/cmake/internal/SearchForStuff.cmake code/player/trunk/examples/libplayerc++/CMakeLists.txt.example.in code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in code/player/trunk/utils/pmap/CMakeLists.txt Modified: code/player/trunk/CMakeLists.txt =================================================================== --- code/player/trunk/CMakeLists.txt 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/CMakeLists.txt 2008-06-10 09:46:54 UTC (rev 6514) @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED (VERSION 2.4.7 FATAL_ERROR) # Set the project name (helps Visual Studio, mainly) PROJECT (Player) Modified: code/player/trunk/cmake/PlayerUtils.cmake =================================================================== --- code/player/trunk/cmake/PlayerUtils.cmake 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/cmake/PlayerUtils.cmake 2008-06-10 09:46:54 UTC (rev 6514) @@ -126,18 +126,6 @@ ############################################################################### -# Macro to look for a pkg-config package -INCLUDE (UsePkgConfig) -MACRO (CHECK_PACKAGE_EXISTS _package _result _includeDir _libDir _linkFlags _cFlags) - PKGCONFIG (${_package} ${_includeDir} ${_libDir} ${_linkFlags} ${_cFlags}) - SET (${_result} FALSE) - IF (${_includeDir} OR ${_libDir} OR ${_linkFlags} OR ${_cFlags}) - SET (${_result} TRUE) - ENDIF (${_includeDir} OR ${_libDir} OR ${_linkFlags} OR ${_cFlags}) -ENDMACRO (CHECK_PACKAGE_EXISTS) - - -############################################################################### # Macro to turn a list into a string (why doesn't CMake have this built-in?) MACRO (LIST_TO_STRING _string _list) SET (${_string}) Modified: code/player/trunk/cmake/UsePlayerC++.cmake =================================================================== --- code/player/trunk/cmake/UsePlayerC++.cmake 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/cmake/UsePlayerC++.cmake 2008-06-10 09:46:54 UTC (rev 6514) @@ -1,17 +1,18 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) INCLUDE (PlayerUtils) -INCLUDE (UsePkgConfig) -PKGCONFIG (playerc++ PLAYERCPP_INC_DIR PLAYERCPP_LINK_DIR PLAYERCPP_LINK_FLAGS PLAYERCPP_CFLAGS) -IF (NOT PLAYERCPP_CFLAGS) - MESSAGE (FATAL_ERROR "playerc++ pkg-config not found") -ENDIF (NOT PLAYERCPP_CFLAGS) +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + MESSAGE (FATAL_ERROR "Could not find pkg-config.") +ELSE (NOT PKG_CONFIG_FOUND) + pkg_check_modules (PLAYERCPP playerc++) + IF (NOT PLAYERCPP_FOUND) + MESSAGE (FATAL_ERROR "Could not find playerc++ with pkg-config.") + ENDIF (NOT PLAYERCPP_FOUND) +ENDIF (NOT PKG_CONFIG_FOUND) +LIST_TO_STRING (PLAYERCPP_CFLAGS_STR "${PLAYERCPP_CFLAGS}") +LIST_TO_STRING (PLAYERCPP_LDFLAGS_STR "${PLAYERCPP_LDFLAGS}") -# Get the lib dir from pkg-config to use as the rpath -FIND_PROGRAM (PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/local/bin) -EXECUTE_PROCESS (COMMAND ${PKGCONFIG_EXECUTABLE} --variable=libdir playerc++ - OUTPUT_VARIABLE PLAYERCPP_LIBDIR - OUTPUT_STRIP_TRAILING_WHITESPACE) ############################################################################### # Macro to build a simple client. @@ -31,33 +32,32 @@ ENDIF (_junk) LIST_TO_STRING (_cFlags "${_cFlags}") - IF (_includeDirs OR PLAYERCPP_INC_DIR) - INCLUDE_DIRECTORIES (${_includeDirs} ${PLAYERC_INC_DIR}) - ENDIF (_includeDirs OR PLAYERCPP_INC_DIR) - IF (_libDirs OR PLAYERCPP_LINK_DIR) - LINK_DIRECTORIES (${_libDirs} ${PLAYERC_LINK_DIR}) - ENDIF (_libDirs OR PLAYERCPP_LINK_DIR) + IF (_includeDirs OR PLAYERCPP_INCLUDE_DIRS) + INCLUDE_DIRECTORIES (${_includeDirs} ${PLAYERCPP_INCLUDE_DIRS}) + ENDIF (_includeDirs OR PLAYERCPP_INCLUDE_DIRS) + IF (_libDirs OR PLAYERCPP_LIBRARY_DIRS) + LINK_DIRECTORIES (${_libDirs} ${PLAYERCPP_LIBRARY_DIRS}) + ENDIF (_libDirs OR PLAYERCPP_LIBRARY_DIRS) ADD_EXECUTABLE (${_clientName} ${_srcs}) SET_TARGET_PROPERTIES (${_clientName} PROPERTIES - LINK_FLAGS ${PLAYERCPP_LINK_FLAGS} ${_linkFlags} + LINK_FLAGS ${PLAYERCPP_LDFLAGS_STR} ${_linkFlags} INSTALL_RPATH ${PLAYERCPP_LIBDIR} BUILD_WITH_INSTALL_RPATH TRUE) # Get the current cflags for each source file, and add the global ones # (this allows the user to specify individual cflags for each source file # without the global ones overriding them). - IF (PLAYERCPP_CFLAGS OR _cFlags) + IF (PLAYERCPP_CFLAGS_STR OR _cFlags) FOREACH (_file ${_srcs}) GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) IF (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${PLAYERCPP_CFLAGS} ${_cFlags}") + SET (_newCFlags "${PLAYERCPP_CFLAGS_STR} ${_cFlags}") ELSE (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${_fileCFlags} ${PLAYERCPP_CFLAGS} ${_cFlags}") + SET (_newCFlags "${_fileCFlags} ${PLAYERCPP_CFLAGS_STR} ${_cFlags}") ENDIF (_fileCFlags STREQUAL NOTFOUND) - MESSAGE (STATUS "setting cflags to ${_newCFlags}") SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES COMPILE_FLAGS ${_newCFlags}) ENDFOREACH (_file) - ENDIF (PLAYERCPP_CFLAGS OR _cFlags) + ENDIF (PLAYERCPP_CFLAGS_STR OR _cFlags) ENDMACRO (PLAYER_ADD_PLAYERCPP_CLIENT) Modified: code/player/trunk/cmake/UsePlayerC.cmake =================================================================== --- code/player/trunk/cmake/UsePlayerC.cmake 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/cmake/UsePlayerC.cmake 2008-06-10 09:46:54 UTC (rev 6514) @@ -1,19 +1,19 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) INCLUDE (PlayerUtils) -INCLUDE (UsePkgConfig) -PKGCONFIG (playerc PLAYERC_INC_DIR PLAYERC_LINK_DIR PLAYERC_LINK_FLAGS PLAYERC_CFLAGS) -IF (NOT PLAYERC_CFLAGS) - MESSAGE (FATAL_ERROR "playerc pkg-config not found") -ENDIF (NOT PLAYERC_CFLAGS) +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + MESSAGE (FATAL_ERROR "Could not find pkg-config.") +ELSE (NOT PKG_CONFIG_FOUND) + pkg_check_modules (PLAYERC playerc) + IF (NOT PLAYERC_FOUND) + MESSAGE (FATAL_ERROR "Could not find playerc with pkg-config.") + ENDIF (NOT PLAYERC_FOUND) +ENDIF (NOT PKG_CONFIG_FOUND) +LIST_TO_STRING (PLAYERC_CFLAGS_STR "${PLAYERC_CFLAGS}") +LIST_TO_STRING (PLAYERC_LDFLAGS_STR "${PLAYERC_LDFLAGS}") -# Get the lib dir from pkg-config to use as the rpath -FIND_PROGRAM (PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/local/bin) -EXECUTE_PROCESS (COMMAND ${PKGCONFIG_EXECUTABLE} --variable=libdir playerc - OUTPUT_VARIABLE PLAYERC_LIBDIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - ############################################################################## # Macro to build a simple client. # _clientName: The name of the executable to create @@ -32,32 +32,32 @@ ENDIF (_junk) LIST_TO_STRING (_cFlags "${_cFlags}") - IF (_includeDirs OR PLAYERC_INC_DIR) - INCLUDE_DIRECTORIES (${_includeDirs} ${PLAYERC_INC_DIR}) - ENDIF (_includeDirs OR PLAYERC_INC_DIR) - IF (_libDirs OR PLAYERC_LINK_DIR) - LINK_DIRECTORIES (${_libDirs} ${PLAYERC_LINK_DIR}) - ENDIF (_libDirs OR PLAYERC_LINK_DIR) + IF (_includeDirs OR PLAYERC_INCLUDE_DIRS) + INCLUDE_DIRECTORIES (${_includeDirs} ${PLAYERC_INCLUDE_DIRS}) + ENDIF (_includeDirs OR PLAYERC_INCLUDE_DIRS) + IF (_libDirs OR PLAYERC_LIBRARY_DIRS) + LINK_DIRECTORIES (${_libDirs} ${PLAYERC_LIBRARY_DIRS}) + ENDIF (_libDirs OR PLAYERC_LIBRARY_DIRS) ADD_EXECUTABLE (${_clientName} ${_srcs}) SET_TARGET_PROPERTIES (${_clientName} PROPERTIES - LINK_FLAGS ${PLAYERC_LINK_FLAGS} ${_linkFlags} + LINK_FLAGS ${PLAYERC_LDFLAGS_STR} ${_linkFlags} INSTALL_RPATH ${PLAYERC_LIBDIR} BUILD_WITH_INSTALL_RPATH TRUE) # Get the current cflags for each source file, and add the global ones # (this allows the user to specify individual cflags for each source file # without the global ones overriding them). - IF (PLAYERC_CFLAGS OR _cFLags) + IF (PLAYERC_CFLAGS_STR OR _cFLags) FOREACH (_file ${_srcs}) GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) IF (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${PLAYERC_CFLAGS} ${_cFlags}") + SET (_newCFlags "${PLAYERC_CFLAGS_STR} ${_cFlags}") ELSE (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${_fileCFlags} ${PLAYERC_CFLAGS} ${_cFlags}") + SET (_newCFlags "${_fileCFlags} ${PLAYERC_CFLAGS_STR} ${_cFlags}") ENDIF (_fileCFlags STREQUAL NOTFOUND) SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES COMPILE_FLAGS ${_newCFlags}) ENDFOREACH (_file) - ENDIF (PLAYERC_CFLAGS OR _cFLags) + ENDIF (PLAYERC_CFLAGS_STR OR _cFLags) ENDMACRO (PLAYER_ADD_PLAYERC_CLIENT) Modified: code/player/trunk/cmake/UsePlayerPlugin.cmake =================================================================== --- code/player/trunk/cmake/UsePlayerPlugin.cmake 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/cmake/UsePlayerPlugin.cmake 2008-06-10 09:46:54 UTC (rev 6514) @@ -1,23 +1,30 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) INCLUDE (PlayerUtils) -INCLUDE (UsePkgConfig) -PKGCONFIG (playerc PLUGIN_PLAYERC_INC_DIR PLUGIN_PLAYERC_LINK_DIR PLUGIN_PLAYERC_LINK_FLAGS PLUGIN_PLAYERC_CFLAGS) -IF (NOT PLUGIN_PLAYERC_CFLAGS) - MESSAGE (FATAL_ERROR "playerc pkg-config not found") -ENDIF (NOT PLUGIN_PLAYERC_CFLAGS) +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + MESSAGE (FATAL_ERROR "Could not find pkg-config.") +ELSE (NOT PKG_CONFIG_FOUND) + pkg_check_modules (PLUGIN_PLAYERC playerc) + IF (NOT PLUGIN_PLAYERC_FOUND) + MESSAGE (FATAL_ERROR "Could not find playerc with pkg-config.") + ENDIF (NOT PLUGIN_PLAYERC_FOUND) +ENDIF (NOT PKG_CONFIG_FOUND) +LIST_TO_STRING (PLUGIN_PLAYERC_CFLAGS_STR "${PLUGIN_PLAYERC_CFLAGS}") +LIST_TO_STRING (PLUGIN_PLAYERC_LDFLAGS_STR "${PLUGIN_PLAYERC_LDFLAGS}") -INCLUDE (UsePkgConfig) -PKGCONFIG (playercore PLAYERCORE_INC_DIR PLAYERCORE_LINK_DIR PLAYERCORE_LINK_FLAGS PLAYERCORE_CFLAGS) -IF (NOT PLAYERCORE_CFLAGS) - MESSAGE (FATAL_ERROR "playercore pkg-config not found") -ENDIF (NOT PLAYERCORE_CFLAGS) +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + MESSAGE (FATAL_ERROR "Could not find pkg-config.") +ELSE (NOT PKG_CONFIG_FOUND) + pkg_check_modules (PLAYERCORE playercore) + IF (NOT PLAYERCORE_FOUND) + MESSAGE (FATAL_ERROR "Could not find playercore with pkg-config.") + ENDIF (NOT PLAYERCORE_FOUND) +ENDIF (NOT PKG_CONFIG_FOUND) +LIST_TO_STRING (PLAYERCORE_CFLAGS_STR "${PLAYERCORE_CFLAGS}") +LIST_TO_STRING (PLAYERCORE_LDFLAGS_STR "${PLAYERCORE_LDFLAGS}") -# Get the lib dir from pkg-config to use as the rpath -FIND_PROGRAM (PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/local/bin) -EXECUTE_PROCESS (COMMAND ${PKGCONFIG_EXECUTABLE} --variable=libdir playerc++ - OUTPUT_VARIABLE PLAYERCORE_LIBDIR - OUTPUT_STRIP_TRAILING_WHITESPACE) # This is slightly different from the one used by the Player build system itself. # It takes a single file instead of a directory. It also expects playerinterfacegen.py @@ -56,34 +63,34 @@ ENDIF (_junk) LIST_TO_STRING (_cFlags "${_cFlags}") - IF (_includeDirs OR PLAYERCORE_INC_DIR) - INCLUDE_DIRECTORIES (${_includeDirs} ${PLAYERC_INC_DIR}) - ENDIF (_includeDirs OR PLAYERCORE_INC_DIR) - IF (_libDirs OR PLAYERCORE_LINK_DIR) - LINK_DIRECTORIES (${_libDirs} ${PLAYERC_LINK_DIR}) - ENDIF (_libDirs OR PLAYERCORE_LINK_DIR) + IF (_includeDirs OR PLAYERCORE_INCLUDE_DIRS) + INCLUDE_DIRECTORIES (${_includeDirs} ${PLAYERCORE_INCLUDE_DIRS}) + ENDIF (_includeDirs OR PLAYERCORE_INCLUDE_DIRS) + IF (_libDirs OR PLAYERCORE_LIBRARY_DIRS) + LINK_DIRECTORIES (${_libDirs} ${PLAYERCORE_LIBRARY_DIRS}) + ENDIF (_libDirs OR PLAYERCORE_LIBRARY_DIRS) ADD_LIBRARY (${_driverName} SHARED ${_srcs}) SET_TARGET_PROPERTIES (${_driverName} PROPERTIES - LINK_FLAGS ${PLAYERCORE_LINK_FLAGS} ${_linkFlags} + LINK_FLAGS ${PLAYERCORE_LDFLAGS_STR} ${_linkFlags} INSTALL_RPATH ${PLAYERCORE_LIBDIR} BUILD_WITH_INSTALL_RPATH TRUE) # Get the current cflags for each source file, and add the global ones # (this allows the user to specify individual cflags for each source file # without the global ones overriding them). - IF (PLAYERCORE_CFLAGS OR _cFLags) + IF (PLAYERCORE_CFLAGS_STR OR _cFLags) FOREACH (_file ${_srcs}) GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) IF (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${PLAYERCORE_CFLAGS} ${_cFlags}") + SET (_newCFlags "${PLAYERCORE_CFLAGS_STR} ${_cFlags}") ELSE (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${_fileCFlags} ${PLAYERCORE_CFLAGS} ${_cFlags}") + SET (_newCFlags "${_fileCFlags} ${PLAYERCORE_CFLAGS_STR} ${_cFlags}") ENDIF (_fileCFlags STREQUAL NOTFOUND) SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES COMPILE_FLAGS ${_newCFlags}) ENDFOREACH (_file) - ENDIF (PLAYERCORE_CFLAGS OR _cFLags) + ENDIF (PLAYERCORE_CFLAGS_STR OR _cFLags) ENDMACRO (PLAYER_ADD_PLUGIN_DRIVER) @@ -110,47 +117,49 @@ PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFlags _junk ${ARGN}) IF (_junk) - MESSAGE (STATUS "WARNING: unkeyworded arguments found in PLAYER_ADD_PLUGIN_DRIVER: ${_junk}") + MESSAGE (STATUS + "WARNING: unkeyworded arguments found in PLAYER_ADD_PLUGIN_INTERFACE: ${_junk}") ENDIF (_junk) LIST_TO_STRING (_cFlags "${_cFlags}") IF (_includeDirs OR PLUGIN_PLAYERC_INC_DIR) INCLUDE_DIRECTORIES (${_includeDirs} ${PLUGIN_PLAYERC_INC_DIR} ${CMAKE_CURRENT_BINARY_DIR}) ENDIF (_includeDirs OR PLUGIN_PLAYERC_INC_DIR) - IF (_libDirs OR PLUGIN_PLAYERC_LINK_DIR) - LINK_DIRECTORIES (${_libDirs} ${PLUGIN_PLAYERC_LINK_DIR}) - ENDIF (_libDirs OR PLUGIN_PLAYERC_LINK_DIR) + IF (_libDirs OR PLUGIN_PLAYERC_LIBRARY_DIRS) + LINK_DIRECTORIES (${_libDirs} ${PLUGIN_PLAYERC_LIBRARY_DIRS}) + ENDIF (_libDirs OR PLUGIN_PLAYERC_LIBRARY_DIRS) # Have to generate some source files SET (interface_h ${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_interface.h) PROCESS_INTERFACES (${_interfDef} ${interface_h} --plugin) SET (functiontable_c ${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_functiontable.c) PROCESS_INTERFACES (${_interfDef} ${functiontable_c} --plugin --functiontable) - SET_SOURCE_FILES_PROPERTIES (${functiontable_c} PROPERTIES COMPILE_FLAGS ${PLUGIN_PLAYERC_CFLAGS}) + SET_SOURCE_FILES_PROPERTIES (${functiontable_c} PROPERTIES + COMPILE_FLAGS ${PLUGIN_PLAYERC_CFLAGS_STR}) SET (xdr_h ${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_xdr.h) SET (xdr_c ${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_xdr.c) PROCESS_XDR (${interface_h} ${xdr_h} ${xdr_c}) - SET_SOURCE_FILES_PROPERTIES (${xdr_c} PROPERTIES COMPILE_FLAGS ${PLUGIN_PLAYERC_CFLAGS}) + SET_SOURCE_FILES_PROPERTIES (${xdr_c} PROPERTIES COMPILE_FLAGS ${PLUGIN_PLAYERC_CFLAGS_STR}) ADD_LIBRARY (${_interfName} SHARED ${interface_h} ${functiontable_c} ${xdr_h} ${xdr_c} ${_srcs}) SET_TARGET_PROPERTIES (${_interfName} PROPERTIES - LINK_FLAGS ${PLUGIN_PLAYERC_LINK_FLAGS} ${_linkFlags} - INSTALL_RPATH ${PLAYERCORE_LIBDIR} + LINK_FLAGS ${PLUGIN_PLAYERC_LDFLAGS_STR} ${_linkFlags} + INSTALL_RPATH ${PLUGIN_PLAYERC_LIBDIR} BUILD_WITH_INSTALL_RPATH TRUE) # Get the current cflags for each source file, and add the global ones # (this allows the user to specify individual cflags for each source file # without the global ones overriding them). - IF (PLAYERCORE_CFLAGS OR _cFLags) + IF (PLUGIN_PLAYERC_CFLAGS_STR OR _cFLags) FOREACH (_file ${_srcs}) GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) IF (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${PLUGIN_PLAYERC_CFLAGS} ${_cFlags}") + SET (_newCFlags "${PLUGIN_PLAYERC_CFLAGS_STR} ${_cFlags}") ELSE (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${_fileCFlags} ${PLUGIN_PLAYERC_CFLAGS} ${_cFlags}") + SET (_newCFlags "${_fileCFlags} ${PLUGIN_PLAYERC_CFLAGS_STR} ${_cFlags}") ENDIF (_fileCFlags STREQUAL NOTFOUND) SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES COMPILE_FLAGS ${_newCFlags}) ENDFOREACH (_file) - ENDIF (PLAYERCORE_CFLAGS OR _cFLags) + ENDIF (PLUGIN_PLAYERC_CFLAGS_STR OR _cFLags) ENDMACRO (PLAYER_ADD_PLUGIN_INTERFACE) Modified: code/player/trunk/cmake/internal/SearchForStuff.cmake =================================================================== --- code/player/trunk/cmake/internal/SearchForStuff.cmake 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/cmake/internal/SearchForStuff.cmake 2008-06-10 09:46:54 UTC (rev 6514) @@ -31,6 +31,33 @@ TEST_BIG_ENDIAN (WORDS_BIGENDIAN) # GTK checks -CHECK_PACKAGE_EXISTS (libgnomecanvas-2.0 WITH_GNOMECANVAS GNOMECANVAS_INCLUDEDIR GNOMECANVAS_LIBDIR GNOMECANVAS_LINKFLAGS GNOMECANVAS_CFLAGS) -CHECK_PACKAGE_EXISTS (gtk+-2.0 WITH_GTK GTK_INCLUDEDIR GTK_LIBDIR GTK_LINKFLAGS GTK_CFLAGS) -CHECK_PACKAGE_EXISTS (gdk-pixbuf-2.0 WITH_GDKPIXBUF GDKPIXBUF_INCLUDEDIR GDKPIXBUF_LIBDIR GDKPIXBUF_LINKFLAGS GDKPIXBUF_CFLAGS) \ No newline at end of file +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + MESSAGE (STATUS "WARNING: Could not find pkg-config; cannot search for GTK or related.") +ELSE (NOT PKG_CONFIG_FOUND) + pkg_check_modules (GNOMECANVAS_PKG libgnomecanvas-2.0) + IF (GNOMECANVAS_PKG_FOUND) + SET (WITH_GNOMECANVAS TRUE) + # Because the FindPkgConfig module annoyingly separates *all* results, not just the dirs, + # we have to unseparate the flags back into strings so they can be passed to the + # SET_x_PROPERTIES functions properly. Change the LIST_TO_STRING to SET and make with + # VERBOSE=1 to see the mess that happens otherwise. + LIST_TO_STRING (GNOMECANVAS_LINKFLAGS "${GNOMECANVAS_PKG_LDFLAGS}") + LIST_TO_STRING (GNOMECANVAS_CFLAGS "${GNOMECANVAS_PKG_CFLAGS}") + ENDIF (GNOMECANVAS_PKG_FOUND) + + pkg_check_modules (GTK_PKG gtk+-2.0) + IF (GTK_PKG_FOUND) + SET (WITH_GTK TRUE) + SET (GTK_INCLUDEDIR ${GTK_PKG_INCLUDE_DIRS}) + LIST_TO_STRING (GTK_LINKFLAGS "${GTK_PKG_LDFLAGS}") + LIST_TO_STRING (GTK_CFLAGS "${GTK_PKG_CFLAGS}") + ENDIF (GTK_PKG_FOUND) + + pkg_check_modules (GDKPIXBUF_PKG gdk-pixbuf-2.0) + IF (GDKPIXBUF_PKG_FOUND) + SET (WITH_GDKPIXBUF TRUE) + LIST_TO_STRING (GDKPIXBUF_LINKFLAGS "${GDKPIXBUF_PKG_LDFLAGS}") + LIST_TO_STRING (GDKPIXBUF_CFLAGS "${GDKPIXBUF_PKG_CFLAGS}") + ENDIF (GDKPIXBUF_PKG_FOUND) +ENDIF (NOT PKG_CONFIG_FOUND) Modified: code/player/trunk/examples/libplayerc++/CMakeLists.txt.example.in =================================================================== --- code/player/trunk/examples/libplayerc++/CMakeLists.txt.example.in 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/examples/libplayerc++/CMakeLists.txt.example.in 2008-06-10 09:46:54 UTC (rev 6514) @@ -23,7 +23,7 @@ IF (HAVE_BOOST_THREADS OR HAVE_BOOST_SIGNALS) PLAYER_ADD_PLAYERCPP_CLIENT (example1 SOURCES example1.cc) PLAYER_ADD_PLAYERCPP_CLIENT (example3 SOURCES example3.cc) - PLAYER_ADD_PLAYERCPP_CLIENT (goto SOURCES goto.cc CFLAGS -DHAVE_BOOST_THREAD -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DHAVE_BOOST_SIGNALS) + PLAYER_ADD_PLAYERCPP_CLIENT (goto SOURCES goto.cc) PLAYER_ADD_PLAYERCPP_CLIENT (speech_cpp_client SOURCES speech_cpp_client.cc) ENDIF (HAVE_BOOST_THREADS OR HAVE_BOOST_SIGNALS) Modified: code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in =================================================================== --- code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in 2008-06-10 09:46:54 UTC (rev 6514) @@ -5,6 +5,7 @@ INCLUDE (UsePlayerPlugin) INCLUDE (UsePlayerC) +INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR}) PLAYER_ADD_PLUGIN_INTERFACE (example 128_example.def SOURCES eginterf_client.c) # Note the use of files generated during the PLAYER_ADD_PLUGIN_INTERFACE step PLAYER_ADD_PLUGIN_DRIVER (example_driver SOURCES eginterf_driver.cc example_interface.h example_xdr.h) Modified: code/player/trunk/utils/pmap/CMakeLists.txt =================================================================== --- code/player/trunk/utils/pmap/CMakeLists.txt 2008-06-10 08:04:27 UTC (rev 6513) +++ code/player/trunk/utils/pmap/CMakeLists.txt 2008-06-10 09:46:54 UTC (rev 6514) @@ -1,40 +1,43 @@ INCLUDE (${PLAYER_CMAKE_DIR}/PlayerUtils.cmake) -CHECK_PACKAGE_EXISTS (gsl haveGSL gslIncludeDir gslLibDir gslLinkFlags gslCFlags) -# The GSL pkg-config gives an almost-empty cflags, containing only a new line. -# The pkg-config module for cmake doesn't strip trailing white space on the output -# of executing the pkg-config command, so this new line makes it into the cflags -# and screws up the generated make files. -SET (gslCFlags) +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + MESSAGE (STATUS "WARNING: Could not find pkg-config; cannot build pmap utility.") +ELSE (NOT PKG_CONFIG_FOUND) + pkg_check_modules (GSL_PKG gsl) -IF (haveGSL) - SET (pmapSrcs logfile.cpp omap.cpp pmap.cpp rmap.cpp slap.cpp) - SET (lodoSrcs lodo.cpp slap.cpp) - SET (pmaptestSrcs pmap_test.cpp) - SET (lododriverSrcs lodo_driver.cc) + IF (GSL_PKG_FOUND) + LIST_TO_STRING (GSL_CFLAGS "${GSL_PKG_CFLAGS}") + LIST_TO_STRING (GSL_LDFLAGS "${GSL_PKG_LDFLAGS}") - INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/client_libs) + SET (pmapSrcs logfile.cpp omap.cpp pmap.cpp rmap.cpp slap.cpp) + SET (lodoSrcs lodo.cpp slap.cpp) + SET (pmaptestSrcs pmap_test.cpp) + SET (lododriverSrcs lodo_driver.cc) - PLAYER_ADD_EXECUTABLE (pmaptest ${pmaptestSrcs}) - TARGET_LINK_LIBRARIES (pmaptest pmap lodo) - SET_TARGET_PROPERTIES (pmaptest PROPERTIES - LINK_FLAGS "${gslLinkFlags}") + INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/client_libs) - PLAYER_ADD_LIBRARY (pmap ${pmapSrcs}) - SET_SOURCE_FILES_PROPERTIES (${pmapSrcs} PROPERTIES - COMPILE_FLAGS "${gslCFlags} --fast-math") - SET_TARGET_PROPERTIES (pmap PROPERTIES - LINK_FLAGS "${gslLinkFlags}") + PLAYER_ADD_EXECUTABLE (pmaptest ${pmaptestSrcs}) + TARGET_LINK_LIBRARIES (pmaptest pmap lodo) + SET_TARGET_PROPERTIES (pmaptest PROPERTIES + LINK_FLAGS "${GSL_LDFLAGS}") - PLAYER_ADD_LIBRARY (lodo ${lodoSrcs}) - TARGET_LINK_LIBRARIES (lodo playercore) - SET_SOURCE_FILES_PROPERTIES (${lodoSrcs} PROPERTIES - COMPILE_FLAGS "${gslCFlags} --fast-math") - SET_TARGET_PROPERTIES (lodo PROPERTIES - LINK_FLAGS "${gslLinkFlags}") + PLAYER_ADD_LIBRARY (pmap ${pmapSrcs}) + SET_SOURCE_FILES_PROPERTIES (${pmapSrcs} PROPERTIES + COMPILE_FLAGS "${GSL_CFLAGS} --fast-math") + SET_TARGET_PROPERTIES (pmap PROPERTIES + LINK_FLAGS "${GSL_LDFLAGS}") - PLAYER_ADD_LIBRARY (lododriver ${lododriverSrcs}) - TARGET_LINK_LIBRARIES (lododriver lodo) -ELSE (haveGSL) - MESSAGE (STATUS "pmap utilities will not be built - GSL not found") -ENDIF (haveGSL) + PLAYER_ADD_LIBRARY (lodo ${lodoSrcs}) + TARGET_LINK_LIBRARIES (lodo playercore) + SET_SOURCE_FILES_PROPERTIES (${lodoSrcs} PROPERTIES + COMPILE_FLAGS "${GSL_CFLAGS} --fast-math") + SET_TARGET_PROPERTIES (lodo PROPERTIES + LINK_FLAGS "${GSL_LDFLAGS}") + + PLAYER_ADD_LIBRARY (lododriver ${lododriverSrcs}) + TARGET_LINK_LIBRARIES (lododriver lodo) + ELSE (GSL_PKG_FOUND) + MESSAGE (STATUS "pmap utilities will not be built - GSL not found") + ENDIF (GSL_PKG_FOUND) +ENDIF (NOT PKG_CONFIG_FOUND) 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 Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit