Re: [CMake] install name for fortran dylibs on mac

2014-05-03 Thread clinton
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

Re: [CMake] install name for fortran dylibs on mac

2014-05-03 Thread clinton
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

Re: [CMake] install name for fortran dylibs on mac

2014-05-03 Thread Dan Kegel
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

Re: [CMake] install name for fortran dylibs on mac

2014-05-03 Thread Izaak Beekman
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

Re: [CMake] install name for fortran dylibs on mac

2014-05-03 Thread Dan Kegel
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

Re: [CMake] install name for fortran dylibs on mac

2014-05-03 Thread clinton
- 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

Re: [CMake] install name for fortran dylibs on mac

2014-05-02 Thread Zaak Beekman
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

[CMake] install name for fortran dylibs on mac

2014-05-02 Thread Izaak Beekman
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