MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0012506 | CMake | CMake | public | 2011-10-09 18:01 | 2016-02-01 09:10 |
|
Reporter | Geoff Beier | |
Assigned To | Gregor Jasny | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | Apple Mac | OS | OS X | OS Version | 10.7.1 |
Product Version | CMake 2.8.6 | |
Target Version | | Fixed in Version | CMake 3.4 | |
|
Summary | 0012506: install( TARGET ) does not work for iOS targets |
Description | As of CMake 2.8.6, build products are generated into Release-iphoneos, Debug-iphoneos, etc. When using install(TARGET ...) cmake_install.cmake contains blocks that test for
"${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$"
and the like, then attempt to find the files in
cmake-build/Release$(EFFECTIVE_PLATFORM_NAME)...
There is no way (with 2.8.6) to have the test for CMAKE_INSTALL_CONFIG_NAME match and have the source path be correct. Whether or not CMAKE_XCODE_EFFECTIVE_PLATFORMS is set, build products land in directories containing the platform name. If CMAKE_XCODE_EFFECTIVE_PLATFORMS is set, the CMAKE_INSTALL_CONFIG_NAME test never matches, and the file copy is never attempted.
This is mostly a problem when building iOS libraries, but can be easily reproduced using the iOSNavApp from the Tests shipped with cmake 2.8.6. |
Steps To Reproduce | 1. Append the line
INSTALL( TARGETS NavApp3 BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT Runtime )
to Tests/iOSNavApp/CMakeLists.txt
2. Generate xcode build files using
cmake -G Xcode -DCMAKE_INSTALL_PREFIX=/Users/Shared/ios-staging ..
3. xcodebuild -target install -configuration Release
Expected Result: NavApp3.app copied to ${CMAKE_INSTALL_PREFIX}
Actual Result: No copy occurs |
Additional Information | The main reason we want to get the install feature working is so that we can install development libraries. This was working in 2.8.4, but I think that was just luck because we weren't setting CMAKE_XCODE_EFFECTIVE_PLATFORMS and cmake wasn't automatically putting the build products into a "-iphoneos" location.
I've attached the modified CMakeLists.txt for iOSNavApp that demonstrates this issue. |
Tags | No tags attached. |
Relationships | |
Attached Files | CMakeLists.txt (1,387) 2011-10-09 18:01 https://public.kitware.com/Bug/file/4072/CMakeLists.txt |
|
Issue History |
Date Modified | Username | Field | Change |
2011-10-09 18:01 | Geoff Beier | New Issue | |
2011-10-09 18:01 | Geoff Beier | File Added: CMakeLists.txt | |
2011-10-11 13:04 | David Cole | Assigned To | => David Cole |
2011-10-11 13:04 | David Cole | Status | new => assigned |
2011-12-21 18:35 | AndrewF | Note Added: 0028031 | |
2012-01-07 09:59 | David Cole | Target Version | => CMake 2.8.8 |
2012-04-19 08:48 | David Cole | Target Version | CMake 2.8.8 => CMake 2.8.9 |
2012-07-09 07:13 | David Cole | Note Added: 0029991 | |
2012-07-09 07:20 | David Cole | Target Version | CMake 2.8.9 => |
2012-11-21 14:57 | David Cole | Note Added: 0031659 | |
2012-11-21 14:59 | David Cole | Assigned To | David Cole => |
2012-11-21 15:11 | David Cole | Status | assigned => new |
2012-11-21 15:11 | David Cole | Note Added: 0031668 | |
2013-07-25 09:51 | Clodéric Mars | Note Added: 0033609 | |
2014-01-22 05:18 | Ruslan Baratov | Note Added: 0034985 | |
2014-01-23 09:24 | Ruslan Baratov | Note Added: 0034991 | |
2015-05-07 10:22 | bagage | Note Added: 0038727 | |
2015-05-07 10:43 | bagage | Note Edited: 0038727 | bug_revision_view_page.php?bugnote_id=38727#r1777 |
2015-08-07 04:26 | Gregor Jasny | Note Added: 0039249 | |
2015-08-26 15:56 | Gregor Jasny | Note Added: 0039332 | |
2015-08-26 15:56 | Gregor Jasny | Assigned To | => Gregor Jasny |
2015-08-26 15:56 | Gregor Jasny | Status | new => assigned |
2015-09-14 16:40 | Gregor Jasny | Status | assigned => resolved |
2015-09-14 16:40 | Gregor Jasny | Fixed in Version | => CMake 3.4 |
2015-09-14 16:40 | Gregor Jasny | Resolution | open => fixed |
2016-02-01 09:10 | Robert Maynard | Note Added: 0040404 | |
2016-02-01 09:10 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0028031)
|
AndrewF
|
2011-12-21 18:35
|
|
We just ran across this same bug. It took me some time to figure out what was happening, since everything worked fine in cmake 2.8.4 as indicated. Huge thanks for this bug report. Hope it is fixed in the next release.
I put together a simple hack-ish way to get the target installed until this is fixed. Nothing very clever, but it gets the job done. It uses the environment variables xcode defines to locate the correct target location.
Example code is below:
if (IOS)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}\$ENV{EFFECTIVE_PLATFORM_NAME}/mytargetfilename DESTINATION mydestination)
endif (IOS) |
|
|
(0029991)
|
David Cole
|
2012-07-09 07:13
|
|
Unset target version field; too late for a fix to go into 2.8.9; deferred until a future version. |
|
|
(0031659)
|
David Cole
|
2012-11-21 14:57
|
|
Un-assigning bugs that are not on the active roadmap, which no developers are actively working on for the CMake 2.8.11 release.
If one gets put back on the roadmap, re-assign it appropriately at that time.
|
|
|
(0031668)
|
David Cole
|
2012-11-21 15:11
|
|
Re-setting status back to "new" for bugs that are "assigned" but not assigned to a specific developer. When/if these bugs go back on the roadmap for a specific version, assignment to an appropriate developer should take place then... |
|
|
(0033609)
|
Clodéric Mars
|
2013-07-25 09:51
|
|
As of CMake 2.8.11, the bug is still here and it is still a pain.
I've found another workaround for the issue which, contrary to the first one still rely on the INSTALL(TARGET).
It is this call 'cmake -DBUILD_TYPE=Debug-iphoneos -P cmake_install.cmake' (or 'cmake -DBUILD_TYPE=Debug-iphonesimulator -P cmake_install.cmake') that fails to install the target, for a very simple reason the target that is asked to be installed doesn't know 'Debug-iphoneos' as a configuration.
Hence my workaround is the following, e.g. for **Debug**:
1. Build the install target as before, everything gets installed fine except the build artifacts;
2. Execute, in your cmake binary dir, 'cmake -DBUILD_TYPE=Debug -P cmake_install.cmake', your build artifacts should be install fine;
3. **Unless** if you didn't change their output directory, which, for Xcode uses '$(EFFECTIVE_PLATFORM_NAME)' which can't be set from the command line in the previous call.
Would be easier with a bug fix :) |
|
|
(0034985)
|
Ruslan Baratov
|
2014-01-22 05:18
|
|
|
|
(0034991)
|
Ruslan Baratov
|
2014-01-23 09:24
|
|
|
|
(0038727)
|
bagage
|
2015-05-07 10:22
(edited on: 2015-05-07 10:43) |
|
This issue is still open, what can I do to close/solve it?
|
|
|
(0039249)
|
Gregor Jasny
|
2015-08-07 04:26
|
|
I looked into this some months ago. Will try to put my stashs and notes here. |
|
|
(0039332)
|
Gregor Jasny
|
2015-08-26 15:56
|
|
|
|
(0040404)
|
Robert Maynard
|
2016-02-01 09:10
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|