View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014819CMakeCMakepublic2014-03-20 04:442014-11-03 08:38
ReporterRichard Ulrich 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionCMake 2.8.12.2 
Target VersionFixed in Version 
Summary0014819: excluding ARCHIVE part of library target from install
DescriptionWhen building shared libraries on windows, I can specify the install location for the dll and lib file like this:

INSTALL(TARGETS MyLib
    RUNTIME DESTINATION bin # -> dll
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION lib # -> lib
    COMPONENT base
)

Now I should exclude the lib files from the generated installer.
As long as we used an external installer builder that I invoked with ADD_CUSTOM_TARGET(), I just executed an ADD_CUSTOM_COMMAND() just before, that deleted the lib files from the install directory.

But now that we use cpack to generate the installer, there is no suc interception point anymore.
So the next thing I tried was what I found in http://stackoverflow.com/questions/8636479/postpone-making-custom-target-until-install [^] :
INSTALL(CODE "EXECUTE_PROCESS(
    COMMAND del /F /Q ${TEMP2_CMAKE_INSTALL_PREFIX}\\\\bin\\\\*.lib
)")
But that doesn't work, as it is executed too early.

I also searched if there are cpack options to exclude certain files, but the only thing I found were filters for source files, but nothing for target files.

Anyway, I think the option to exclude the import libraries from target installs should exist without such hacks.

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0035447)
Richard Ulrich (reporter)
2014-03-20 05:16

It appears that if I set the archive destination to an empty string, the lib files are not installed. Now the question that remains is if this is the intended behavior, and should be documented, or it's just coincidence.

INSTALL(TARGETS MyLib
    RUNTIME DESTINATION bin # -> dll
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION "" # -> lib
    COMPONENT base
)
(0035448)
Brad King (manager)
2014-03-20 08:30

Just leave "ARCHIVE DESTINATION" out completely:

  install(TARGETS MyLib
    RUNTIME DESTINATION bin # -> dll
    LIBRARY DESTINATION lib # -> so
    COMPONENT base
    )
(0035905)
Richard Ulrich (reporter)
2014-05-22 04:00

Thanks for clarifying.
You can close the issue.
(0037139)
Robert Maynard (manager)
2014-11-03 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-03-20 04:44 Richard Ulrich New Issue
2014-03-20 05:16 Richard Ulrich Note Added: 0035447
2014-03-20 08:30 Brad King Note Added: 0035448
2014-05-22 04:00 Richard Ulrich Note Added: 0035905
2014-05-22 08:49 Brad King Status new => resolved
2014-05-22 08:49 Brad King Resolution open => no change required
2014-11-03 08:38 Robert Maynard Note Added: 0037139
2014-11-03 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team