Permalink
Browse files

From Alan Dickinson, "I modified the CPack and CMake files to utilze …

…the CMAKE_INSTALL_PREFIX when building RPM packages.

I also modified the CMake and pkgconfig files to append the _POSTFIX extenstion based on the CMAKE_BUILD_TYPE.

Additionally I fixed packaging/ld.so.conf.d/openscenegraph.conf.in to add a '/' betweeen the arguments since the CMAKE_INSTALL_PREFIX can't end with a '/'.
"
  • Loading branch information...
osg-training-guest committed Mar 11, 2011
1 parent 17f34a5 commit 69939f81a621872b913c600c6e1abfb1130eef8f
View
@@ -548,6 +548,19 @@ SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windo
SET(CMAKE_RELWITHDEBINFO_POSTFIX "rd" CACHE STRING "add a postfix, usually empty on windows")
SET(CMAKE_MINSIZEREL_POSTFIX "s" CACHE STRING "add a postfix, usually empty on windows")
+# Set the build postfix extension according to what configuration is being built.
+IF (CMAKE_BUILD_TYPE MATCHES "Release")
+ SET(CMAKE_BUILD_POSTFIX "${CMAKE_RELEASE_POSTFIX}")
+ELSEIF (CMAKE_BUILD_TYPE MATCHES "MinSizeRel")
+ SET(CMAKE_BUILD_POSTFIX "${CMAKE_MINSIZEREL_POSTFIX}")
+ELSEIF(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
+ SET(CMAKE_BUILD_POSTFIX "${CMAKE_RELWITHDEBINFO_POSTFIX}")
+ELSEIF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ SET(CMAKE_BUILD_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
+ELSE()
+ SET(CMAKE_BUILD_POSTFIX "---")
+ENDIF()
+
IF(UNIX AND NOT WIN32)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
@@ -45,7 +45,8 @@ SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
SET(CPACK_GENERATOR "${CPACK_GENERATOR}")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${OpenSceneGraph_BINARY_DIR};OpenSceneGraph;${OSG_CPACK_COMPONENT};/")
-SET(CPACK_INSTALL_PREFIX "${CPACK_INSTALL_PREFIX}")
+SET(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+SET(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
SET(CPACK_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;")
SET(CPACK_NSIS_DISPLAY_NAME "${CMAKE_PROJECT_NAME} ${OPENSCENEGRAPH_VERSION}")
SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
@@ -67,5 +68,4 @@ SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}")
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt")
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt")
-SET(CPACK_SET_DESTDIR "OFF")
SET(CPACK_STRIP_FILES "ON")
@@ -1,2 +1,2 @@
# openscenegraph library configuration
-${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}
+${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}
@@ -10,5 +10,5 @@ Description: 3D scenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openthreads
Conflicts:
-Libs: -L${libdir} -losg
+Libs: -L${libdir} -losg@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Skinning and morphing library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osg openscenegraph-osgText openscenegraph-osgGA openscenegraph-osgViewer openthreads
Conflicts:
-Libs: -L${libdir} -losgAnimation
+Libs: -L${libdir} -losgAnimation@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: File format reading library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgDB
+Libs: -L${libdir} -losgDB@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Special effects library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgFX
+Libs: -L${libdir} -losgFX@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: GUI event library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgGA
+Libs: -L${libdir} -losgGA@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Manipulator library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgUtil openscenegraph-osgGA openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgManipulator
+Libs: -L${libdir} -losgManipulator@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Particle system library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgParticle
+Libs: -L${libdir} -losgParticle@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: osgQt utility library.
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgWidget openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgQt
+Libs: -L${libdir} -losgQt@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Shadow techniques library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgUtil openscenegraph-osgDB openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgShadow
+Libs: -L${libdir} -losgShadow@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Simulator utility library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgText openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgSim
+Libs: -L${libdir} -losgSim@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Terrain library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgUtil openscenegraph-osgDB openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgTerrain
+Libs: -L${libdir} -losgTerrain@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Text rendering library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgDB openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgText
+Libs: -L${libdir} -losgText@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Utility library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgUtil
+Libs: -L${libdir} -losgUtil@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Windowing system setup, thread scene manager library for Opensceneg
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgText openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osgGA openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgViewer
+Libs: -L${libdir} -losgViewer@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Volume library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgUtil openscenegraph-osgDB openscenegraph-osgGA openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgVolume
+Libs: -L${libdir} -losgVolume@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Windowing toolkit library for Openscenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openscenegraph-osgText openscenegraph-osgViewer openscenegraph-osgDB openscenegraph-osgGA openscenegraph-osg openthreads
Conflicts:
-Libs: -L${libdir} -losgWidget
+Libs: -L${libdir} -losgWidget@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,19 @@ Description: 3D scenegraph
Version: @OPENSCENEGRAPH_VERSION@
Requires: openthreads
Conflicts:
-Libs: -L${libdir} -losg -losgDB -losgFX -losgGA -losgParticle -losgSim -losgText -losgUtil -losgTerrain -losgManipulator -losgViewer -losgWidget -losgShadow -losgAnimation -losgVolume
+Libs: -L${libdir} -losg@CMAKE_BUILD_POSTFIX@ \
+ -losgDB@CMAKE_BUILD_POSTFIX@ \
+ -losgFX@CMAKE_BUILD_POSTFIX@ \
+ -losgGA@CMAKE_BUILD_POSTFIX@ \
+ -losgParticle@CMAKE_BUILD_POSTFIX@ \
+ -losgSim@CMAKE_BUILD_POSTFIX@ \
+ -losgText@CMAKE_BUILD_POSTFIX@ \
+ -losgUtil@CMAKE_BUILD_POSTFIX@ \
+ -losgTerrain@CMAKE_BUILD_POSTFIX@ \
+ -losgManipulator@CMAKE_BUILD_POSTFIX@ \
+ -losgViewer@CMAKE_BUILD_POSTFIX@ \
+ -losgWidget@CMAKE_BUILD_POSTFIX@ \
+ -losgShadow@CMAKE_BUILD_POSTFIX@ \
+ -losgAnimation@CMAKE_BUILD_POSTFIX@ \
+ -losgVolume@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}
@@ -10,5 +10,5 @@ Description: Object-Oriented (OO) thread interface for C++ programmers
Version: @OPENTHREADS_VERSION@
Requires:
Conflicts:
-Libs: -L${libdir} -lOpenThreads
+Libs: -L${libdir} -lOpenThreads@CMAKE_BUILD_POSTFIX@
Cflags: -I${includedir}

0 comments on commit 69939f8

Please sign in to comment.