Show
Ignore:
Timestamp:
01/28/09 10:42:21 (5 years ago)
Author:
robert
Message:

From Mattias Helsing, "this is a semi-submission based on what you and others have been
talking about in the LIB_POSTFIX thread. It is a bit verbose perhaps
and the message I emit during the make install step flashes by and
gets burried under all "installing..." and/or "up-to-date..."
messages. I have posted on the cmake mail list on ways to do this
better.

The submission adds:
* message to user during configuration that s/he's eventually going o
install to ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}
* if system has /etc/ld.so.conf.d and it is a dir generates
packaging/ld.so.conf.d/openscenegraph.conf and creates a custom target
for installing it (target must be run explicitly of course). User is
notified of this during configuration (may not be necessary)
* emit a message during installation that libraries are put in
<same-as-above>. This message unfortunately gets emitted to soon for
the user to see it

* I added "COMPONENT libopenscenegraph-dev" to the pkgconfig.pc's
install command
* Moved the section with OSG_CONFIG_HAS_BEEN_RUN_BEFORE as close to
the end of CMakeLists.txt as I dared. This is the intent of this
construct I think."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/CMakeLists.txt

    r9558 r9566  
    737737ENDIF(BUILD_DASHBOARD_REPORTS) 
    738738 
    739 # This needs to be run very last so other parts of the scripts can take 
    740 # advantage of this. 
    741 IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) 
    742     SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before") 
    743 ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) 
    744  
    745739# present the packaging option only if we have the cpack command defined (effectively >= 2.6.0) 
    746740IF(CMAKE_CPACK_COMMAND) 
     
    758752    ) 
    759753 
    760 INSTALL(FILES ${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc DESTINATION lib${LIB_POSTFIX}/pkgconfig) 
     754INSTALL(FILES ${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc DESTINATION lib${LIB_POSTFIX}/pkgconfig COMPONENT libopenscenegraph-dev) 
     755 
     756# Run this as late as possible so users can easier spot the message 
     757IF(LIB_POSTFIX) 
     758    MESSAGE("You will be installing libraries to ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}\n" 
     759        "Your loader may not be able to find your installed libraries unless you:\n" 
     760        "  set your LD_LIBRARY_PATH (user specific)\n" 
     761        "  update your ld.so configuration (system wide)") 
     762    IF(IS_DIRECTORY /etc/ld.so.conf.d) 
     763        MESSAGE("You have an ld.so.conf.d directory on your system.\n" 
     764            "You can install a openscenegraph specific ld.so configuration with:\n" 
     765            "  sudo make install_ld_conf") 
     766        CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/ld.so.conf.d/openscenegraph.conf.in 
     767            ${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf 
     768        ) 
     769        ADD_CUSTOM_TARGET(install_ld_conf ${CMAKE_COMMAND} -E copy_if_different  
     770            ${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf 
     771            /etc/ld.so.conf.d/openscenegraph.conf 
     772            COMMAND ldconfig 
     773            COMMENT "Copying openscenegraph.conf to /etc/ld.so.conf.d and running ldconfig" 
     774        ) 
     775    ELSE(IS_DIRECTORY /etc/ld.so.conf.d) 
     776        IF(EXIST /etc/ld.so.conf) 
     777            MESSAGE("You have an ld.so.conf file in /etc\n" 
     778                "You may need to add ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX} to it.") 
     779        ENDIF(EXIST /etc/ld.so.conf) 
     780    ENDIF(IS_DIRECTORY /etc/ld.so.conf.d) 
     781 
     782    # emit a message during installation. 
     783    INSTALL(CODE "MESSAGE(\"Libraries were installed to ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}.\\nYou may need to update your ld.so configuration. \")") 
     784ENDIF(LIB_POSTFIX) 
     785 
     786 
     787# This needs to be run very last so other parts of the scripts can take 
     788# advantage of this. 
     789IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) 
     790    SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before") 
     791ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) 
    761792 
    762793#-----------------------------------------------------------------------------