From: <ai...@us...> - 2011-11-24 06:27:37
|
Revision: 12033 http://plplot.svn.sourceforge.net/plplot/?rev=12033&view=rev Author: airwin Date: 2011-11-24 06:27:31 +0000 (Thu, 24 Nov 2011) Log Message: ----------- Implement NON_TRANSITIVE option for just the C++ bindings case. The result (for cmake option -DNON_TRANSITIVE=ON) is the C++ examples build and run without issues for the build tree, traditional installed examples tree (built and tested with Makefile+pkg-config), and installed examples tree (built and tested with CMake-based build system). Modified Paths: -------------- trunk/bindings/c++/CMakeLists.txt trunk/cmake/modules/plplot.cmake trunk/pkgcfg/plplot-template.pc.cmake Modified: trunk/bindings/c++/CMakeLists.txt =================================================================== --- trunk/bindings/c++/CMakeLists.txt 2011-11-18 07:41:00 UTC (rev 12032) +++ trunk/bindings/c++/CMakeLists.txt 2011-11-24 06:27:31 UTC (rev 12033) @@ -44,6 +44,13 @@ endif(BUILD_SHARED_LIBS) target_link_libraries(plplotcxx${LIB_TAG} plplot${LIB_TAG}) + if(NON_TRANSITIVE) + # empty list ==> non-transitive linking for shared libraries for + # everything (e.g., the C++ examples) that links to libplplotcxx. + target_link_libraries(plplotcxx${LIB_TAG} LINK_INTERFACE_LIBRARIES) + # This configures the pkg-config method of having non-transitive linking. + set(PC_REQUIRES_TAG "Requires.private") + endif(NON_TRANSITIVE) if(USE_RPATH) get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2011-11-18 07:41:00 UTC (rev 12032) +++ trunk/cmake/modules/plplot.cmake 2011-11-24 06:27:31 UTC (rev 12033) @@ -22,6 +22,13 @@ # libraries are all shared by default option(BUILD_SHARED_LIBS "Build shared libraries" ON) +# OFF means libraries are transitively linked by default. +option(NON_TRANSITIVE "Experimental option to try non-transitive linking" OFF) +# For now use this default which causes transitive linking of software built +# with our pkg-config files (unless PC_REQUIRES_TAG specifically overridden +# for particular language bindings with Requires.private). +set(PC_REQUIRES_TAG "Requires") + # Color maps (discrete and continuous) to use by default if(NOT DEFAULT_CMAP0_FILE) set(DEFAULT_CMAP0_FILE "cmap0_default.pal") Modified: trunk/pkgcfg/plplot-template.pc.cmake =================================================================== --- trunk/pkgcfg/plplot-template.pc.cmake 2011-11-18 07:41:00 UTC (rev 12032) +++ trunk/pkgcfg/plplot-template.pc.cmake 2011-11-24 06:27:31 UTC (rev 12033) @@ -4,7 +4,7 @@ Name: PLplot @PC_SHORT_NAME@ Description: Scientific plotting library (@PC_LONG_NAME@@PC_PRECISION@ precision) -Requires: @PC_REQUIRES@ +@PC_REQUIRES_TAG@: @PC_REQUIRES@ Version: @VERSION@ Libs: -L${libdir} @PC_LINK_FLAGS@ Cflags: -I${includedir} @PC_COMPILE_FLAGS@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |