From: <ai...@us...> - 2013-12-11 09:01:38
|
Revision: 12848 http://sourceforge.net/p/plplot/code/12848 Author: airwin Date: 2013-12-11 09:01:35 +0000 (Wed, 11 Dec 2013) Log Message: ----------- Improve filter_rpath function by taking advantage of the well-documented and maintained CMAKE_C_IMPLICIT_LINK_DIRECTORIES, CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES, and CMAKE_FORTRAN_IMPLICIT_LINK_DIRECTORIES variables to clean rpath information of standard directory locations instead of using the undocumented/poorly maintained internal variable CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES for the same task. The new set of variables is only available after C, CXX, and FORTRAN have been enabled so move include of shapelib module (which uses filter_rpath) to after when all the languages are defined. This fix sorted out an issue with the rpath used for qt_example which was being contaminated by a system location and thus giving the wrong location when a non-standard Qt location is used. Modified Paths: -------------- trunk/cmake/modules/plplot.cmake trunk/cmake/modules/plplot_functions.cmake Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2013-12-11 08:37:43 UTC (rev 12847) +++ trunk/cmake/modules/plplot.cmake 2013-12-11 09:01:35 UTC (rev 12848) @@ -444,9 +444,6 @@ message(STATUS "X11_COMPILE_FLAGS = ${X11_COMPILE_FLAGS}") message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}") -# Support for shapelib library for reading shapefile map data -include(shapelib) - option(DEFAULT_NO_BINDINGS "All language bindings are disabled by default" OFF @@ -512,6 +509,8 @@ # ======================================================================= # additional library support # ======================================================================= +# Support for shapelib library for reading shapefile map data +include(shapelib) include(freetype) # On windows systems the math library is not separated so do not specify # it unless you are on a non-windows system. Modified: trunk/cmake/modules/plplot_functions.cmake =================================================================== --- trunk/cmake/modules/plplot_functions.cmake 2013-12-11 08:37:43 UTC (rev 12847) +++ trunk/cmake/modules/plplot_functions.cmake 2013-12-11 09:01:35 UTC (rev 12848) @@ -186,16 +186,31 @@ list(REMOVE_DUPLICATES CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) -# Filter all CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES list elements from -# rpath_in list. +# Filter all CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES list elements from +# rpath_in list. Note, this uses variables that are only defined after +# languages have been enabled but according to the documentation the +# logic is only invoked when the function is invoked so this should be +# OK _if care is used that this function is invoked only after the +# languages have been enabled_. C is enabled immediately so that will +# serve most purposes, but CXX and Fortran are enabled later so if +# you want those special system locations removed (unlikely but +# possible) then you are going to have to be somewhat more careful +# when this function is invoked. + function(filter_rpath rpath) #message("DEBUG: ${rpath} = ${${rpath}}") set(internal_rpath ${${rpath}}) if(internal_rpath) list(REMOVE_DUPLICATES internal_rpath) - if(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) - list(REMOVE_ITEM internal_rpath ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}) - endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + set(directories_to_be_removed + ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES} + ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES} + ${CMAKE_FORTRAN_IMPLICIT_LINK_DIRECTORIES} + ) + list(REMOVE_DUPLICATES directories_to_be_removed) + if(directories_to_be_removed) + list(REMOVE_ITEM internal_rpath ${directories_to_be_removed}) + endif(directories_to_be_removed) endif(internal_rpath) #message("DEBUG: (filtered) ${rpath} = ${internal_rpath}") set(${rpath} ${internal_rpath} PARENT_SCOPE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |