Revision: 7344 http://playerstage.svn.sourceforge.net/playerstage/?rev=7344&view=rev Author: gbiggs Date: 2009-02-19 01:39:57 +0000 (Thu, 19 Feb 2009)
Log Message: ----------- Removed requirement for pkg-config from installed cmake modules to make them usable on systems without pkg-config. Modified Paths: -------------- code/player/trunk/client_libs/CMakeLists.txt code/player/trunk/client_libs/libplayerc++/CMakeLists.txt code/player/trunk/cmake/CMakeLists.txt code/player/trunk/cmake/UsePlayerC.cmake.in code/player/trunk/cmake/internal/SearchForStuff.cmake code/player/trunk/libplayercore/CMakeLists.txt code/player/trunk/win32_todo.txt Added Paths: ----------- code/player/trunk/cmake/UsePlayerC++.cmake.in code/player/trunk/cmake/UsePlayerPlugin.cmake.in Removed Paths: ------------- code/player/trunk/cmake/UsePlayerC++.cmake code/player/trunk/cmake/UsePlayerC.cmake code/player/trunk/cmake/UsePlayerPlugin.cmake Modified: code/player/trunk/client_libs/CMakeLists.txt =================================================================== --- code/player/trunk/client_libs/CMakeLists.txt 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/client_libs/CMakeLists.txt 2009-02-19 01:39:57 UTC (rev 7344) @@ -1,6 +1,4 @@ MESSAGE (STATUS "===== Client Libraries =====") ADD_SUBDIRECTORY (libplayerc) -#IF (NOT PLAYER_OS_WIN) - ADD_SUBDIRECTORY (libplayerc++) -#ENDIF (NOT PLAYER_OS_WIN) +ADD_SUBDIRECTORY (libplayerc++) MESSAGE (STATUS "============================") Modified: code/player/trunk/client_libs/libplayerc++/CMakeLists.txt =================================================================== --- code/player/trunk/client_libs/libplayerc++/CMakeLists.txt 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/client_libs/libplayerc++/CMakeLists.txt 2009-02-19 01:39:57 UTC (rev 7344) @@ -215,10 +215,23 @@ SET (pkgconfigLibFlags) ENDIF (PLAYER_OS_SOLARIS) + IF (Boost_LIBRARY_DIRS) + SET (pkgconfigLibFlags "${pkgconfigLibFlags} -L${Boost_LIBRARY_DIRS}") + ENDIF (Boost_LIBRARY_DIRS) + IF (bostIncludeDir) + SET (pkgconfigIncFlags "-I${boostIncludeDir}") + ENDIF (bostIncludeDir) + IF (boostThreadLib) + SET (pkgconfigLibFlags "${pkgconfigLibFlags} -l${boostThreadLib}") + ENDIF (boostThreadLib) + IF (boostSignalsLib) + SET (pkgconfigLibFlags "${pkgconfigLibFlags} -l${boostSignalsLib}") + ENDIF (boostSignalsLib) PLAYER_MAKE_PKGCONFIG ("playerc++" "C++ wrapper for libplayerc - part of the Player Project" - "playerxdr playerc" "" "-I${boostIncludeDir}" - "-lm -L${Boost_LIBRARY_DIRS} -l${boostThreadLib} -l${boostSignalsLib}") + "playerxdr playerc" "" "${pkgconfigIncFlags}" + "-lm ${pkgconfigLibFlags}") + CONFIGURE_FILE (${PLAYER_CMAKE_DIR}/UsePlayerC++.cmake.in ${CMAKE_BINARY_DIR}/cmake/UsePlayerC++.cmake @ONLY) PLAYER_INSTALL_HEADERS (playerc++ ${playercppconfig_h} clientproxy.h Modified: code/player/trunk/cmake/CMakeLists.txt =================================================================== --- code/player/trunk/cmake/CMakeLists.txt 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/cmake/CMakeLists.txt 2009-02-19 01:39:57 UTC (rev 7344) @@ -1,9 +1,10 @@ CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/UsePlayerC.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/UsePlayerC.cmake @ONLY) +# UsePlayerPlugin.cmake.in is configured in playercore SET (playerModules ${CMAKE_CURRENT_BINARY_DIR}/UsePlayerC.cmake - UsePlayerPlugin.cmake + ${CMAKE_CURRENT_BINARY_DIR}/UsePlayerPlugin.cmake PlayerUtils.cmake) INSTALL (FILES ${playerModules} DESTINATION share/cmake/Modules/) IF (BUILD_PLAYERCC) - INSTALL (FILES UsePlayerC++.cmake DESTINATION share/cmake/Modules/) + INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/UsePlayerC++.cmake DESTINATION share/cmake/Modules/) ENDIF (BUILD_PLAYERCC) Deleted: code/player/trunk/cmake/UsePlayerC++.cmake =================================================================== --- code/player/trunk/cmake/UsePlayerC++.cmake 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/cmake/UsePlayerC++.cmake 2009-02-19 01:39:57 UTC (rev 7344) @@ -1,63 +0,0 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) -INCLUDE (PlayerUtils) - -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}") - - -############################################################################### -# Macro to build a simple client. -# _clientName: The name of the executable to create -# Pass source files, flags, etc. as extra args preceded by keywords as follows: -# SOURCES <source file list> -# INCLUDEDIRS <include directories list> -# LIBDIRS <library directories list> -# LINKFLAGS <link flags list> -# CFLAGS <compile flags list> -# See the examples directory (typically, ${prefix}/share/player/examples) for -# example CMakeLists.txt files. -MACRO (PLAYER_ADD_PLAYERCPP_CLIENT _clientName) - PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFlags _junk ${ARGN}) - IF (_junk) - MESSAGE (STATUS "WARNING: unkeyworded arguments found in PLAYER_ADD_PLAYERCPP_CLIENT: ${_junk}") - ENDIF (_junk) - LIST_TO_STRING (_cFlags "${_cFlags}") - - 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_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_STR OR _cFlags) - FOREACH (_file ${_srcs}) - GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) - IF (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${PLAYERCPP_CFLAGS_STR} ${_cFlags}") - ELSE (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${_fileCFlags} ${PLAYERCPP_CFLAGS_STR} ${_cFlags}") - ENDIF (_fileCFlags STREQUAL NOTFOUND) - SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES - COMPILE_FLAGS ${_newCFlags}) - ENDFOREACH (_file) - ENDIF (PLAYERCPP_CFLAGS_STR OR _cFlags) -ENDMACRO (PLAYER_ADD_PLAYERCPP_CLIENT) Copied: code/player/trunk/cmake/UsePlayerC++.cmake.in (from rev 7341, code/player/trunk/cmake/UsePlayerC++.cmake) =================================================================== --- code/player/trunk/cmake/UsePlayerC++.cmake.in (rev 0) +++ code/player/trunk/cmake/UsePlayerC++.cmake.in 2009-02-19 01:39:57 UTC (rev 7344) @@ -0,0 +1,64 @@ +CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) +INCLUDE (PlayerUtils) + +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + SET (PLAYERC_CFLAGS_STR "-...@cmake_install_prefix@/include/pla...@player_major_version@....@player_minor_version@ @pkgconfigIncFlags@") + SET (PLAYERC_LDFLAGS_STR "-...@cmake_install_prefix@/lib -lm @pkgconfigLibFlags@") +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}") + + +############################################################################### +# Macro to build a simple client. +# _clientName: The name of the executable to create +# Pass source files, flags, etc. as extra args preceded by keywords as follows: +# SOURCES <source file list> +# INCLUDEDIRS <include directories list> +# LIBDIRS <library directories list> +# LINKFLAGS <link flags list> +# CFLAGS <compile flags list> +# See the examples directory (typically, ${prefix}/share/player/examples) for +# example CMakeLists.txt files. +MACRO (PLAYER_ADD_PLAYERCPP_CLIENT _clientName) + PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFlags _junk ${ARGN}) + IF (_junk) + MESSAGE (STATUS "WARNING: unkeyworded arguments found in PLAYER_ADD_PLAYERCPP_CLIENT: ${_junk}") + ENDIF (_junk) + LIST_TO_STRING (_cFlags "${_cFlags}") + + 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_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_STR OR _cFlags) + FOREACH (_file ${_srcs}) + GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) + IF (_fileCFlags STREQUAL NOTFOUND) + SET (_newCFlags "${PLAYERCPP_CFLAGS_STR} ${_cFlags}") + ELSE (_fileCFlags STREQUAL NOTFOUND) + SET (_newCFlags "${_fileCFlags} ${PLAYERCPP_CFLAGS_STR} ${_cFlags}") + ENDIF (_fileCFlags STREQUAL NOTFOUND) + SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES + COMPILE_FLAGS ${_newCFlags}) + ENDFOREACH (_file) + ENDIF (PLAYERCPP_CFLAGS_STR OR _cFlags) +ENDMACRO (PLAYER_ADD_PLAYERCPP_CLIENT) Deleted: code/player/trunk/cmake/UsePlayerC.cmake =================================================================== --- code/player/trunk/cmake/UsePlayerC.cmake 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/cmake/UsePlayerC.cmake 2009-02-19 01:39:57 UTC (rev 7344) @@ -1,65 +0,0 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) -INCLUDE (PlayerUtils) - -INCLUDE (FindPkgConfig) -IF (NOT PKG_CONFIG_FOUND) - #MESSAGE (FATAL_ERROR "Could not find pkg-config.") - SET (PLAYERC_CFLAGS_STR "-...@cmake_install_prefix@/include/pla...@player_major_version@....@player_minor_version@") - SET (PLAYERC_LDFLAGS_STR "-...@cmake_install_prefix@/Player/lib" "-lplayerc") -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}") - - -############################################################################## -# Macro to build a simple client. -# _clientName: The name of the executable to create -# Pass source files, flags, etc. as extra args preceded by keywords as follows: -# SOURCES <source file list> -# INCLUDEDIRS <include directories list> -# LIBDIRS <library directories list> -# LINKFLAGS <link flags list> -# CFLAGS <compile flags list> -# See the examples directory (typically, ${prefix}/share/player/examples) for -# example CMakeLists.txt files. -MACRO (PLAYER_ADD_PLAYERC_CLIENT _clientName) - PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFLags _junk ${ARGN}) - IF (_junk) - MESSAGE (STATUS "WARNING: unkeyworded arguments found in PLAYER_ADD_PLAYERC_CLIENT: ${_junk}") - ENDIF (_junk) - LIST_TO_STRING (_cFlags "${_cFlags}") - - 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_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_STR OR _cFLags) - FOREACH (_file ${_srcs}) - GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) - IF (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${PLAYERC_CFLAGS_STR} ${_cFlags}") - ELSE (_fileCFlags STREQUAL NOTFOUND) - 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_STR OR _cFLags) -ENDMACRO (PLAYER_ADD_PLAYERC_CLIENT) Modified: code/player/trunk/cmake/UsePlayerC.cmake.in =================================================================== --- code/player/trunk/cmake/UsePlayerC.cmake.in 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/cmake/UsePlayerC.cmake.in 2009-02-19 01:39:57 UTC (rev 7344) @@ -3,7 +3,6 @@ INCLUDE (FindPkgConfig) IF (NOT PKG_CONFIG_FOUND) - #MESSAGE (FATAL_ERROR "Could not find pkg-config.") SET (PLAYERC_CFLAGS_STR "-...@cmake_install_prefix@/include/pla...@player_major_version@....@player_minor_version@") SET (PLAYERC_LDFLAGS_STR "-...@cmake_install_prefix@/lib" "-lplayerc") ELSE (NOT PKG_CONFIG_FOUND) Deleted: code/player/trunk/cmake/UsePlayerPlugin.cmake =================================================================== --- code/player/trunk/cmake/UsePlayerPlugin.cmake 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/cmake/UsePlayerPlugin.cmake 2009-02-19 01:39:57 UTC (rev 7344) @@ -1,165 +0,0 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) -INCLUDE (PlayerUtils) - -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 (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}") - - -# 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 -# to have been installed in the system path (as it should have been with Player). -MACRO (PROCESS_INTERFACES _file _outputFile) - ADD_CUSTOM_COMMAND (OUTPUT ${_outputFile} - COMMAND playerinterfacegen.py ${ARGN} ${_file} > ${_outputFile} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${_file} - ) -ENDMACRO (PROCESS_INTERFACES) - -MACRO (PROCESS_XDR _interfaceH _xdrH _xdrC) - ADD_CUSTOM_COMMAND (OUTPUT ${_xdrH} ${_xdrC} - COMMAND playerxdrgen.py ${_interfaceH} ${_xdrC} ${_xdrH} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${_interfaceH}) -ENDMACRO (PROCESS_XDR) - - -############################################################################### -# Macro to build a plugin driver. -# _driverName: The name of the driver library to create -# Pass source files, flags, etc. as extra args preceded by keywords as follows: -# SOURCES <source file list> -# INCLUDEDIRS <include directories list> -# LIBDIRS <library directories list> -# LINKFLAGS <link flags list> -# CFLAGS <compile flags list> -# See the examples directory (typically, ${prefix}/share/player/examples) for -# example CMakeLists.txt files. -MACRO (PLAYER_ADD_PLUGIN_DRIVER _driverName) - PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFlags _junk ${ARGN}) - IF (_junk) - MESSAGE (STATUS "WARNING: unkeyworded arguments found in PLAYER_ADD_PLUGIN_DRIVER: ${_junk}") - ENDIF (_junk) - LIST_TO_STRING (_cFlags "${_cFlags}") - - 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_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_STR OR _cFLags) - FOREACH (_file ${_srcs}) - GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) - IF (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${PLAYERCORE_CFLAGS_STR} ${_cFlags}") - ELSE (_fileCFlags STREQUAL NOTFOUND) - 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_STR OR _cFLags) -ENDMACRO (PLAYER_ADD_PLUGIN_DRIVER) - - -############################################################################### -# Macro to build a plugin interface. -# This macro will create generated sources prefixed with the interface name -# _interfName: The name of the interface library (not the interface itself!) -# to create -# _interfDef: The interface definition file -# -# Pass source files, flags, etc. as extra args preceded by keywords as follows: -# SOURCES <source file list> -# INCLUDEDIRS <include directories list> -# LIBDIRS <library directories list> -# LINKFLAGS <link flags list> -# CFLAGS <compile flags list> -# See the examples directory (typically, ${prefix}/share/player/examples) for -# example CMakeLists.txt files. -INCLUDE (FindPythonInterp) -MACRO (PLAYER_ADD_PLUGIN_INTERFACE _interfName _interfDef) - IF (NOT PYTHONINTERP_FOUND) - MESSAGE (FATAL_ERROR "No Python interpreter found. Cannot continue.") - ENDIF (NOT PYTHONINTERP_FOUND) - - PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFlags _junk ${ARGN}) - IF (_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_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_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_STR}) - - ADD_LIBRARY (${_interfName} SHARED ${interface_h} ${functiontable_c} ${xdr_h} ${xdr_c} ${_srcs}) - SET_TARGET_PROPERTIES (${_interfName} PROPERTIES - 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 (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_STR} ${_cFlags}") - ELSE (_fileCFlags STREQUAL NOTFOUND) - SET (_newCFlags "${_fileCFlags} ${PLUGIN_PLAYERC_CFLAGS_STR} ${_cFlags}") - ENDIF (_fileCFlags STREQUAL NOTFOUND) - SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES - COMPILE_FLAGS ${_newCFlags}) - ENDFOREACH (_file) - ENDIF (PLUGIN_PLAYERC_CFLAGS_STR OR _cFLags) -ENDMACRO (PLAYER_ADD_PLUGIN_INTERFACE) Copied: code/player/trunk/cmake/UsePlayerPlugin.cmake.in (from rev 7341, code/player/trunk/cmake/UsePlayerPlugin.cmake) =================================================================== --- code/player/trunk/cmake/UsePlayerPlugin.cmake.in (rev 0) +++ code/player/trunk/cmake/UsePlayerPlugin.cmake.in 2009-02-19 01:39:57 UTC (rev 7344) @@ -0,0 +1,167 @@ +CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) +INCLUDE (PlayerUtils) + +INCLUDE (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + SET (PLUGIN_PLAYERC_CFLAGS_STR "-...@cmake_install_prefix@/include/pla...@player_major_version@....@player_minor_version@") + SET (PLUGIN_PLAYERC_LDFLAGS_STR "-...@cmake_install_prefix@/lib" "-lplayerc") +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 (FindPkgConfig) +IF (NOT PKG_CONFIG_FOUND) + SET (PLAYERCORE_CFLAGS_STR "-...@cmake_install_prefix@/include/pla...@player_major_version@....@player_minor_version@") + SET (PLAYERCORE_LDFLAGS_STR "-...@cmake_install_prefix@/lib -lplayercore @corePCLibs@") +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}") + + +# 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 +# to have been installed in the system path (as it should have been with Player). +MACRO (PROCESS_INTERFACES _file _outputFile) + ADD_CUSTOM_COMMAND (OUTPUT ${_outputFile} + COMMAND playerinterfacegen.py ${ARGN} ${_file} > ${_outputFile} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${_file} + ) +ENDMACRO (PROCESS_INTERFACES) + +MACRO (PROCESS_XDR _interfaceH _xdrH _xdrC) + ADD_CUSTOM_COMMAND (OUTPUT ${_xdrH} ${_xdrC} + COMMAND playerxdrgen.py ${_interfaceH} ${_xdrC} ${_xdrH} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${_interfaceH}) +ENDMACRO (PROCESS_XDR) + + +############################################################################### +# Macro to build a plugin driver. +# _driverName: The name of the driver library to create +# Pass source files, flags, etc. as extra args preceded by keywords as follows: +# SOURCES <source file list> +# INCLUDEDIRS <include directories list> +# LIBDIRS <library directories list> +# LINKFLAGS <link flags list> +# CFLAGS <compile flags list> +# See the examples directory (typically, ${prefix}/share/player/examples) for +# example CMakeLists.txt files. +MACRO (PLAYER_ADD_PLUGIN_DRIVER _driverName) + PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFlags _junk ${ARGN}) + IF (_junk) + MESSAGE (STATUS "WARNING: unkeyworded arguments found in PLAYER_ADD_PLUGIN_DRIVER: ${_junk}") + ENDIF (_junk) + LIST_TO_STRING (_cFlags "${_cFlags}") + + 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_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_STR OR _cFLags) + FOREACH (_file ${_srcs}) + GET_SOURCE_FILE_PROPERTY (_fileCFlags ${_file} COMPILE_FLAGS) + IF (_fileCFlags STREQUAL NOTFOUND) + SET (_newCFlags "${PLAYERCORE_CFLAGS_STR} ${_cFlags}") + ELSE (_fileCFlags STREQUAL NOTFOUND) + 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_STR OR _cFLags) +ENDMACRO (PLAYER_ADD_PLUGIN_DRIVER) + + +############################################################################### +# Macro to build a plugin interface. +# This macro will create generated sources prefixed with the interface name +# _interfName: The name of the interface library (not the interface itself!) +# to create +# _interfDef: The interface definition file +# +# Pass source files, flags, etc. as extra args preceded by keywords as follows: +# SOURCES <source file list> +# INCLUDEDIRS <include directories list> +# LIBDIRS <library directories list> +# LINKFLAGS <link flags list> +# CFLAGS <compile flags list> +# See the examples directory (typically, ${prefix}/share/player/examples) for +# example CMakeLists.txt files. +INCLUDE (FindPythonInterp) +MACRO (PLAYER_ADD_PLUGIN_INTERFACE _interfName _interfDef) + IF (NOT PYTHONINTERP_FOUND) + MESSAGE (FATAL_ERROR "No Python interpreter found. Cannot continue.") + ENDIF (NOT PYTHONINTERP_FOUND) + + PLAYER_PROCESS_ARGUMENTS (_srcs _includeDirs _libDirs _linkFlags _cFlags _junk ${ARGN}) + IF (_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_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_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_STR}) + + ADD_LIBRARY (${_interfName} SHARED ${interface_h} ${functiontable_c} ${xdr_h} ${xdr_c} ${_srcs}) + SET_TARGET_PROPERTIES (${_interfName} PROPERTIES + 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 (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_STR} ${_cFlags}") + ELSE (_fileCFlags STREQUAL NOTFOUND) + SET (_newCFlags "${_fileCFlags} ${PLUGIN_PLAYERC_CFLAGS_STR} ${_cFlags}") + ENDIF (_fileCFlags STREQUAL NOTFOUND) + SET_SOURCE_FILES_PROPERTIES (${_file} PROPERTIES + COMPILE_FLAGS ${_newCFlags}) + ENDFOREACH (_file) + 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 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/cmake/internal/SearchForStuff.cmake 2009-02-19 01:39:57 UTC (rev 7344) @@ -127,7 +127,7 @@ # GTK checks INCLUDE (FindPkgConfig) IF (NOT PKG_CONFIG_FOUND) - MESSAGE (STATUS "WARNING: Could not find pkg-config; cannot search for GTK or related.") + MESSAGE (STATUS "WARNING: Could not find pkg-config. This will prevent searching for GTK and building many drivers.") ELSE (NOT PKG_CONFIG_FOUND) pkg_check_modules (GNOMECANVAS_PKG libgnomecanvas-2.0) IF (GNOMECANVAS_PKG_FOUND) Modified: code/player/trunk/libplayercore/CMakeLists.txt =================================================================== --- code/player/trunk/libplayercore/CMakeLists.txt 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/libplayercore/CMakeLists.txt 2009-02-19 01:39:57 UTC (rev 7344) @@ -97,6 +97,7 @@ TARGET_LINK_LIBRARIES (playercore ${coreLibs}) PLAYER_MAKE_PKGCONFIG ("playercore" "Player core library - part of the Player Project" "playererror" "" "" "${corePCLibs}") +CONFIGURE_FILE (${PLAYER_CMAKE_DIR}/UsePlayerPlugin.cmake.in ${CMAKE_BINARY_DIR}/cmake/UsePlayerPlugin.cmake @ONLY) SET (playererrorSrcs error.c) Modified: code/player/trunk/win32_todo.txt =================================================================== --- code/player/trunk/win32_todo.txt 2009-02-18 03:53:04 UTC (rev 7343) +++ code/player/trunk/win32_todo.txt 2009-02-19 01:39:57 UTC (rev 7344) @@ -8,5 +8,4 @@ - Use DLL loading for plugins on Win32 instead of ltdl (I have plenty of experience here, it shouldn't take long to do) - Installing and setting paths - Make examples work -- Make the CMake modules not require pkg-config to build clients and plugins, to reduce dependencies for windows users - Clean up all the places that add srcdir/replace as an include directory This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit