[CMake] .so link and cpack
Gonzalo Garramuño
ggarra13 at gmail.com
Sat Apr 8 13:28:19 EDT 2017
Currently, I have a project where I build a library and an executable
that depends on the library. Finally, I package a .deb package with cpack.
Now, my problem is that cpack packs the symbolic link of my library and
that creates problems with the deb installer ( dpkg -i ) whenever I try
to install the same version of my program twice. The error I get is that
the symbolic link changed value from 20 to 42 (or something like that).
I tried removing the symbolic link previous to packaging, but then I get
cpack erroring out with:
CMake Error at
/media/gga/Datos/code/applications/mrViewer/BUILD/Linux-3.13.0-108-generic-64/Release/tmp/libACESclip/cmake_install.cmake:47
(file):
file INSTALL cannot find
"/media/gga/Datos/code/applications/mrViewer/BUILD/Linux-3.13.0-108-generic-64/Release/lib/libACESclip.so".
Following a post on stackoverflow, I also tried using NAMELINK_SKIP on
the library, like:
set_target_properties( ACESclip
PROPERTIES
SOVERSION ${SOVERSION})
install( TARGETS ACESclip
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
NAMELINK_SKIP )
But then the executable:
ADD_EXECUTABLE( mrViewer WIN32 ${SOURCES} )
TARGET_LINK_LIBRARIES( mrViewer ${LIBRARIES} ACESclip )
would not find my library and would error out.
Therefore, I turn to the list for help. How do I prevent cpack from
packaging symbolic links (a feature which is kind of wrong at least for
.deb files)? Or how do I make my executable use the library without
symlinks?
Thanks in advance.
More information about the CMake
mailing list