Revision: 8620
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8620&view=rev
Author:   natepak
Date:     2010-04-24 17:42:52 +0000 (Sat, 24 Apr 2010)

Log Message:
-----------
Updated the gazeboserver pkgconfig

Modified Paths:
--------------
    code/gazebo/trunk/CMakeLists.txt
    code/gazebo/trunk/cmake/FindOde.cmake
    code/gazebo/trunk/cmake/GazeboUtils.cmake
    code/gazebo/trunk/cmake/SearchForStuff.cmake
    code/gazebo/trunk/server/CMakeLists.txt

Added Paths:
-----------
    code/gazebo/trunk/cmake/gazeboserver_pkgconfig.cmake

Modified: code/gazebo/trunk/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/CMakeLists.txt    2010-04-24 01:27:34 UTC (rev 8619)
+++ code/gazebo/trunk/CMakeLists.txt    2010-04-24 17:42:52 UTC (rev 8620)
@@ -30,6 +30,8 @@
      CACHE INTERNAL "Link dirs description" FORCE)
 set (gazeboserver_link_libs_desc "List of server link libraries" 
      CACHE INTERNAL "Link libs description" FORCE)
+set (gazeboserver_ldflags_desc "List of server ldflags" 
+     CACHE INTERNAL "LDFlags description" FORCE)
 set (gazeboserver_cflags_desc "List of server cflags" 
      CACHE INTERNAL "Server cflags description" FORCE)
 set (gazebosensor_sources_desc "List of sensor sources" 

Modified: code/gazebo/trunk/cmake/FindOde.cmake
===================================================================
--- code/gazebo/trunk/cmake/FindOde.cmake       2010-04-24 01:27:34 UTC (rev 
8619)
+++ code/gazebo/trunk/cmake/FindOde.cmake       2010-04-24 17:42:52 UTC (rev 
8620)
@@ -59,7 +59,7 @@
   APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
                         ${gazeboserver_link_libs_desc} 
                         ${ODE_LIBRARIES})
-  APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
-                        ${gazeboserver_link_libs_desc} 
+  APPEND_TO_CACHED_LIST(gazeboserver_ldflags
+                        ${gazeboserver_ldflags_desc} 
                         ${ODE_LDFLAGS})
 ENDIF (NOT ODE_FOUND)

Modified: code/gazebo/trunk/cmake/GazeboUtils.cmake
===================================================================
--- code/gazebo/trunk/cmake/GazeboUtils.cmake   2010-04-24 01:27:34 UTC (rev 
8619)
+++ code/gazebo/trunk/cmake/GazeboUtils.cmake   2010-04-24 17:42:52 UTC (rev 
8620)
@@ -92,6 +92,8 @@
        ${gazeboserver_link_dirs_desc} FORCE)
   SET (gazeboserver_link_libs "" CACHE INTERNAL 
        ${gazeboserver_link_libs_desc} FORCE)
