MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014444 | CMake | (No Category) | public | 2013-09-26 18:14 | 2016-06-10 14:31 |
Reporter | Blaise Gassend | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | feature | Reproducibility | have not tried |
Status | closed | Resolution | moved | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0014444: Allow installing targets from multiple directories in one command | ||||
Description | If you try to INSTALL TARGET a target that was defined in a different directory, CMake fails with an error. This is behaviour is really annoying. We are trying to install only libraries that get used by executables that need to be installed. However, if the library and executable are defined in different directories, this bug prevents you from INSTALLing the library at the place where you know you need to install it. Using INSTALL FILES partially works, but causes stripping and rpath changing to break, as CMake no longer recognizes the library as a library. If this behaviour is a feature, it would be really nice to have documentation of why it is a feature. (I can't seem to be able to define targets with the same name in different directories, so why on earth would INSTALL TARGETS be the only command that only considers | ||||
Steps To Reproduce | I'll attach a tarball for a directory that reproduces this. To reproduce: cd cmake_deb_test mkdir build cd build cmake .. [ret=2] blaise@bnl: /st/stor1/blaise/work/cmake_deb_test/build $ cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/lib/ccache/gcc -- Check for working C compiler: /usr/lib/ccache/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done m-- Check for working CXX compiler: /usr/lib/ccache/c++ ak-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works -- Detecting CXX compiler ABI info e -- Detecting CXX compiler ABI info - done CMake Error at CMakeLists.txt:10 (install): install TARGETS given target "mylib2" which does not exist in this directory. -- Configuring incomplete, errors occurred! | ||||
Additional Information | The following patch fixes the problem. I don't understand the cmake philosophy enough to know if it hopelessly breaks something else though. Description: INSTALL TARGETS will find non-local targets . cmake (2.8.7-0ubuntu5) precise-proposed; urgency=low . * Fix corrupted tarballs when using DEB generator in CPack. (LP: #972419) Author: David Dunsmore <david.dunsmore@sbl-dd-laptop1.seebyte.com> Bug-Ubuntu: https://bugs.launchpad.net/bugs/972419 [^] --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ [^] to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: <vendor|upstream|other>, <url of original patch> Bug: <url in upstream bugtracker> Bug-Debian: http://bugs.debian.org/<bugnumber> [^] Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> [^] Forwarded: <no|not-needed|url proving that it has been forwarded> Reviewed-By: <name and email of someone who approved the patch> Last-Update: <YYYY-MM-DD> --- cmake-2.8.7.orig/Source/cmInstallCommand.cxx +++ cmake-2.8.7/Source/cmInstallCommand.cxx @@ -350,8 +350,8 @@ bool cmInstallCommand::HandleTargetsMode targetIt!=targetList.GetVector().end(); ++targetIt) { - // Lookup this target in the current directory. - if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str())) + // Lookup this target + if(cmTarget* target=this->Makefile->FindTargetToUse(targetIt->c_str())) { // Found the target. Check its type. if(target->GetType() != cmTarget::EXECUTABLE && @@ -373,7 +373,7 @@ bool cmInstallCommand::HandleTargetsMode // Did not find the target. cmOStringStream e; e << "TARGETS given target \"" << (*targetIt) - << "\" which does not exist in this directory."; + << "\" which does not exist."; this->SetError(e.str().c_str()); return false; } | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | cmake_deb_test.tgz (594) 2013-09-26 18:14 https://public.kitware.com/Bug/file/4889/cmake_deb_test.tgz | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-09-26 18:14 | Blaise Gassend | New Issue | |||
2013-09-26 18:14 | Blaise Gassend | File Added: cmake_deb_test.tgz | |||
2013-09-27 08:17 | Brad King | Note Added: 0033904 | |||
2013-09-27 08:24 | Brad King | Note Added: 0033905 | |||
2013-09-27 08:34 | Brad King | Note Added: 0033906 | |||
2013-09-27 08:34 | Brad King | Severity | minor => feature | ||
2013-09-27 08:34 | Brad King | Status | new => backlog | ||
2013-09-27 08:34 | Brad King | Summary | INSTALL TARGET command does not work with targets outside the current directory => Allow installing targets from multiple directories in one command | ||
2013-09-27 17:24 | Blaise Gassend | Note Added: 0033920 | |||
2013-09-30 08:23 | Brad King | Note Added: 0033930 | |||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042378 | |||
2016-06-10 14:29 | Kitware Robot | Status | backlog => resolved | ||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|