I'm building OpenJPEG which uses cmake. It builds both a library and
binary. The binaries are linked to the library it builds. Both are
installed to a directory outside the normal ld search path so, rather
than setting LD_LIBRARY_PATH, I'd like to embed the installation library
into the RPATH of the installed binaries. I can do this with:
  cmake --debug-output --debug-trycompile . \
  -DCMAKE_LIBRARY_RPATH="[install dir]/lib"
  -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_EXAMPLES:BOOL=OFF \
  -DCMAKE_INSTALL_PREFIX:PATH=[install dir] \
  -DLIBDIR="[install dir]/lib/"

At install time, the binary is relinked, giving:
  cd /opt/build/OpenJPEG_v1_3/mj2 && /usr/bin/gcc  -Wall -std=c99 -O2
  -fPIC "CMakeFiles/wrap_j2k_in_mj2.dir/wrap_j2k_in_mj2.o"
  "CMakeFiles/wrap_j2k_in_mj2.dir/mj2.o"   -o
  CMakeFiles/CMakeRelink.dir/wrap_j2k_in_mj2 -rdynamic
  -L/opt/build/OpenJPEG_v1_3/bin -lopenjpeg -lm
  -Wl,-rpath,/opt/TWWfsw/libopenjpeg13/lib 

How do I replace -L/opt/build/OpenJPEG_v1_3/bin with
-L/opt/TWWfsw/libopenjpeg13/lib? This is necessary on HP-UX to record
the correct library path in the binary.

-- 
albert chin ([email protected])
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to