From: Alan W. I. <ai...@us...> - 2006-07-25 03:36:51
|
Update of /cvsroot/plplot/plplot/cmake/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21310/cmake/modules Modified Files: drivers.cmake psttf.cmake Log Message: Improve the RPATH treatment. (*) CMake build-tree RPATH's will be fine automatically if library dependencies are found with find_library, but if PKGCONFIG is used, you have to process the result afterward with find_library to put it in the form (not the -L and -l form!) where CMake does proper interpretation of build-tree RPATHS. (*) The install-tree RPATH's have to be stated explicitly for every library. There is no inheritance from dependent libraries. Index: drivers.cmake =================================================================== RCS file: /cvsroot/plplot/plplot/cmake/modules/drivers.cmake,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- drivers.cmake 23 Jul 2006 22:16:19 -0000 1.11 +++ drivers.cmake 25 Jul 2006 03:36:49 -0000 1.12 @@ -44,7 +44,9 @@ endif(ENABLE_DYNDRIVERS AND NOT BUILD_SHARED_LIBS) if(ENABLE_DYNDRIVERS) find_package(LTDL) - if(NOT LTDL_FOUND) + if(LTDL_FOUND) + set(libplplot${LIB_TAG}_RPATH ${LTDL_LIBRARY_DIR}) + else(LTDL_FOUND) message(STATUS "WARNING: libltdl library not found. Setting ENABLE_DYNDRIVERS OFF.\n" " Please install that library and/or set the environment variables\n" @@ -52,7 +54,7 @@ ) set(ENABLE_DYNDRIVERS OFF CACHE BOOL "Enable dynamic loading of device drivers" FORCE) - endif(NOT LTDL_FOUND) + endif(LTDL_FOUND) endif(ENABLE_DYNDRIVERS) Index: psttf.cmake =================================================================== RCS file: /cvsroot/plplot/plplot/cmake/modules/psttf.cmake,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- psttf.cmake 23 Jul 2006 22:16:19 -0000 1.1 +++ psttf.cmake 25 Jul 2006 03:36:49 -0000 1.2 @@ -27,6 +27,8 @@ # device driver. # psttf_LINK_FLAGS - LINK_FLAGS (string) for dynamic psttf device driver. # psttf_RPATH - RPATH directory list for psttf device driver. +# psttf_TARGETS - Full Name of libLASi so that cmake can figure out +# RPATH stuff in the build tree. # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static device drivers. # # Include file searches use FindPath. To add extra search directories @@ -65,6 +67,16 @@ set(psttf_LINK_FLAGS "${linkflags} -lLASi") # Convert from blank-delimited to a cmake list string(REGEX REPLACE " +" ";" psttf_RPATH ${libdir}) + # Put libLASI pkg-config information into a form that + # target_link_libraries can interpret properly with respect to RPATH + # for the build tree. + find_library(psttf_TARGETS LASi ${psttf_RPATH}) + if(NOT psttf_TARGETS) + message(FATAL_ERROR + "libLASi not in location specified by pkg-config." + ) + endif(NOT psttf_TARGETS) + get_filename_component(psttf_RPATH ${psttf_TARGETS} PATH) else(linkflags AND cflags) message(STATUS "WARNING: pango, pangoft2, or lasi not found with pkg-config.\n" |