diff --git a/CMakeLists.txt b/CMakeLists.txt index ed0e1d49f..4afbebcf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -880,6 +880,67 @@ IF(NOT DEFINED LIB_POSTFIX) SET(LIB_POSTFIX "") ENDIF() +# Set installation variables +SET(INSTALL_INCDIR include) +SET(INSTALL_BINDIR bin) +IF(WIN32) + SET(INSTALL_LIBDIR bin) + SET(INSTALL_ARCHIVEDIR lib) +ELSE() + SET(INSTALL_LIBDIR lib${LIB_POSTFIX}) + SET(INSTALL_ARCHIVEDIR lib${LIB_POSTFIX}) +ENDIF() + +# If the version is equal to or greater than 2.8.8, then we can use the +# CMakePackageConfigHelpers module, which we use for configuring the package +# config file. If we are not producing the package config file, then there is no +# point in exporting the targets. +IF(CMAKE_VERSION VERSION_EQUAL "2.8.8" OR + CMAKE_VERSION VERSION_GREATER "2.8.8") + + # Tell the project that we will be exporting targets + SET(OSG_EXPORT_TARGETS TRUE CACHE BOOL "Install a config-file and export targets") + + # Set the package namespace for exporting + SET(PKG_NAMESPACE osg${OPENSCENEGRAPH_MAJOR_VERSION}) + + IF(WIN32) + SET(INSTALL_CONFIGDIR cmake) + ELSE() + SET(INSTALL_CONFIGDIR lib${LIB_POSTFIX}/cmake/OpenSceneGraph) + ENDIF() + + INCLUDE(CMakePackageConfigHelpers) + CONFIGURE_PACKAGE_CONFIG_FILE( + ${PROJECT_SOURCE_DIR}/packaging/cmake/OpenSceneGraphConfig.cmake.in + configure/OpenSceneGraphConfig.cmake + INSTALL_DESTINATION ${INSTALL_CONFIGDIR} + PATH_VARS INSTALL_INCDIR + ) + + WRITE_BASIC_PACKAGE_VERSION_FILE( + configure/OpenSceneGraphConfigVersion.cmake + VERSION ${OPENSCENEGRAPH_VERSION} + COMPATIBILITY SameMajorVersion + ) + + INSTALL( + FILES + ${PROJECT_BINARY_DIR}/configure/OpenSceneGraphConfig.cmake + ${PROJECT_BINARY_DIR}/configure/OpenSceneGraphConfigVersion.cmake + DESTINATION ${INSTALL_CONFIGDIR} + COMPONENT libopenscenegraph-dev + ) + +ELSE() + + # We don't support exporting creating config files or exporting targets without >=2.8.8 + SET(OSG_EXPORT_TARGETS FALSE CACHE BOOL "Cannot install config files without CMake >= 2.8.8" FORCE) + +ENDIF() + +SET(INSTALL_PKGCONFIGDIR lib${LIB_POSTFIX}/pkgconfig) + # Here we apparently do some funky stuff with making the bin/ and lib/ # folders which is probably needed to work around a very old CMake bug? @@ -1237,35 +1298,6 @@ IF(CMAKE_CPACK_COMMAND) ENDIF() ENDIF() -# Generate pkg-config configuration files - -SET(PKGCONFIG_FILES - openscenegraph - openscenegraph-osg - openscenegraph-osgDB - openscenegraph-osgFX - openscenegraph-osgGA - openscenegraph-osgParticle - openscenegraph-osgSim - openscenegraph-osgText - openscenegraph-osgUtil - openscenegraph-osgTerrain - openscenegraph-osgManipulator - openscenegraph-osgViewer - openscenegraph-osgWidget - openscenegraph-osgShadow - openscenegraph-osgAnimation - openscenegraph-osgVolume -) - -FOREACH(PKGCONFIG_FILE ${PKGCONFIG_FILES}) - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc.in - ${PROJECT_BINARY_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc - @ONLY - ) - INSTALL(FILES ${PROJECT_BINARY_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc DESTINATION lib${LIB_POSTFIX}/pkgconfig COMPONENT libopenscenegraph-dev) -ENDFOREACH(PKGCONFIG_FILE) - # Run this as late as possible so users can easier spot the message IF (NOT DEFINED REQUIRES_LIBPATH_MESSAGE AND ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local") diff --git a/CMakeModules/ModuleInstall.cmake b/CMakeModules/ModuleInstall.cmake index be80fd1db..5f66de799 100644 --- a/CMakeModules/ModuleInstall.cmake +++ b/CMakeModules/ModuleInstall.cmake @@ -4,16 +4,6 @@ # ${LIB_NAME} # ${TARGET_H} -SET(INSTALL_INCDIR include) -SET(INSTALL_BINDIR bin) -IF(WIN32) - SET(INSTALL_LIBDIR bin) - SET(INSTALL_ARCHIVEDIR lib) -ELSE() - SET(INSTALL_LIBDIR lib${LIB_POSTFIX}) - SET(INSTALL_ARCHIVEDIR lib${LIB_POSTFIX}) -ENDIF() - SET(HEADERS_GROUP "Header Files") SOURCE_GROUP( @@ -25,12 +15,55 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL) HANDLE_MSVC_DLL() ENDIF() -INSTALL( - TARGETS ${LIB_NAME} - RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph - LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph - ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev -) + +IF(OSG_EXPORT_TARGETS) + + INSTALL( + TARGETS ${LIB_NAME} + EXPORT ${LIB_NAME} + RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph + LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph + ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev + ) + + INSTALL( + EXPORT ${LIB_NAME} + NAMESPACE ${PKG_NAMESPACE}:: + DESTINATION ${INSTALL_CONFIGDIR} + FILE ${LIB_NAME}-targets.cmake + COMPONENT libopenscenegraph-dev + ) + + SET(COMPONENT_CMAKE_DEPENDENCIES ${TARGET_LIBRARIES}) + + # These two libraries are special cases because they will always be included + # by the config-file. + LIST(REMOVE_ITEM COMPONENT_CMAKE_DEPENDENCIES OpenThreads) + LIST(REMOVE_ITEM COMPONENT_CMAKE_DEPENDENCIES osg) + + SET(TARGET_IMPORT_INPUT_FILE "${PROJECT_SOURCE_DIR}/packaging/cmake/openscenegraph-component-import-targets.cmake") + SET(TARGET_IMPORT_OUTPUT_FILE "${PROJECT_BINARY_DIR}/packaging/cmake/openscenegraph-${LIB_NAME}-import-targets.cmake") + CONFIGURE_FILE( + ${TARGET_IMPORT_INPUT_FILE} + ${TARGET_IMPORT_OUTPUT_FILE} + @ONLY + ) + INSTALL( + FILES ${TARGET_IMPORT_OUTPUT_FILE} + DESTINATION ${INSTALL_CONFIGDIR} + COMPONENT libopenscenegraph-dev + ) + +ELSE() + + INSTALL( + TARGETS ${LIB_NAME} + RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph + LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph + ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev + ) + +ENDIF() IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX) @@ -57,3 +90,26 @@ ELSE() # MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}") ENDIF() + +# Install pkgconfig file for this component +SET(COMPONENT_PKGCONFIG_REQUIRES) +FOREACH(component ${TARGET_LIBRARIES}) + IF(${component} STREQUAL "OpenThreads") + # Skip OpenThreads because that's handled separately + CONTINUE() + ENDIF() + SET(COMPONENT_PKGCONFIG_REQUIRES "${COMPONENT_PKGCONFIG_REQUIRES} openscenegraph-${component}") +ENDFOREACH() + +SET(PKGCONFIG_INPUT_FILE "${PROJECT_SOURCE_DIR}/packaging/pkgconfig/component.pc.in") +SET(PKGCONFIG_OUTPUT_FILE "${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph-${LIB_NAME}.pc") +CONFIGURE_FILE( + ${PKGCONFIG_INPUT_FILE} + ${PKGCONFIG_OUTPUT_FILE} + @ONLY +) +INSTALL( + FILES ${PKGCONFIG_OUTPUT_FILE} + DESTINATION ${INSTALL_PKGCONFIGDIR} + COMPONENT libopenscenegraph-dev +) diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake index dcc1fe37d..923d9f760 100644 --- a/CMakeModules/OsgMacroUtils.cmake +++ b/CMakeModules/OsgMacroUtils.cmake @@ -223,6 +223,13 @@ MACRO(SETUP_LIBRARY LIB_NAME) ${TARGET_H_NO_MODULE_INSTALL} ${TARGET_SRC} ) + + TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} + PUBLIC + $ + $ + ) + SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core") IF(APPLE) IF(OSG_BUILD_PLATFORM_IPHONE) diff --git a/examples/osgCMakeExampleModern/CMakeLists.txt b/examples/osgCMakeExampleModern/CMakeLists.txt new file mode 100644 index 000000000..2d9cbde01 --- /dev/null +++ b/examples/osgCMakeExampleModern/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 2.8.8) + +SET(PROJECT_NAME osgCMakeExampleModern) + +PROJECT(${PROJECT_NAME}) + +FIND_PACKAGE (OpenSceneGraph REQUIRED COMPONENTS osgUtil osgDB osgText osgGA osgFX osgSim osgViewer CONFIG) + +SET(SOURCES + main.cpp +) + + +ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} osg3::osg osg3::osgUtil osg3::osgDB osg3::osgText osg3::osgGA osg3::osgFX osg3::osgSim osg3::osgViewer) \ No newline at end of file diff --git a/examples/osgCMakeExampleModern/main.cpp b/examples/osgCMakeExampleModern/main.cpp new file mode 100644 index 000000000..d790d3873 --- /dev/null +++ b/examples/osgCMakeExampleModern/main.cpp @@ -0,0 +1,183 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield + * + * This application is open source and may be redistributed and/or modified + * freely and without restriction, both in commercial and non commercial applications, + * as long as this copyright notice is maintained. + * + * This application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + + +int main(int argc, char** argv) +{ + // use an ArgumentParser object to manage the program arguments. + osg::ArgumentParser arguments(&argc,argv); + + arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); + arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the standard OpenSceneGraph example which loads and visualises 3d models."); + arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); + arguments.getApplicationUsage()->addCommandLineOption("--image ","Load an image and render it on a quad"); + arguments.getApplicationUsage()->addCommandLineOption("--dem ","Load an image/DEM and render it on a HeightField"); + arguments.getApplicationUsage()->addCommandLineOption("--login ","Provide authentication information for http file access."); + arguments.getApplicationUsage()->addCommandLineOption("-p ","Play specified camera path animation file, previously saved with 'z' key."); + arguments.getApplicationUsage()->addCommandLineOption("--speed ","Speed factor for animation playing (1 == normal speed)."); + arguments.getApplicationUsage()->addCommandLineOption("--device ","add named device to the viewer"); + + osgViewer::Viewer viewer(arguments); + + unsigned int helpType = 0; + if ((helpType = arguments.readHelpType())) + { + arguments.getApplicationUsage()->write(std::cout, helpType); + return 1; + } + + // report any errors if they have occurred when parsing the program arguments. + if (arguments.errors()) + { + arguments.writeErrorMessages(std::cout); + return 1; + } + + if (arguments.argc()<=1) + { + arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); + return 1; + } + + std::string url, username, password; + while(arguments.read("--login",url, username, password)) + { + if (!osgDB::Registry::instance()->getAuthenticationMap()) + { + osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap); + osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails( + url, + new osgDB::AuthenticationDetails(username, password) + ); + } + } + + std::string device; + while(arguments.read("--device", device)) + { + osg::ref_ptr dev = osgDB::readRefFile(device); + if (dev.valid()) + { + viewer.addDevice(dev); + } + } + + // set up the camera manipulators. + { + osg::ref_ptr keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; + + keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() ); + keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); + keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() ); + keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); + keyswitchManipulator->addMatrixManipulator( '5', "Orbit", new osgGA::OrbitManipulator() ); + keyswitchManipulator->addMatrixManipulator( '6', "FirstPerson", new osgGA::FirstPersonManipulator() ); + keyswitchManipulator->addMatrixManipulator( '7', "Spherical", new osgGA::SphericalManipulator() ); + + std::string pathfile; + double animationSpeed = 1.0; + while(arguments.read("--speed",animationSpeed) ) {} + char keyForAnimationPath = '8'; + while (arguments.read("-p",pathfile)) + { + osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); + if (apm || !apm->valid()) + { + apm->setTimeScale(animationSpeed); + + unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); + keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); + keyswitchManipulator->selectMatrixManipulator(num); + ++keyForAnimationPath; + } + } + + viewer.setCameraManipulator( keyswitchManipulator.get() ); + } + + // add the state manipulator + viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); + + // add the thread model handler + viewer.addEventHandler(new osgViewer::ThreadingHandler); + + // add the window size toggle handler + viewer.addEventHandler(new osgViewer::WindowSizeHandler); + + // add the stats handler + viewer.addEventHandler(new osgViewer::StatsHandler); + + // add the help handler + viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage())); + + // add the record camera path handler + viewer.addEventHandler(new osgViewer::RecordCameraPathHandler); + + // add the LOD Scale handler + viewer.addEventHandler(new osgViewer::LODScaleHandler); + + // add the screen capture handler + viewer.addEventHandler(new osgViewer::ScreenCaptureHandler); + + // load the data + osg::ref_ptr loadedModel = osgDB::readRefNodeFiles(arguments); + if (!loadedModel) + { + std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; + return 1; + } + + // any option left unread are converted into errors to write out later. + arguments.reportRemainingOptionsAsUnrecognized(); + + // report any errors if they have occurred when parsing the program arguments. + if (arguments.errors()) + { + arguments.writeErrorMessages(std::cout); + return 1; + } + + + // optimize the scene graph, remove redundant nodes and state etc. + osgUtil::Optimizer optimizer; + optimizer.optimize(loadedModel); + + viewer.setSceneData(loadedModel); + + viewer.realize(); + + return viewer.run(); + +} diff --git a/packaging/cmake/OpenSceneGraphConfig.cmake.in b/packaging/cmake/OpenSceneGraphConfig.cmake.in new file mode 100644 index 000000000..7fec3a6ee --- /dev/null +++ b/packaging/cmake/OpenSceneGraphConfig.cmake.in @@ -0,0 +1,192 @@ +# - Config file for the OpenSceneGraph package. +# +# For finding and loading OpenSceneGraph from your project, type: +# +# find_package(OpenSceneGraph [version] [COMPONENTS comp]) +# +# This creates the following variables: +# +# OpenSceneGraph_LIBRARIES : All the libraries of all the requested components +# OPENSCENEGRAPH_LIBRARIES +# +# OpenSceneGraph_INCLUDE_DIRS : All the include directories of all the requested components +# OPENSCENEGRAPH_INCLUDE_DIRS +# +# OpenSceneGraph_FOUND : Set to true if all required components can be found +# OPENSCENEGRAPH_FOUND +# +# OpenSceneGraph__FOUND : Set to true if this component was found +# OPENSCENEGRAPH__FOUND +# +# OSG_LIBRARY : The library for the core OSG component +# OSG_LIBRARIES +# +# OSG_INCLUDE_DIR : The include directory for the core OSG component +# +# _LIBRARY : This is created for each requested component +# _LIBRARIES and refers to the component's library +# +# _INCLUDE_DIR : This is created for each requested component +# and refers to the component's include directory + + +################################################################################ +# +# This config-file will also import the following targets: +# +# @PKG_NAMESPACE@::osg (for the core OSG library) +# @PKG_NAMESPACE@:: (for each requested component library) +# +# Use target_link_libraries(tgt [PUBLIC|PRIVATE] @PKG_NAMESPACE@::) +# for each component that you want to link to. +# +# For convenience, this will also produce a variable +# +# OpenSceneGraph_TARGETS +# +# which will contain the targets of all the requested components. +# +################################################################################ + + +# =========================== DO NOT MODIFY THIS FILE DIRECTLY =========================== +# This file is auto-generated from OpenSceneGraph/CMakeModules/OpenSceneGraphConfig.cmake +# ======================================================================================== + +# We depend on 2.8.8 for CMakePackageConfigHelpers. This config file is not +# guaranteed to work with lower versions of cmake. +cmake_minimum_required(VERSION 2.8.8) + +# Assume we have succeeded unless a required component is missing +set(OpenSceneGraph_FOUND TRUE) +set(OPENSCENEGRAPH_FOUND TRUE) + +# Shortcut if find_package(OpenSceneGraph ...) has been called before +if(OpenSceneGraph_CONFIG_INCLUDED) + + # Check that each of the components requested have already been found. + set(OpenSceneGraph_all_components_found TRUE) + foreach(component ${OpenSceneGraph_FIND_COMPONENTS}) + if(NOT TARGET @PKG_NAMESPACE@::${component}) + set(OpenSceneGraph_all_components_found FALSE) + break() + endif() + endforeach() + + # If this config file has been called before, and all the requested + # components are already found, then exit early. + if(OpenSceneGraph_all_components_found) + return() + endif() + +endif() +set(OpenSceneGraph_CONFIG_INCLUDED TRUE) + +@PACKAGE_INIT@ + +set(OpenSceneGraph_INCLUDE_DIRS @PACKAGE_INSTALL_INCDIR@) +set(OPENSCENEGRAPH_INCLUDE_DIRS ${OpenSceneGraph_INCLUDE_DIRS}) + +set(OpenSceneGraph_LIBRARIES) + +set(OpenSceneGraph_TARGETS) + +foreach(component OpenThreads osg ${OpenSceneGraph_FIND_COMPONENTS}) + + if(TARGET @PKG_NAMESPACE@::${component}) + # This component has already been found, so we'll skip it + continue() + endif() + + string(TOUPPER ${component} UC_COMPONENT) + + set(osg_component_import_target_file ${CMAKE_CURRENT_LIST_DIR}/openscenegraph-${component}-import-targets.cmake) + + if(NOT EXISTS ${osg_component_import_target_file}) + + if(OpenSceneGraph_FIND_REQUIRED_${component} OR NOT OpenSceneGraph_FIND_QUIETLY) + message("Could not find [${component}] component of OpenSceneGraph") + endif() + + set(OpenSceneGraph_${component}_FOUND FALSE) + set(OPENSCENEGRAPH_${UC_COMPONENT}_FOUND FALSE) + + continue() + + endif() + + include(${osg_component_import_target_file}) + + list(APPEND OpenSceneGraph_TARGETS @PKG_NAMESPACE@::${component}) + + set(OpenSceneGraph_${component}_FOUND TRUE) + set(OPENSCENEGRAPH_${component}_FOUND TRUE) + + if(NOT OpenSceneGraph_FIND_QUIETLY) + message(STATUS "Found [${component}] component of OpenSceneGraph") + endif() + + # Components all get installed to the same include directory + set(${UC_COMPONENT}_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) + + if(WIN32) + # For Windows, we need to provide the consumer with the IMPLIB (.lib) file + set(osg_imported_lib_property IMPORTED_IMPLIB) + else() + # For UNIX, we need to provide the shared object (.so) file + set(osg_imported_lib_property IMPORTED_LOCATION) + endif() + + # For each possible configuration, find the relevant file on disk + foreach(osg_configuration "" _DEBUG _RELEASE) + + get_property(${UC_COMPONENT}_LIBRARY${osg_configuration} + TARGET @PKG_NAMESPACE@::${component} + PROPERTY ${osg_imported_lib_property}${osg_configuration} + ) + set(${UC_COMPONENT}_LIBRARIES${osg_configuration} ${${UC_COMPONENT}_LIBRARY}) + + endforeach() + + # If a default library configuration was not found, create it + if(NOT ${UC_COMPONENT}_LIBRARY) + + if(${UC_COMPONENT}_LIBRARY_DEBUG AND ${UC_COMPONENT}_LIBRARY_RELEASE) + + # We have a release and a debug library, so let's use both + set(${UC_COMPONENT}_LIBRARY + optimized ${${UC_COMPONENT}_LIBRARY_RELEASE} + debug ${${UC_COMPONENT}_LIBRARY_DEBUG}) + + elseif(${UC_COMPONENT}_LIBRARY_RELEASE) + + # There is only a release library, so let's use that + set(${UC_COMPONENT}_LIBRARY optimized ${${UC_COMPONENT}_LIBRARY_RELEASE}) + + elseif(${UC_COMPONENT}_LIBRARY_DEBUG) + + # There is only a debug library, so let's use that + set(${UC_COMPONENT}_LIBRARY debug ${${UC_COMPONENT}_LIBRARY_DEBUG}) + + else() + + # This should never happen, or else something is severely broken + # with the configuration, so we'll quit early. + message(FATAL_ERROR + "Could not find either an optimized or a debug version of the " + "requested OSG component: [${component}]") + + endif() + + set(${UC_COMPONENT}_LIBRARIES ${${UC_COMPONENT}_LIBRARY}) + + endif() + + list(APPEND OpenSceneGraph_LIBRARIES ${${UC_COMPONENT}_LIBRARIES}) + +endforeach() + +set(OPENSCENEGRAPH_LIBRARIES ${OpenSceneGraph_LIBRARIES}) + +check_required_components(OpenSceneGraph) +set(OPENSCENEGRAPH_FOUND ${OpenSceneGraph_FOUND}) diff --git a/packaging/cmake/openscenegraph-component-import-targets.cmake b/packaging/cmake/openscenegraph-component-import-targets.cmake new file mode 100644 index 000000000..5e3b6bcea --- /dev/null +++ b/packaging/cmake/openscenegraph-component-import-targets.cmake @@ -0,0 +1,23 @@ +# This is a utility file for importing the target (and its dependencies) of +# @LIB_NAME@, a component library of OpenSceneGraph. This is designed to be used +# by OpenSceneGraphConfig.cmake and should not be invoked directly. + +# First we import all dependent targets (as well as their dependencies, recursively) +foreach(dependency @COMPONENT_CMAKE_DEPENDENCIES@) + set(osg_component_dependency_target_file ${CMAKE_CURRENT_LIST_DIR}/openscenegraph-${dependency}-import-targets.cmake) + if(NOT EXISTS ${osg_component_dependency_target_file}) + # Note: This should never happen, because if this library was installed + # and its target was exported, then its dependencies should have been + # installed with their targets alongside it. If we ever land here, then + # either there is a bug in the build system, or the user has broken + # their installation of OpenSceneGraph. + message(FATAL_ERROR + "Could not find [${dependency}] which is a dependency of [@LIB_NAME@]." + " This may indicate a broken installation of OpenSceneGraph.") + endif() + + include(${osg_component_dependency_target_file}) +endforeach() + +# Then we import our own target file +include(${CMAKE_CURRENT_LIST_DIR}/@LIB_NAME@-targets.cmake) diff --git a/packaging/pkgconfig/openscenegraph-osg.pc.in b/packaging/pkgconfig/component.pc.in similarity index 54% rename from packaging/pkgconfig/openscenegraph-osg.pc.in rename to packaging/pkgconfig/component.pc.in index 2ebe47ddb..f5b72c32f 100644 --- a/packaging/pkgconfig/openscenegraph-osg.pc.in +++ b/packaging/pkgconfig/component.pc.in @@ -5,10 +5,10 @@ exec_prefix=${prefix} libdir=${exec_prefix}/lib@LIB_POSTFIX@ includedir=${prefix}/include -Name: openscenegraph-osg -Description: 3D scenegraph +Name: openscenegraph-@LIB_NAME@ +Description: @COMPONENT_PKGCONFIG_DESCRIPTION@ Version: @OPENSCENEGRAPH_VERSION@ -Requires: openthreads +Requires:@COMPONENT_PKGCONFIG_REQUIRES@ openthreads Conflicts: -Libs: -L${libdir} -losg@CMAKE_BUILD_POSTFIX@ +Libs: -L${libdir} -l@LIB_NAME@@CMAKE_BUILD_POSTFIX@ Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgAnimation.pc.in b/packaging/pkgconfig/openscenegraph-osgAnimation.pc.in deleted file mode 100644 index eb9cb85ea..000000000 --- a/packaging/pkgconfig/openscenegraph-osgAnimation.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgAnimation -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@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgDB.pc.in b/packaging/pkgconfig/openscenegraph-osgDB.pc.in deleted file mode 100644 index 0015a529e..000000000 --- a/packaging/pkgconfig/openscenegraph-osgDB.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgDB -Description: File format reading library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgDB@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgFX.pc.in b/packaging/pkgconfig/openscenegraph-osgFX.pc.in deleted file mode 100644 index 92ce51eda..000000000 --- a/packaging/pkgconfig/openscenegraph-osgFX.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgFX -Description: Special effects library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgFX@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgGA.pc.in b/packaging/pkgconfig/openscenegraph-osgGA.pc.in deleted file mode 100644 index 17d7125b2..000000000 --- a/packaging/pkgconfig/openscenegraph-osgGA.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgGA -Description: GUI event library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgGA@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgManipulator.pc.in b/packaging/pkgconfig/openscenegraph-osgManipulator.pc.in deleted file mode 100644 index 6ef410c06..000000000 --- a/packaging/pkgconfig/openscenegraph-osgManipulator.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgManipulator -Description: Manipulator library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgUtil openscenegraph-osgGA openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgManipulator@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgParticle.pc.in b/packaging/pkgconfig/openscenegraph-osgParticle.pc.in deleted file mode 100644 index 2f504e228..000000000 --- a/packaging/pkgconfig/openscenegraph-osgParticle.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgParticle -Description: Particle system library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgParticle@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgShadow.pc.in b/packaging/pkgconfig/openscenegraph-osgShadow.pc.in deleted file mode 100644 index 00c546244..000000000 --- a/packaging/pkgconfig/openscenegraph-osgShadow.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgShadow -Description: Shadow techniques library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgUtil openscenegraph-osgDB openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgShadow@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgSim.pc.in b/packaging/pkgconfig/openscenegraph-osgSim.pc.in deleted file mode 100644 index 68e6f2b12..000000000 --- a/packaging/pkgconfig/openscenegraph-osgSim.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgSim -Description: Simulator utility library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgText openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgSim@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgTerrain.pc.in b/packaging/pkgconfig/openscenegraph-osgTerrain.pc.in deleted file mode 100644 index 549494b29..000000000 --- a/packaging/pkgconfig/openscenegraph-osgTerrain.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgTerrain -Description: Terrain library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgUtil openscenegraph-osgDB openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgTerrain@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgText.pc.in b/packaging/pkgconfig/openscenegraph-osgText.pc.in deleted file mode 100644 index 68f4b74ab..000000000 --- a/packaging/pkgconfig/openscenegraph-osgText.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgText -Description: Text rendering library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgDB openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgText@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgUtil.pc.in b/packaging/pkgconfig/openscenegraph-osgUtil.pc.in deleted file mode 100644 index 4b1950d4b..000000000 --- a/packaging/pkgconfig/openscenegraph-osgUtil.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgUtil -Description: Utility library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgUtil@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgViewer.pc.in b/packaging/pkgconfig/openscenegraph-osgViewer.pc.in deleted file mode 100644 index 6172d0db4..000000000 --- a/packaging/pkgconfig/openscenegraph-osgViewer.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgViewer -Description: Windowing system setup, thread scene manager library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgText openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osgGA openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgViewer@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgVolume.pc.in b/packaging/pkgconfig/openscenegraph-osgVolume.pc.in deleted file mode 100644 index 5a283826f..000000000 --- a/packaging/pkgconfig/openscenegraph-osgVolume.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgVolume -Description: Volume library for Openscenegraph -Version: @OPENSCENEGRAPH_VERSION@ -Requires: openscenegraph-osgUtil openscenegraph-osgDB openscenegraph-osgGA openscenegraph-osg openthreads -Conflicts: -Libs: -L${libdir} -losgVolume@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/packaging/pkgconfig/openscenegraph-osgWidget.pc.in b/packaging/pkgconfig/openscenegraph-osgWidget.pc.in deleted file mode 100644 index 4e7eaea5d..000000000 --- a/packaging/pkgconfig/openscenegraph-osgWidget.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# pkg-config source file - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_POSTFIX@ -includedir=${prefix}/include - -Name: openscenegraph-osgWidget -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@CMAKE_BUILD_POSTFIX@ -Cflags: -I${includedir} diff --git a/src/OpenThreads/pthreads/CMakeLists.txt b/src/OpenThreads/pthreads/CMakeLists.txt index 1a3e96a9b..b11d5948c 100644 --- a/src/OpenThreads/pthreads/CMakeLists.txt +++ b/src/OpenThreads/pthreads/CMakeLists.txt @@ -125,6 +125,12 @@ ELSE() ${TARGET_SRC} ) + TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} + PUBLIC + $ + $ + ) + IF(OPENTHREADS_SONAMES) SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${OPENTHREADS_VERSION} SOVERSION ${OPENTHREADS_SOVERSION}) ENDIF() @@ -148,18 +154,57 @@ ELSE() ${CMAKE_CURRENT_BINARY_DIR} ) - INSTALL( - TARGETS OpenThreads - ARCHIVE DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads-dev - LIBRARY DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads - RUNTIME DESTINATION bin COMPONENT libopenthreads - ) + IF(OSG_EXPORT_TARGETS) + + INSTALL( + TARGETS ${LIB_NAME} + EXPORT ${LIB_NAME} + ARCHIVE DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads-dev + LIBRARY DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads + RUNTIME DESTINATION bin COMPONENT libopenthreads + ) + + INSTALL( + EXPORT ${LIB_NAME} + NAMESPACE ${PKG_NAMESPACE}:: + DESTINATION ${INSTALL_CONFIGDIR} + FILE ${LIB_NAME}-targets.cmake + COMPONENT libopenthreads-dev + ) + + # Intentionally blank + SET(COMPONENT_CMAKE_DEPENDENCIES) + + SET(TARGET_IMPORT_INPUT_FILE "${PROJECT_SOURCE_DIR}/packaging/cmake/openscenegraph-component-import-targets.cmake") + SET(TARGET_IMPORT_OUTPUT_FILE "${PROJECT_BINARY_DIR}/packaging/cmake/openscenegraph-${LIB_NAME}-import-targets.cmake") + CONFIGURE_FILE( + ${TARGET_IMPORT_INPUT_FILE} + ${TARGET_IMPORT_OUTPUT_FILE} + @ONLY + ) + INSTALL( + FILES ${TARGET_IMPORT_OUTPUT_FILE} + DESTINATION ${INSTALL_CONFIGDIR} + COMPONENT libopenscenegraph-dev + ) + + ELSE() + + INSTALL( + TARGETS ${LIB_NAME} + ARCHIVE DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads-dev + LIBRARY DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads + RUNTIME DESTINATION bin COMPONENT libopenthreads + ) + + ENDIF() IF(NOT OSG_COMPILE_FRAMEWORKS) - INSTALL( - FILES ${OpenThreads_PUBLIC_HEADERS} - DESTINATION include/OpenThreads - COMPONENT libopenthreads-dev + + INSTALL( + FILES ${OpenThreads_PUBLIC_HEADERS} + DESTINATION ${INSTALL_INCDIR}/OpenThreads + COMPONENT libopenthreads-dev ) ELSE() diff --git a/src/OpenThreads/win32/CMakeLists.txt b/src/OpenThreads/win32/CMakeLists.txt index 84550bd7a..82574ebf4 100644 --- a/src/OpenThreads/win32/CMakeLists.txt +++ b/src/OpenThreads/win32/CMakeLists.txt @@ -43,12 +43,50 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL) HANDLE_MSVC_DLL(ot ${OPENTHREADS_SOVERSION}) ENDIF() -INSTALL( - TARGETS OpenThreads - ARCHIVE DESTINATION lib COMPONENT libopenthreads-dev - LIBRARY DESTINATION lib COMPONENT libopenthreads - RUNTIME DESTINATION bin COMPONENT libopenthreads -) +IF(OSG_EXPORT_TARGETS) + + INSTALL( + TARGETS OpenThreads + EXPORT OpenThreads + ARCHIVE DESTINATION lib COMPONENT libopenthreads-dev + LIBRARY DESTINATION lib COMPONENT libopenthreads + RUNTIME DESTINATION bin COMPONENT libopenthreads + ) + + INSTALL( + EXPORT OpenThreads + NAMESPACE ${PKG_NAMESPACE}:: + DESTINATION ${INSTALL_CONFIGDIR} + FILE OpenThreads-targets.cmake + COMPONENT libopenthreads-dev + ) + + # Intentionally blank + SET(COMPONENT_CMAKE_DEPENDENCIES) + + SET(TARGET_IMPORT_INPUT_FILE "${PROJECT_SOURCE_DIR}/packaging/cmake/openscenegraph-component-import-targets.cmake") + SET(TARGET_IMPORT_OUTPUT_FILE "${PROJECT_BINARY_DIR}/packaging/cmake/openscenegraph-OpenThreads-import-targets.cmake") + CONFIGURE_FILE( + ${TARGET_IMPORT_INPUT_FILE} + ${TARGET_IMPORT_OUTPUT_FILE} + @ONLY + ) + INSTALL( + FILES ${TARGET_IMPORT_OUTPUT_FILE} + DESTINATION ${INSTALL_CONFIGDIR} + COMPONENT libopenscenegraph-dev + ) + +ELSE() + + INSTALL( + TARGETS OpenThreads + ARCHIVE DESTINATION lib COMPONENT libopenthreads-dev + LIBRARY DESTINATION lib COMPONENT libopenthreads + RUNTIME DESTINATION bin COMPONENT libopenthreads + ) + +ENDIF() INSTALL( FILES ${OpenThreads_PUBLIC_HEADERS} DESTINATION include/OpenThreads diff --git a/src/osg/CMakeLists.txt b/src/osg/CMakeLists.txt index 425949b6a..97ac88882 100644 --- a/src/osg/CMakeLists.txt +++ b/src/osg/CMakeLists.txt @@ -460,4 +460,6 @@ SET(TARGET_EXTERNAL_LIBRARIES #INCLUDE(ModuleInstall OPTIONAL) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "3D scenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgAnimation/CMakeLists.txt b/src/osgAnimation/CMakeLists.txt index 7a79b914d..61c40286f 100644 --- a/src/osgAnimation/CMakeLists.txt +++ b/src/osgAnimation/CMakeLists.txt @@ -106,5 +106,7 @@ SET(TARGET_LIBRARIES OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Skinning and morphing library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt index 03bcd2c93..c125f6f34 100644 --- a/src/osgDB/CMakeLists.txt +++ b/src/osgDB/CMakeLists.txt @@ -183,5 +183,7 @@ SET(TARGET_LIBRARIES SET(TARGET_EXTERNAL_LIBRARIES ${OSGDB_PLATFORM_SPECIFIC_LIBRARIES} ${DL_LIBRARY}) SET(TARGET_LIBRARIES_VARS ${COMPRESSION_LIBRARIES}) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "File format reading library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgFX/CMakeLists.txt b/src/osgFX/CMakeLists.txt index 026ea57f0..9befe009c 100644 --- a/src/osgFX/CMakeLists.txt +++ b/src/osgFX/CMakeLists.txt @@ -40,11 +40,13 @@ SET(TARGET_SRC ${OPENSCENEGRAPH_VERSIONINFO_RC} ) -SET(TARGET_LIBRARIES - osgUtil +SET(TARGET_LIBRARIES osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Special effects library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgGA/CMakeLists.txt b/src/osgGA/CMakeLists.txt index 49b0aca73..db36b82c8 100644 --- a/src/osgGA/CMakeLists.txt +++ b/src/osgGA/CMakeLists.txt @@ -73,5 +73,7 @@ SET(TARGET_LIBRARIES OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "GUI event library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgManipulator/CMakeLists.txt b/src/osgManipulator/CMakeLists.txt index 356b80df8..18da3aa8a 100644 --- a/src/osgManipulator/CMakeLists.txt +++ b/src/osgManipulator/CMakeLists.txt @@ -66,4 +66,6 @@ SET(TARGET_LIBRARIES OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Manipulator library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgParticle/CMakeLists.txt b/src/osgParticle/CMakeLists.txt index 30d5a7037..04cd1898e 100644 --- a/src/osgParticle/CMakeLists.txt +++ b/src/osgParticle/CMakeLists.txt @@ -88,11 +88,13 @@ SET(TARGET_SRC ${OPENSCENEGRAPH_VERSIONINFO_RC} ) -SET(TARGET_LIBRARIES - osgUtil +SET(TARGET_LIBRARIES osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Particle system library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgPresentation/CMakeLists.txt b/src/osgPresentation/CMakeLists.txt index f7a1936f4..9c02db922 100644 --- a/src/osgPresentation/CMakeLists.txt +++ b/src/osgPresentation/CMakeLists.txt @@ -43,11 +43,13 @@ SET(TARGET_LIBRARIES osgFX osgText osgGA - osgUtil osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "A library for creating slide show presentations with OpenSceneGraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgShadow/CMakeLists.txt b/src/osgShadow/CMakeLists.txt index cf9ac58d0..35c15bc18 100644 --- a/src/osgShadow/CMakeLists.txt +++ b/src/osgShadow/CMakeLists.txt @@ -61,11 +61,13 @@ SET(TARGET_SRC ) SET(TARGET_LIBRARIES - osgUtil osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Shadow techniques library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgSim/CMakeLists.txt b/src/osgSim/CMakeLists.txt index a866c2d17..f16880e60 100644 --- a/src/osgSim/CMakeLists.txt +++ b/src/osgSim/CMakeLists.txt @@ -65,12 +65,14 @@ SET(TARGET_SRC SET(TARGET_LIBRARIES osgText - osgUtil osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Simulator utility library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgTerrain/CMakeLists.txt b/src/osgTerrain/CMakeLists.txt index a0f12ff4f..fe4e71dc9 100644 --- a/src/osgTerrain/CMakeLists.txt +++ b/src/osgTerrain/CMakeLists.txt @@ -35,11 +35,13 @@ SET(TARGET_SRC ) SET(TARGET_LIBRARIES - osgUtil osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Terrain library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgText/CMakeLists.txt b/src/osgText/CMakeLists.txt index a0f309733..d9987bfc0 100644 --- a/src/osgText/CMakeLists.txt +++ b/src/osgText/CMakeLists.txt @@ -42,10 +42,12 @@ SET(TARGET_SRC SET(TARGET_LIBRARIES osgDB - osg osgUtil + osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Text rendering library for OpenSceneGraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgUI/CMakeLists.txt b/src/osgUI/CMakeLists.txt index 95739fe6c..36cefa793 100644 --- a/src/osgUI/CMakeLists.txt +++ b/src/osgUI/CMakeLists.txt @@ -46,14 +46,16 @@ SET(TARGET_SRC ) SET(TARGET_LIBRARIES - osgDB - osgGA - osgUtil - osgText osgViewer + osgText + osgGA + osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Library for creating user interfaces in OpenSceneGraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgUtil/CMakeLists.txt b/src/osgUtil/CMakeLists.txt index 817422312..708aa0ece 100644 --- a/src/osgUtil/CMakeLists.txt +++ b/src/osgUtil/CMakeLists.txt @@ -101,5 +101,7 @@ SET(TARGET_LIBRARIES OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Utility library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgViewer/CMakeLists.txt b/src/osgViewer/CMakeLists.txt index fc6164faf..06db2e986 100644 --- a/src/osgViewer/CMakeLists.txt +++ b/src/osgViewer/CMakeLists.txt @@ -261,6 +261,8 @@ IF(MINGW OR CYGWIN) SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} gdi32 ) ENDIF() +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Windowing system setup, thread scene manager library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) # install these headers manually since setup_library and moduleinstall diff --git a/src/osgVolume/CMakeLists.txt b/src/osgVolume/CMakeLists.txt index 9cf1faf78..6b6b58206 100644 --- a/src/osgVolume/CMakeLists.txt +++ b/src/osgVolume/CMakeLists.txt @@ -42,13 +42,15 @@ SET(TARGET_SRC SET(TARGET_LIBRARIES - osgUtil - osgDB osgGA + osgDB + osgUtil osg OpenThreads ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Volume library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME}) diff --git a/src/osgWidget/CMakeLists.txt b/src/osgWidget/CMakeLists.txt index 32aee1b16..229ae94e1 100644 --- a/src/osgWidget/CMakeLists.txt +++ b/src/osgWidget/CMakeLists.txt @@ -66,13 +66,15 @@ SET(TARGET_SRC SET(TARGET_LIBRARIES - osgText osgViewer + osgGA + osgText osgDB osg OpenThreads - osgGA ) +SET(COMPONENT_PKGCONFIG_DESCRIPTION "Windowing toolkit library for Openscenegraph") + SETUP_LIBRARY(${LIB_NAME})