+  SET (gazeboserver_ldflags "" CACHE INTERNAL 
+       ${gazeboserver_ldflags_desc} FORCE)
   SET (gazeboserver_cflags "" CACHE INTERNAL 
        ${gazeboserver_cflags_desc} FORCE)
   SET (gazebosensor_sources "" CACHE INTERNAL 

Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake
===================================================================
--- code/gazebo/trunk/cmake/SearchForStuff.cmake        2010-04-24 01:27:34 UTC 
(rev 8619)
+++ code/gazebo/trunk/cmake/SearchForStuff.cmake        2010-04-24 17:42:52 UTC 
(rev 8620)
@@ -16,7 +16,7 @@
 
 set (bullet_include_dirs "" CACHE STRING "Bullet include paths. Use this to 
override automatic detection.")
 set (bullet_library_dirs "" CACHE STRING "Bullet library paths. Use this to 
override automatic detection.")
-set (bullet_lflags "" CACHE STRING "Bullet libraries Use this to override 
automatic detection.")
+set (bullet_lflags "" CACHE STRING "Bullet lflags Use this to override 
automatic detection.")
 set (bullet_cflags "-DBT_USE_DOUBLE_PRECISION -DBT_EULER_DEFAULT_ZYX" CACHE 
STRING "Bullet Dynamics C compile flags exported by rospack.")
 
 set (threadpool_include_dirs "" CACHE STRING "Threadpool include paths. Use 
this to override automatic detection.")
@@ -46,42 +46,53 @@
 # Find packages
 if (PKG_CONFIG_FOUND)
 
-  pkg_check_modules(OGRE OGRE>=${MIN_OGRE_VERSION})
-  if (NOT OGRE_FOUND)
-    BUILD_ERROR("Ogre3d version >=${MIN_OGRE_VERSION} and development files 
not found. See the following website for installation instructions: 
http://www.orge3d.org";)
-  else (NOT OGRE_FOUND)
- 
-    set (OGRE_LIBRARY_PATH ${OGRE_LIBRARY_DIRS} CACHE INTERNAL "Ogre library 
path")
 
-    APPEND_TO_CACHED_LIST(gazeboserver_include_dirs 
-                          ${gazeboserver_include_dirs_desc} 
-                          ${OGRE_INCLUDE_DIRS})
-    APPEND_TO_CACHED_LIST(gazeboserver_link_dirs 
-                          ${gazeboserver_link_dirs_desc} 
-                          ${OGRE_LIBRARY_DIRS})
-    APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
-                          ${gazeboserver_link_libs_desc} 
-                          ${OGRE_LINK_LIBS})
-    APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
-                          ${gazeboserver_link_libs_desc} 
-                          ${OGRE_LIBRARIES})
-    APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
-                          ${gazeboserver_link_libs_desc} 
-                          ${OGRE_LDFLAGS})
+  #################################################
+  # Find OGRE 
+  pkg_check_modules(OGRE-RTShaderSystem 
OGRE-RTShaderSystem>=${MIN_OGRE_VERSION})
+  if (OGRE-RTShaderSystem_FOUND)
 
-  # Try to find the OGRE RTShaderSystem library
-  find_library(ogre_rtshader_lib OgreRTShaderSystem ${OGRE_LIBRARY_DIRS} ENV 
LD_LIBRARY_PATH)
-  if (ogre_rtshader_lib)
-    APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
-                          ${gazeboserver_link_libs_desc} 
-                          ${ogre_rtshader_lib})
+    set(ogre_ldflags ${OGRE-RTShaderSystem_LDFLAGS})
+    set(ogre_include_dirs ${OGRE-RTShaderSystem_INCLUDE_DIRS})
+    set(ogre_library_dirs ${OGRE-RTShaderSystem_LIBRARY_DIRS})
+    set(ogre_libraries ${OGRE-RTShaderSystem_LIBRARIES})
     add_definitions(-DUSE_RTSHADER_SYSTEM)
-    #add_definitions(-DRTSHADER_SYSTEM_BUILD_CORE_SHADERS)
-    #add_definitions(-DRTSHADER_SYSTEM_BUILD_EXT_SHADERS)
-  endif (ogre_rtshader_lib)
 
-  endif (NOT OGRE_FOUND)
+  else (OGRE-RTShaderSystem_FOUND)
 
+    pkg_check_modules(OGRE OGRE>=${MIN_OGRE_VERSION})
+    if (NOT OGRE_FOUND)
+      BUILD_ERROR("Ogre3d version >=${MIN_OGRE_VERSION} and development files 
not found. See the following website for installation instructions: 
http://www.orge3d.org";)
+    else (NOT OGRE_FOUND)
+      set(ogre_ldflags ${OGRE_LDFLAGS})
+      set(ogre_include_dirs ${OGRE_INCLUDE_DIRS})
+      set(ogre_library_dirs ${OGRE_LIBRARY_DIRS})
+      set(ogre_libraries ${OGRE_LIBRARIES})
+    endif (NOT OGRE_FOUND)
+      
+  endif (OGRE-RTShaderSystem_FOUND)
+
+  set (OGRE_LIBRARY_PATH ${ogre_library_dirs} CACHE INTERNAL "Ogre library 
path")
+
+  APPEND_TO_CACHED_LIST(gazeboserver_include_dirs 
+                        ${gazeboserver_include_dirs_desc} 
+                        ${ogre_include_dirs})
+  APPEND_TO_CACHED_LIST(gazeboserver_link_dirs 
+                        ${gazeboserver_link_dirs_desc} 
+                        ${ogre_library_dirs})
+  APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
+                        ${gazeboserver_link_libs_desc} 
+                        ${ogre_link_libs})
+  APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
+                        ${gazeboserver_link_libs_desc} 
+                        ${ogre_libraries})
+  APPEND_TO_CACHED_LIST(gazeboserver_ldflags 
+                        ${gazeboserver_ldflags_desc} 
+                        ${ogre_ldflags})
+
+
+  #################################################
+  # Find XML
   pkg_check_modules(XML libxml-2.0)
   IF (NOT XML_FOUND)
     BUILD_ERROR("libxml2 and development files not found. See the following 
website: http://www.xmlsoft.org";)
@@ -98,6 +109,9 @@
     APPEND_TO_CACHED_LIST(gazeboserver_link_libs 
                           ${gazeboserver_link_libs_desc} 
                           ${XML_LIBRARIES})
+    APPEND_TO_CACHED_LIST(gazeboserver_ldflags 
+                          ${gazeboserver_ldflags_desc} 
+                          ${XML_LDFLAGS})
   ENDIF (NOT XML_FOUND)
 
   pkg_check_modules(XFT xft)
@@ -401,7 +415,6 @@
 # Find bullet
 if (NOT bullet_include_dirs AND NOT bullet_library_dirs AND NOT bullet_lflags )
 
-
   find_path(bullet_include_dir btBulletDynamicsCommon.h ${bullet_include_dirs} 
ENV CPATH)
   
   if (NOT bullet_include_dir)
@@ -424,30 +437,34 @@
     message (STATUS "Looking for libBulletDynamics - not found.")
   else (NOT bullet_dynamics_library)
     message (STATUS "Looking for libBulletDynamics - found")
-    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." ${bullet_dynamics_library})
+    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." -lBulletDynamics)
   endif (NOT bullet_dynamics_library)
 
   if (NOT bullet_collision_library)
     message (STATUS "Looking for libBulletCollision - not found.")
   else (NOT bullet_collision_library)
     message (STATUS "Looking for libBulletCollision - found")
-    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." ${bullet_collision_library})
+    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." -lBulletCollision)
   endif (NOT bullet_collision_library)
   
   if (NOT bullet_math_library)
     message (STATUS "Looking for libLinearMath - not found.")
   else (NOT bullet_math_library)
     message (STATUS "Looking for libLinearMath - found")
-    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." ${bullet_math_library})
+    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." -lLinearMath)
   endif (NOT bullet_math_library)
 
   if (NOT bullet_softbody_library)
     message (STATUS "Looking for libBulletSoftBody - not found.")
   else (NOT bullet_softbody_library)
     message (STATUS "Looking for libBulletSoftBody - found")
-    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." ${bullet_softbody_library})
+    APPEND_TO_CACHED_List(bullet_lflags "bullet libraries Use this to override 
automatic detection." -lBulletSoftBody)
   endif (NOT bullet_softbody_library)
 
+  APPEND_TO_CACHED_LIST(gazeboserver_ldflags
+                        ${gazeboserver_ldflags_desc} 
+                        ${bullet_lflags})
+
   if (NOT bullet_include_dir OR NOT bullet_dynamics_library)
     set (INCLUDE_BULLET OFF CACHE BOOL "Include Bullet" FORCE)
   else (NOT bullet_include_dir OR NOT bullet_dynamics_library)

Added: code/gazebo/trunk/cmake/gazeboserver_pkgconfig.cmake
===================================================================
--- code/gazebo/trunk/cmake/gazeboserver_pkgconfig.cmake                        
        (rev 0)
+++ code/gazebo/trunk/cmake/gazeboserver_pkgconfig.cmake        2010-04-24 
17:42:52 UTC (rev 8620)
@@ -0,0 +1,10 @@
+pref...@cmake_install_prefix@
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: gazeboserver
+Description: Gazebo server
+Version: @GAZEBO_VERSION@
+Requires:
+Libs: -L${libdir} -lgazebo_server -lgazebo @gazeboserver_ldflags@ 
+CFlags: -I${includedir}

Modified: code/gazebo/trunk/server/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/CMakeLists.txt     2010-04-24 01:27:34 UTC (rev 
8619)
+++ code/gazebo/trunk/server/CMakeLists.txt     2010-04-24 17:42:52 UTC (rev 
8620)
@@ -2,15 +2,20 @@
 
 ########################################
 # Include all the search paths for headers
-STRING (REPLACE " " ";" boost_include_dirs_split "${boost_include_dirs}")
-STRING (REPLACE " " ";" assimp_include_dirs_split "${assimp_include_dirs}")
-STRING (REPLACE " " ";" bullet_include_dirs_split "${bullet_include_dirs}")
-STRING (REPLACE " " ";" threadpool_include_dirs_split 
"${threadpool_include_dirs}")
-STRING (REPLACE " " ";" boost_library_dirs_split "${boost_library_dirs}")
-STRING (REPLACE " " ";" assimp_library_dirs_split "${assimp_library_dirs}")
-STRING (REPLACE " " ";" bullet_library_dirs_split "${bullet_library_dirs}")
+#STRING (REPLACE " " ";" boost_include_dirs_split "${boost_include_dirs}")
+#STRING (REPLACE " " ";" assimp_include_dirs_split "${assimp_include_dirs}")
+#STRING (REPLACE " " ";" bullet_include_dirs_split "${bullet_include_dirs}")
+#STRING (REPLACE " " ";" threadpool_include_dirs_split 
"${threadpool_include_dirs}")
+#STRING (REPLACE " " ";" boost_library_dirs_split "${boost_library_dirs}")
+#STRING (REPLACE " " ";" assimp_library_dirs_split "${assimp_library_dirs}")
+#STRING (REPLACE " " ";" bullet_library_dirs_split "${bullet_library_dirs}")
 
+APPEND_TO_CACHED_LIST(gazeboserver_ldflags 
+                      ${gazeboserver_ldflags_desc} 
+                      -lassimp -lgazebo_physics -lgazebo_physics_ode 
-lgazebo_av -lgazebo_gui -lgazebo_rendering)
 
+STRING (REPLACE ";" " " gazeboserver_ldflags "${gazeboserver_ldflags}")
+message(STATUS "SERVER LDFLAGS ${gazeboserver_ldflags}")
 
 INCLUDE_DIRECTORIES(
   .
@@ -166,13 +171,14 @@
                                    assimp
 )
 
+
 target_link_libraries( gazebo_server ${libtool_library} ${freeimage_library} 
gazebo gazebo_rendering gazebo_physics )
 
 if (INCLUDE_BULLET)
   #target_link_libraries(gazebo_server ${bullet_lflags} gazebo_physics_bullet )
   #target_link_libraries(gazebo-exec ${bullet_lflags} gazebo_physics_bullet )
 
-  #string (REPLACE " " ";" bullet_libraries_split "${bullet_lflags}")
+  #string (REPLACE " " ";" bullet_lflags_split "${bullet_lflags}")
   target_link_libraries(gazebo_server ${bullet_lflags} gazebo_physics_bullet )
   target_link_libraries(gazebo-exec ${bullet_lflags} gazebo_physics_bullet )
 endif (INCLUDE_BULLET)
@@ -183,6 +189,11 @@
 endif (INCLUDE_ODE)
 
 
+configure_file(${CMAKE_SOURCE_DIR}/cmake/gazeboserver_pkgconfig.cmake 
${CMAKE_CURRENT_BINARY_DIR}/gazeboserver.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gazeboserver.pc DESTINATION 
${CMAKE_INSTALL_PREFIX}/lib/pkgconfig COMPONENT pkgconfig)
+
+
+
 install (TARGETS gazebo_server DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
 install (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
 install (FILES ${gazeboserver_headers} DESTINATION 
${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers)


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

------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to