[CMake] not found library with package configuration files and changed CMAKE_INSTALL_PREFIX

Rolf Eike Beer eike at sf-mail.de
Mon Oct 10 06:48:49 EDT 2011


> Hei hei,
>
> On Wed, 21 Sep 2011 16:42:37 +0200, Alexander Dahl wrote:
>>> The foo-targets.cmake file contains "foo-shared" as imported target,
>>> and it is this name that must be supplied to TARGET_LINK_LIBRARIES().
>>> Besides, the DESTINATION clause of INSTALL() should be qualified with
>>> ARCHIVE/LIBRARY/RUNTIME/..., and EXPORT must precede DESTINATION then.
>>
>> Did that.
>
> And it only works in Linux (Ubuntu Lucid 10.04 native with CMake 2.8.5
> or cross compiling with ptxdist). On Windows XP with VS 2009 and CMake
> 2.8.5 the following happens:
>
> install(TARGETS ${PROJECT_NAME}-shared EXPORT ${PROJECT_NAME}-targets
> LIBRARY DESTINATION "lib")
> #install(TARGETS ${PROJECT_NAME}-shared EXPORT ${PROJECT_NAME}-targets
> DESTINATION "lib")
> install(EXPORT ${PROJECT_NAME}-targets DESTINATION
> "lib/cmake/${PROJECT_NAME}")
>
> With the first line used it gives the following error:
>
> CMake Error at src/CMakeLists.txt:19 (install):
>   install Library TARGETS given no DESTINATION!

Libraries on Windows behave differently because of the .lib/.dll split.
The details are in the install(TARGETS) documentation.

Greetings,

Eike


More information about the CMake mailing list