<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi<br>
</p>
<p>To enable iOS build, I'm using following settings in CMakeLists.txt:</p>
<p><br>
</p>
<div>set(APPLE_PLATFORM "iphonesimulator")</div>
<div>set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk")</div>
<div>set(CMAKE_C_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mios-version-min=7.0")</div>
<div>set(CMAKE_CXX_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mios-version-min=7.0")</div>
<div><br>
</div>
<div>Do you think it should be documented?</div>
<div><br>
</div>
<div>Where is the good place to do so?<br>
</div>
<div>Maybe somewhere here:<br>
</div>
<div><a href="https://cmake.org/cmake/help/v3.4/variable/CMAKE_OSX_SYSROOT.html">https://cmake.org/cmake/help/v3.4/variable/CMAKE_OSX_SYSROOT.html</a><br>
</div>
<p> <br>
</p>
<p>What do you think?<br>
</p>
<p><br>
</p>
<p><br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> clinton@elemtech.com <clinton@elemtech.com><br>
<b>Sent:</b> Friday, December 11, 2015 8:21 PM<br>
<b>To:</b> Bartosz Kosiorek<br>
<b>Cc:</b> Bartosz Kosiorek; cmake-developers; Gregor Jasny<br>
<b>Subject:</b> Re: [cmake-developers] Create subdirectories in Resource directory for Frameworks and Application bundle.</font>
<div> <br>
</div>
</div>
<div>
<div style="font-family:arial,helvetica,sans-serif; font-size:12pt; color:#000000">
<div><br>
</div>
<div><br>
</div>
<span id="zwchr">----- On Dec 11, 2015, at 11:44 AM, Bartosz Kosiorek <gang65@poczta.onet.pl> wrote:<br>
</span>
<div>
<blockquote style="border-left:2px solid #1010FF; margin-left:5px; padding-left:5px; color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>Hi<br>
<br>
</div>
Because there is difference between OS X and iOS Bundles directory structure (see: Apple specification<br>
<a href="https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html" target="_blank">https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html</a>),
<br>
in trunk (In CMake 3.5) RESOURCE property create corresponding directory structure.<br>
</div>
I have already fix that with:<br>
<a href="https://public.kitware.com/Bug/view.php?id=15848" target="_blank">https://public.kitware.com/Bug/view.php?id=15848</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>Ok. I hadn't been following all your work.</div>
<div>Also, I didn't see a toggle in the CMake code you sent to choose an iOS bundle instead of OS X bundles. How is that toggled?</div>
<div><br>
</div>
<blockquote style="border-left:2px solid #1010FF; margin-left:5px; padding-left:5px; color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>So RESOURCE gives you a level of abstraction:<br>
</div>
For OSX:<br>
</div>
it will create "Resource" directory<br>
<br>
</div>
For iOS it will create "flat" directory structure.<br>
<br>
</div>
In your example "Resource" directory will be created in both cases (for OSX and iOS).<br>
</div>
Which is wrong: <br>
For OSX: it should create "Resource" directory<br>
For iOS it will create "flat" directory structure.<br>
<br>
</div>
I could provide patch to fix that issue, if you agree with that.<br>
</div>
<div>What do you think about that?<br>
</div>
<div>Do you think the same should be applied to "Headers"?</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>
<div>I think the abstraction seems reasonable, as well as what you are proposing. However, I'm not an Apple guru.</div>
<div>I wonder if there are other Apple experts that can weigh in this if better feedback is needed.</div>
<div><br>
</div>
<div>Clint</div>
</div>
<blockquote style="border-left:2px solid #1010FF; margin-left:5px; padding-left:5px; color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div dir="ltr">
<div>
<div><br>
</div>
<br>
Best Regards<br>
</div>
Bartosz <br>
<div>
<div>
<div>
<div>
<div><br>
<div>
<div>
<div>
<div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-12-11 19:06 GMT+01:00 Clinton Stimpson <span dir="ltr">
<<a href="mailto:clinton@elemtech.com" target="_blank">clinton@elemtech.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div class="HOEnZb">
<div class="h5"><br>
<br>
On Friday, December 11, 2015 05:01:41 PM Bartosz Kosiorek wrote:<br>
> Thanks Clint<br>
><br>
> Unfortunately MACOSX_PACKAGE_LOCATION is not working correctly with RESOURCE<br>
> property. For every resource which is marked as RESOURCE, will be placed in<br>
> root "Resources" directory.<br>
><br>
> The CMake code below create following directory structure for OS X:<br>
><br>
> ── mul.framework<br>
> ├── Headers -> Versions/Current/Headers<br>
> ├── Resources -> Versions/Current/Resources<br>
> ├── Versions<br>
> │ ├── A<br>
> │ │ ├── Headers<br>
> │ │ │ └── mul.h<br>
> │ │ ├── Modules<br>
> │ │ │ └── module.modulemap<br>
> │ │ ├── Resources<br>
> │ │ │ ├── Info.plist<br>
> │ │ │ ├── mulres.txt<br>
> │ │ │ ├── pl.txt<br>
> │ │ │ └── resourcefile.txt<br>
> │ │ ├── lang<br>
> │ │ │ └── en.txt<br>
> │ │ └── mul<br>
> │ └── Current -> A<br>
> └── mul -> Versions/Current/mul<br>
><br>
><br>
> As you can see eveything which is marked as "RESOURCE" will be placed in<br>
> Versions/A/ directory My expectation will be that lang/pl.txt and<br>
> lang/en.txt should be in Resources/lang/ directory. Here is complete<br>
> directory structure:<br>
><br>
> ── mul.framework<br>
> ├── Headers -> Versions/Current/Headers<br>
> ├── Resources -> Versions/Current/Resources<br>
> ├── Versions<br>
> │ ├── A<br>
> │ │ ├── Headers<br>
> │ │ │ └── mul.h<br>
> │ │ ├── Modules<br>
> │ │ │ └── module.modulemap<br>
> │ │ ├── Resources<br>
> │ │ │ ├── Info.plist<br>
> │ │ │ ├── mulres.txt<br>
> │ │ │ ├── lang<br>
> │ │ │ │ └── pl.txt<br>
> │ │ │ │ └── en.txt<br>
> │ │ │ └── resourcefile.txt<br>
> │ │ ├── lang<br>
> │ │ │ └── en.txt<br>
> │ │ └── mul<br>
> │ └── Current -> A<br>
> └── mul -> Versions/Current/mul<br>
><br>
><br>
> What do you think about that?<br>
><br>
> Here is the source code:<br>
><br>
> set_property(SOURCE module.modulemap<br>
> PROPERTY MACOSX_PACKAGE_LOCATION "Modules")<br>
><br>
> set_property(<br>
> SOURCE lang/en.txt lang/pl.txt<br>
> PROPERTY MACOSX_PACKAGE_LOCATION "lang")<br>
><br>
> set(RESLIST<br>
> mulres.txt<br>
> lang/pl.txt<br>
> resourcefile.txt<br>
> )<br>
><br>
> add_library(mul SHARED<br>
> mul.c<br>
> mul.h<br>
> module.modulemap<br>
> lang/pl.txt<br>
> lang/en.txt<br>
> resourcefile.txt<br>
> mulres.txt)<br>
><br>
> # Create an iOS Framework bundle<br>
> set_target_properties(mul PROPERTIES<br>
> FRAMEWORK TRUE<br>
> MACOSX_FRAMEWORK_IDENTIFIER org.cmake.mul<br>
> MACOSX_FRAMEWORK_SHORT_VERSION_STRING 42<br>
> MACOSX_FRAMEWORK_BUNDLE_VERSION 3.2.10<br>
> XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"<br>
> PUBLIC_HEADER mul.h<br>
> RESOURCE "${RESLIST}"<br>
> )<br>
<br>
<br>
</div>
</div>
Here is a CMakeLists.txt that will give you the desired layout.<br>
I also see that MACOSX_PACKAGE_LOCATION doesn't work with RESOURCE.<br>
<span class=""><br>
<br>
set_property(SOURCE module.modulemap<br>
PROPERTY MACOSX_PACKAGE_LOCATION "Modules")<br>
<br>
set_property(<br>
</span> SOURCE lang/pl.txt lang/en.txt<br>
PROPERTY MACOSX_PACKAGE_LOCATION "Resources/lang")<br>
<br>
set(RESLIST<br>
mulres.txt<br>
<span class=""> resourcefile.txt<br>
)<br>
<br>
add_library(mul SHARED<br>
mul.c<br>
mul.h<br>
module.modulemap<br>
lang/pl.txt<br>
lang/en.txt<br>
resourcefile.txt<br>
mulres.txt)<br>
<br>
# Create an iOS Framework bundle<br>
set_target_properties(mul PROPERTIES<br>
FRAMEWORK TRUE<br>
MACOSX_FRAMEWORK_IDENTIFIER org.cmake.mul<br>
MACOSX_FRAMEWORK_SHORT_VERSION_STRING 42<br>
MACOSX_FRAMEWORK_BUNDLE_VERSION 3.2.10<br>
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"<br>
PUBLIC_HEADER mul.h<br>
RESOURCE "${RESLIST}"<br>
)<br>
<br>
<br>
</span>Now I'm wondering what does the RESOURCE target property do that<br>
MACOSX_PACKAGE_LOCATION doesn't already support?<br>
<div class="HOEnZb">
<div class="h5"><br>
Clint<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">
http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">
http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">
http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">
http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake-developers</a></div>
</div>
</blockquote>
</div>
</div>
<br>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>