I've attached a sample project which includes 2 external projects, where the
executable links with the library from its build tree.
After it is built, you can run it from the build tree
./app-prefix/src/app-build/app
Clint
- Original Message -
> When using @rpath, the proper way to
When using @rpath, the proper way to the executable to find it at runtime is
for the executable to have an rpath with a directory that contains the dylib.
When compiling the executable, the linker flag "-rpath /path/to/dylib" should
be given. This should be automatic with CMake when building th
Have you tried just using INSTALL_NAME_DIR, e.g.
cmake_minimum_required(VERSION 2.8)
set(MYLIBDIR "${CMAKE_SOURCE_DIR}/lib")
add_library(foo SHARED foo.c)
set_target_properties(
foo
PROPERTIES
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
)
add_executable(x x.c)
target_link_libraries(x
So I noticed the CMAKE_MACOSX_RPATH variable, and tried setting it, which
does result in the install name of the dylib being set to
@rpath/dylibname.so BUT when I link it in an executable tool -L just shows
the dylib as @rpath/dylibname.so and the linker fails to find it at run
time. What is the pr
On Sat, May 3, 2014 at 7:17 AM, wrote:
> Use at least CMake 2.8.12 and in your library project add this:
> set(CMAKE_MACOSX_RPATH 1)
> ...
> For more details:
> http://www.kitware.com/blog/home/post/510
What he said. See also past discussion at
http://web.archiveorange.com/archive/v/5y7PkspCBZw
- Original Message -
> Hi,
> After much head scratching and googling, I found a way to get the dynamic
> library built in a project of mine to have the correct install name, so long
> as `DESTDIR=/some/path` is NOT specified upon install. Basically I want to
> export the library from both
I one more quick point: I don't want to install the libraries to standard
locations because there may be multiple Fortran compilers installed on a
given system, and client code cannot be built and linked using a different
compiler than the library. Therefore the library and mod files and CMake
pack
Hi,
After much head scratching and googling, I found a way to get the dynamic
library built in a project of mine to have the correct install name, so
long as `DESTDIR=/some/path` is NOT specified upon install. Basically I
want to export the library from both the build tree and the install tree so
t