[CMake] install target and DEBUGRT_POSTFIX

Philip Lowman philip at yhbt.com
Tue Mar 3 01:19:48 EST 2009


On Fri, Feb 27, 2009 at 9:32 AM, daniel trindade <danielrtrindade1 at gmail.com
> wrote:

> Hi,
>
> I'm having problems with the install(TARGETS ... command. In my project i
> set the property DEBUGRT_POSTFIX "_d" on each target so the files ends with
> "_d". This works fine, but when the command
>
>         INSTALL(TARGETS mytarget
>                 RUNTIME DESTINATION lib
>                 LIBRARY DESTINATION lib
>                 ARCHIVE DESTINATION lib)
>
> is executed, it searchs for the files without "_d".
>
> How can i make it find the correct files?


This works fine for me on CMake 2.6.3.  Can you post some more details about
your problem.  What version of CMake you're running, the OS you're running,
the generator you're using, provide an example, etc.?  Also, try the
following and see if it works on your system.

project(Foo)
cmake_minimum_required(VERSION 2.6)
add_executable(foo foo.cc)
set_target_properties(foo PROPERTIES DEBUG_POSTFIX "_d")
install(TARGETS foo RUNTIME DESTINATION lib)

lowman at locke:~/tmp/cmake_tests/Debug_Install/build$ cmake
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/tmp/crap ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/lowman/tmp/cmake_tests/Debug_Install/build
lowman at locke:~/tmp/cmake_tests/Debug_Install/build$ make install
Scanning dependencies of target foo
[100%] Building CXX object CMakeFiles/foo.dir/foo.cc.o
Linking CXX executable foo_d
[100%] Built target foo
Install the project...
-- Install configuration: "Debug"
-- Installing: /tmp/crap/lib/foo_d


-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090303/07cc1ccc/attachment.htm>


More information about the CMake mailing list