View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006813CMakeCMakepublic2008-04-15 22:292008-04-21 19:28
ReporterSurya Kiran 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0006813: Install command not honoring Configurations option.
DescriptionHello all,
I'm building a library in debug and in release modes. I want the built library to go at different locations for each configuration. So I've done something like this.

===============================
set (mytarget "mylib")
Add_Library (${mytarget} ${mysrcs})

Set_Target_Properties (${mytarget} PROPERTIES DEBUG_POSTFIX d)

INSTALL (
TARGETS ${mytarget}
RUNTIME DESTINATION bin_debug
LIBRARY DESTINATION lib_debug
CONFIGURATIONS Debug
)

INSTALL (
TARGETS ${mytarget}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
CONFIGURATIONS Release
)
==================================

Both the debug and release libraries are built properly. But the problem is the library is getting installed to both the directories for both the configurations.

That means the ${CMAKE_INSTALL_DIR}/bin contains mylibd.dll and mylib.dll and same is the case for ${CMAKE_INSTALL_DIR}/bin_debug.

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0011381)
Surya Kiran (reporter)
2008-04-15 22:35

I've tested this on Windows Xp with cmake-2.4 and cmake-2.6 with Visual Studio 2005 solution file generator
(0011470)
Brad King (manager)
2008-04-21 19:28

The install command signature is:

         install(TARGETS targets... [EXPORT <export-name>]
                 [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
                   PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
                  [DESTINATION <dir>]
                  [PERMISSIONS permissions...]
                  [CONFIGURATIONS [Debug|Release|...]]
                  [COMPONENT <component>]
                  [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
                 ] [...])

Note that the CONFIGURATIONS option is one of the things that is switched by the RUNTIME, LIBRARY, and ARCHIVE options. Therefore your example says "install the runtime (.dll) part for all configurations and the library (.so on unix) only in this configuration". You are not actually installing the import library (.lib) part.

Your install command should be

INSTALL (
TARGETS ${mytarget}
CONFIGURATIONS Debug
RUNTIME DESTINATION bin_debug
LIBRARY DESTINATION lib_debug
ARCHIVE DESTINATION lib_debug
)

INSTALL (
TARGETS ${mytarget}
CONFIGURATIONS Release
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

 Issue History
Date Modified Username Field Change
2008-04-15 22:29 Surya Kiran New Issue
2008-04-15 22:35 Surya Kiran Note Added: 0011381
2008-04-21 18:16 Bill Hoffman Status new => assigned
2008-04-21 18:16 Bill Hoffman Assigned To => Brad King
2008-04-21 19:28 Brad King Status assigned => closed
2008-04-21 19:28 Brad King Note Added: 0011470
2008-04-21 19:28 Brad King Resolution open => no change required


Copyright © 2000 - 2018 MantisBT Team