tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: use exec (with shared libs) from build dir ?



On Sun, Jun 26, 2016 at 03:06:14PM +0200, Manuel Bouyer wrote:
> hello,
> geography/qgis fails to build because (after fixing python dependancy issue)
> it wants to use a dynamically-linked executable from the build dir (and
> the shared library is not yet installed):
> 
> Scanning dependencies of target synccrsdb
> Shared object "libqgis_core.so.2.14.3" not found
> src/crssync/CMakeFiles/synccrsdb.dir/build.make:57: recipe for target 'src/crssync/CMakeFiles/synccrsdb' failed
> 
> src/crssync/CMakeFiles/synccrsdb.dir/build.make:57 is:
> cd /local/armandeche1/tmp/pkgbuild/geography/qgis/work/qgis-2.14.3/build
> /src/crssync && ../../output/bin/crssync
> 
> libqgis_core.so.2.14.3 is in build/output/lib
> 
> Any idea how to fix this (use LD_LIBRARY_PATH for the build) ?
> any package I could use as example ?
> 
> Adding the build dir to rpath is probably not right because this executable
> will be installed, it's not only a build tool.

The attached patch allows the build to progress past this failure.
Does anyone see a different way to fix this ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
$NetBSD: $
Fix executing dynamically-linked executable from the build directory

--- src/crssync/CMakeLists.txt.orig	2016-06-26 16:02:58.000000000 +0200
+++ src/crssync/CMakeLists.txt	2016-06-26 16:04:09.000000000 +0200
@@ -22,7 +22,7 @@
 	)
 ELSE(MSVC AND NOT USING_NMAKE)
 	ADD_CUSTOM_TARGET(synccrsdb
-		COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/crssync
+		COMMAND env LD_LIBRARY_PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../lib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/crssync
 		DEPENDS crssync
 	)
 ENDIF(MSVC AND NOT USING_NMAKE)


Home | Main Index | Thread Index | Old Index