When using the iOS.cmake toolchain (located here https://code.google.com/p/ios-cmake/) my build folders are changed from Debug
and Release
to Debug-iphoneos
and Release-iphoneos
.
This isn't an issue except when I try running the code below:
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin COMPONENT development
ARCHIVE DESTINATION lib COMPONENT development
LIBRARY DESTINATION ${MYPROJECT_LIB_SUBDIR} COMPONENT development NAMELINK_SKIP)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin COMPONENT runtime
ARCHIVE DESTINATION lib COMPONENT source
LIBRARY DESTINATION ${MYPROJECT_LIB_SUBDIR} COMPONENT source NAMELINK_SKIP)
This code gives me the following errors:
-- Install configuration: "Release"
-- Install component: "development"
CMake Error at cmake_install.cmake:54 (FILE):
file INSTALL cannot find
"/Users/username/Documents/Projects/MyFramework/src/ios-build/MyProject/Release/libMyProject.a".
-- Install configuration: "Debug"
-- Install component: "development"
CMake Error at cmake_install.cmake:48 (FILE):
file INSTALL cannot find
"/Users/username/Documents/Projects/MyFramework/src/ios-build/MyProject/Debug/libMyProjectd.a".
For some reason the install(targets ...)
function is looking for folders named Debug
and Release
instead of Debug-iphoneos
and Release-iphoneos
.
So I either need to make sure that install(targets ...)
is looking in the correct folders for the archive or I need to prevent iOS.cmake from renaming the Debug and Release folders. Can anyone suggest anything for this?
Edit
Looks like this is an issue with CMake as identified here: http://public.kitware.com/Bug/view.php?id=9117
I tried updating to the latest version of CMake to see if this had been fixed and I'm still getting the same error. I see a patch attached to the bug report but I'm not sure how to apply it or what I can do to fix this issue.
Found a more specific report of this issue here: http://public.kitware.com/Bug/view.php?id=12506
There are a couple of workarounds on that site. However I used the code snippet below instead to create the Release and Debug folders in the same directory without appending the EFFECTIVE_PLATFORM_NAME to them.
if(${IOS})
set_target_properties(${PROJECT_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
endif(${IOS})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With