[CMake] install targets
Matt Fair
matt.fair at gmail.com
Tue Oct 25 04:30:38 EDT 2011
Ok, sorry for the duplication, it was also discussed in:
http://www.cmake.org/pipermail/cmake/2011-March/043467.html
I changed everything from SUBDIRS to add_subdirectory and it worked.
For my tests dir, I specified a second build dir, and everything then
installed from those dirs.
Matt
On Tue, Oct 25, 2011 at 12:56 AM, Matt Fair <matt.fair at gmail.com> wrote:
> I have split my code up into two dirs, "source" and "tests". The
> CMakeLists.txt in the source dir does a SUBDIRS to
> ${PROJECT_SOURCE_DIR}/../tests to get tests.
>
> In each CMakeLists file right after I have defined the target via
> ADD_LIBRARY or ADD_EXECUTABLE and set TARGET_LINK_LIBRARIES I have
> done the following:
>
> binaries
> INSTALL(TARGETS myBinary RUNTIME DESTINATION bin)
>
> libs
> INSTALL(TARGETS myLib ARCHIVE DESTINATION lib)
>
> shared libs
> INSTALL(TARGETS mySharedLib LIBRARY DESTINATION lib)
>
> The problem is that all INSTALL targets that I have specified under
> the tests dir are not installed. Am I doing something wrong? The
> problem seems to be with my SUBDIRS and INSTALL. How can I fix this?
>
> Thanks,
> Matt
>
More information about the CMake
mailing list