<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 12-Dec-15 10:08, Bartosz Kosiorek
wrote:<br>
</div>
<blockquote cite="mid:1449889708273.6810@tomtom.com" type="cite">
<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>
<p>Thanks Ruslan.<br>
</p>
<p><br>
</p>
<p>I would like to create instruction which is universal for all
generators.<br>
</p>
</blockquote>
I think it's not possible. E.g. IOS_INSTALL_COMBINED will work only
for Xcode.<br>
<br>
<blockquote cite="mid:1449889708273.6810@tomtom.com" type="cite">
<p>
</p>
<p>Currently we would like to support both Make/Ninja and Xcode
generators,</p>
</blockquote>
...<br>
<br>
<blockquote cite="mid:1449889708273.6810@tomtom.com" type="cite">
<p>because Make is much faster than Xcode generator, and we are
using it in our CI system.</p>
</blockquote>
Do you mean generate step or build? I've used to compile quite big
projects like OpenCV with Xcode and according to the `top` it uses
all my cores with clang++ at 100% CPU time.<br>
Can you show any benchmarks? Also note that Xcode can add some
additional stuff, like dSYM:
<a class="moz-txt-link-freetext" href="https://github.com/headupinclouds/gatherer/pull/69">https://github.com/headupinclouds/gatherer/pull/69</a><br>
<br>
<blockquote cite="mid:1449889708273.6810@tomtom.com" type="cite">
<p> Make is also common for other architectures (Linux, QNX,
Android etc.)<br>
</p>
<p><br>
</p>
<p>Unfortunately<br>
</p>
<p><span class="pl-c1" style="color: rgb(33, 33, 33); font-family:
Calibri, Arial, Helvetica, sans-serif; font-size: 16px;
background-color: rgb(255, 255, 255);"> set</span><span
style="color: rgb(33, 33, 33); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 16px; background-color:
rgb(255, 255, 255);">(CMAKE_OSX_SYSROOT </span><span
class="pl-s" style="color: rgb(33, 33, 33); font-family:
Calibri, Arial, Helvetica, sans-serif; font-size: 16px;
background-color: rgb(255, 255, 255);">"iphoneos"</span><span
style="color: rgb(33, 33, 33); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 16px; background-color:
rgb(255, 255, 255);">)</span><br>
</p>
<p>is not working for me.<br>
</p>
<p>It displays error:<br>
</p>
<p><br>
</p>
<div> /Users/warsaw/Perforce/cmake-dev/cmake-build/bin/cmake ..
&&
/Users/warsaw/Perforce/cmake-dev/cmake-build/bin/cmake --build .</div>
<div> -- Configuring done</div>
<div> -- Generating done</div>
<div> -- Build files have been written to:
/Users/warsaw/Perforce/cmake_ios_framework_with_resource2/builddir</div>
<div> [ 14%] Building C object
shared_empty/heymath/CMakeFiles/heymath.dir/add.c.o</div>
<div> clang: warning: no such sysroot directory: 'iphoneos'</div>
<div>...</div>
<div>Do you have some tip for that?<br>
</div>
</blockquote>
Yes, this hint was for Xcode generator.<br>
<br>
<blockquote cite="mid:1449889708273.6810@tomtom.com" type="cite">
<div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>After removing "-isysroot ${CMAKE_OSX_SYSROOT}" everything
works perfectly. Thanks<br>
</div>
<div><br>
</div>
<div>Unfortunately CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET
is not working with Make.<br>
</div>
<div>Is it possible to introduce CMAKE_IOS_DEPLOYMENT_TARGET, as
we already have CMAKE_OSX_DEPLOYMENT_TARGET?<br>
</div>
</blockquote>
Since OSX_ARCHITECTURES controls iOS architectures too I think
request should sounds like "Extend OSX_DEPLOYMENT_TARGET property
for iOS platform".<br>
<br>
<blockquote cite="mid:1449889708273.6810@tomtom.com" type="cite">
<div>
</div>
<div><br>
I have attached my example script which I'm using.</div>
<div>Could you please modify it to be better (and still support
other generators)?</div>
</blockquote>
I don't know how to use iOS target with Makefile generator.<br>
<br>
Some notes about project you've sent:<br>
* You need to add instructions to codesign your bundle<br>
* Instead of hardcoding `set(CMAKE_OSX_SYSROOT
"/Applications/Xcode.app/.../iPhoneSimulator.sdk")` you can run
`xcode-select -print-path` to detect location of default Xcode
version<br>
* Should be `set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
-mios-version-min=8.0")` instead of `set(CMAKE_CXX_FLAGS
"-mios-version-min=8.0")` otherwise some flags may be lost<br>
<br>
Ruslan<br>
<blockquote cite="mid:1449889708273.6810@tomtom.com" type="cite">
<div><br>
</div>
<div>Best Regards</div>
<div>Bartosz <br>
</div>
<div><br>
</div>
<div><br>
<br>
</div>
<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 style="font-size:11pt"
color="#000000" face="Calibri, sans-serif"><b>From:</b>
Ruslan Baratov <a class="moz-txt-link-rfc2396E" href="mailto:ruslan_baratov@yahoo.com"><ruslan_baratov@yahoo.com></a><br>
<b>Sent:</b> Saturday, December 12, 2015 1:58 AM<br>
<b>To:</b> Bartosz Kosiorek<br>
<b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>; Gregor Jasny; CMake
Developers<br>
<b>Subject:</b> Re: [cmake-developers] Create subdirectories
in Resource directory for Frameworks and Application bundle.</font>
<div> </div>
</div>
<div>
<div class="moz-cite-prefix">On 12-Dec-15 03:46, Bartosz
Kosiorek wrote:<br>
</div>
<blockquote type="cite">
<style type="text/css" style="">
<!--
p
{margin-top:0px;
margin-bottom:0px}
-->
</style>
<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>
</blockquote>
I think this one not needed. Can't find any place where it
parsed.<br>
<br>
<blockquote type="cite">
<div>set(CMAKE_OSX_SYSROOT
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk")</div>
</blockquote>
<span class="pl-c1">Can be set to:<br>
</span>
<blockquote><span class="pl-c1">set</span>(CMAKE_OSX_SYSROOT <span
class="pl-s">"iphoneos"</span>)<br>
</blockquote>
in this case will support both simulator and device<br>
<br>
<blockquote type="cite">
<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>
</blockquote>
You can set minimum version by <span style="color: rgb(33,
33, 33); font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 16px; background-color: rgb(255, 255, 255);">
CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET</span><span
style="color: rgb(33, 33, 33); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 16px; background-color:
rgb(255, 255, 255);"> </span>variable.<br>
In case of `CMAKE_OSX_SYSROOT` variable is set to `iphoneos`
option `-isysroot` is redundant.<br>
<br>
<blockquote type="cite">
<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 moz-do-not-send="true"
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
style="font-size:11pt" color="#000000" face="Calibri,
sans-serif"><b>From:</b>
<a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>
<a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:clinton@elemtech.com"><clinton@elemtech.com></a><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 <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:gang65@poczta.onet.pl">
<gang65@poczta.onet.pl></a> 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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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
moz-do-not-send="true"
href="http://www.cmake.org/Wiki/CMake_FAQ"
rel="noreferrer" target="_blank">
<a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a></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
moz-do-not-send="true"
href="http://cmake.org/cmake/help/support.html"
rel="noreferrer" target="_blank">
<a class="moz-txt-link-freetext" href="http://cmake.org/cmake/help/support.html">http://cmake.org/cmake/help/support.html</a></a><br>
CMake Consulting: <a
moz-do-not-send="true"
href="http://cmake.org/cmake/help/consulting.html"
rel="noreferrer" target="_blank">
<a class="moz-txt-link-freetext" href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/consulting.html</a></a><br>
CMake Training Courses: <a
moz-do-not-send="true"
href="http://cmake.org/cmake/help/training.html"
rel="noreferrer" target="_blank">
</a><a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://cmake.org/cmake/help/training.html">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects
at <a moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
rel="noreferrer" target="_blank">
</a><a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to
subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>