Re: [cmake-developers] [PATCH] iOS Framework Bundle support

2015-11-16 Thread Ruslan Baratov via cmake-developers

On 13-Nov-15 20:59, Bartosz Kosiorek wrote:

Hello.

Main reason for using Makefile instead of Xcode is performance reason. Xcode 
generator is much slower that Makefile in our project.
The performance was improved in Cmake 3.2 but still it is much slower on Xcode. 
Similar slowness could be observed on Windows with Visual Studio generator (for 
our project).
Do you know what caused performance improve in Cmake 3.2 ?
I'm not sure, but I think this is because there are a lot of tests on 
generation step and each test creates .xcodeproj (.vcproj for Visual 
Studio) and build it. Which is much slower than creating and running 
Makefile.



We are using Makefile builds for automatic tests on farm of devices/simulators.
We strongly believe that Xcode generation should only be used for IDE context 
and not for Continuous Integration/cmd usage.
In my opinion type of CI build should match working environment exactly. 
Otherwise you can break something in Xcode and no error will be reported 
by CI since Makefile used on auto-build machine.
Makefile and Xcode project generated by CMake may not match in general, 
for example if there is no special unification code then warning flags 
will be different. Also all XCODE_ATTRIBUTES_* simply ignored for 
Makefile and no equivalent flags added. From my experience `xcodebuild` 
and `cmake --build` work quite fine with Xcode projects so see no 
problems with using cmd.


Ruslan


In cmd/CI case you want to use generators like make, ninja, fastbuild, etc.

What is your opinion about that?

Best Regards
Bartosz


-Original Message-
From: Gregor Jasny [mailto:gja...@gmail.com]
Sent: Friday, November 13, 2015 2:09 PM
To: Bartosz Kosiorek; cmake-developers@cmake.org
Subject: Re: [cmake-developers] [PATCH] iOS Framework Bundle support

On 11/11/15 02:19, Bartosz Kosiorek wrote:

Hi

Generally I created this cmake scripts to to able to test creating iOS/OSX 
Application Bundle and iOS/OSX Dynamic Framework Bundle.
By default it produces iOS application Bundle and iOS Framework Bundle.

Steps to reproduce:
1. Download and install CMake 3.4.0
2. Unpack and unpack cmake_shared_ios_framework.zip 3. cd
cmake_shared_ios_framework 4. mkdir build 5. cd build 6.
../../../cmake-3.4.0-rc3-Darwin-x86_64/CMake.app/Contents/bin/cmake ..
7. make

I wonder why anyone wants to build for iOS without the Xcode generator?


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] [PATCH] iOS Framework Bundle support

2015-11-13 Thread Bartosz Kosiorek
Hello.

Main reason for using Makefile instead of Xcode is performance reason. Xcode 
generator is much slower that Makefile in our project. 
The performance was improved in Cmake 3.2 but still it is much slower on Xcode. 
Similar slowness could be observed on Windows with Visual Studio generator (for 
our project).
Do you know what caused performance improve in Cmake 3.2 ?

We are using Makefile builds for automatic tests on farm of devices/simulators.
We strongly believe that Xcode generation should only be used for IDE context 
and not for Continuous Integration/cmd usage.
In cmd/CI case you want to use generators like make, ninja, fastbuild, etc.

What is your opinion about that?

Best Regards
Bartosz


-Original Message-
From: Gregor Jasny [mailto:gja...@gmail.com] 
Sent: Friday, November 13, 2015 2:09 PM
To: Bartosz Kosiorek; cmake-developers@cmake.org
Subject: Re: [cmake-developers] [PATCH] iOS Framework Bundle support

On 11/11/15 02:19, Bartosz Kosiorek wrote:
> Hi
> 
> Generally I created this cmake scripts to to able to test creating iOS/OSX 
> Application Bundle and iOS/OSX Dynamic Framework Bundle.
> By default it produces iOS application Bundle and iOS Framework Bundle.
> 
> Steps to reproduce:
> 1. Download and install CMake 3.4.0
> 2. Unpack and unpack cmake_shared_ios_framework.zip 3. cd 
> cmake_shared_ios_framework 4. mkdir build 5. cd build 6. 
> ../../../cmake-3.4.0-rc3-Darwin-x86_64/CMake.app/Contents/bin/cmake ..
> 7. make

I wonder why anyone wants to build for iOS without the Xcode generator?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] [PATCH] iOS Framework Bundle support

2015-11-13 Thread Gregor Jasny
On 12/11/15 09:25, Bartosz Kosiorek wrote:
> With this tiny little patch, the correct directory structure for iOS 
> Frameworks is created.

I made the patch even smaller and pushed it into the
non-xcode-framework-layout topic branch. There I also added a test.

Thanks,
Gregor
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] [PATCH] iOS Framework Bundle support

2015-11-13 Thread Gregor Jasny
On 11/11/15 02:19, Bartosz Kosiorek wrote:
> Hi 
> 
> Generally I created this cmake scripts to to able to test creating iOS/OSX 
> Application Bundle and iOS/OSX Dynamic Framework Bundle.
> By default it produces iOS application Bundle and iOS Framework Bundle.
> 
> Steps to reproduce:
> 1. Download and install CMake 3.4.0
> 2. Unpack and unpack cmake_shared_ios_framework.zip
> 3. cd cmake_shared_ios_framework
> 4. mkdir build
> 5. cd build
> 6. ../../../cmake-3.4.0-rc3-Darwin-x86_64/CMake.app/Contents/bin/cmake ..
> 7. make

I wonder why anyone wants to build for iOS without the Xcode generator?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] [PATCH] iOS Framework Bundle support

2015-11-12 Thread Bartosz Kosiorek
Hello.

With this tiny little patch, the correct directory structure for iOS Frameworks 
is created.

The changes are backward compatible (it is not touching OS X at all, only iOS 
Frameworks).
The risk of regression is very low, as the change is for iOS frameworks, and 
officially CMake 3.4 do not support iOS.

I tested it manually by using scripts from previous mail for Xcode and Makefile 
generators, under iOS 9, and it fix directory structure.
After apply this patch, iOS Frameworks created by CMake are working perfectly 
for me.

Best Regards
Bartosz


From: cmake-developers <cmake-developers-boun...@cmake.org> on behalf of 
Bartosz Kosiorek <bartosz.kosio...@tomtom.com>
Sent: Wednesday, November 11, 2015 2:19 AM
To: Gregor Jasny; cmake-developers@cmake.org
Subject: Re: [cmake-developers] [PATCH] iOS Framework Bundle support

Hi

Generally I created this cmake scripts to to able to test creating iOS/OSX 
Application Bundle and iOS/OSX Dynamic Framework Bundle.
By default it produces iOS application Bundle and iOS Framework Bundle.

Steps to reproduce:
1. Download and install CMake 3.4.0
2. Unpack and unpack cmake_shared_ios_framework.zip
3. cd cmake_shared_ios_framework
4. mkdir build
5. cd build
6. ../../../cmake-3.4.0-rc3-Darwin-x86_64/CMake.app/Contents/bin/cmake ..
7. make

Expected result:
- Correct iOS Application Bundle in directory: addDemoCmake.app
- Correct iOS Dynamic Framework Bundle in directory: 
shared_empty/mul/mul.framework/

Current result:
- Correct iOS Application Bundle in directory: addDemoCmake.app
- Incorrect iOS Dynamic Framework Bundle in directory: 
shared_empty/mul/mul.framework/
It looks like:

find mul.framework/
mul.framework/
mul.framework//Headers
mul.framework//Headers/mul.h
mul.framework//Modules
mul.framework//Modules/module.modulemap
mul.framework//mul
mul.framework//Resources
mul.framework//Resources/Info.plist
mul.framework//Versions
mul.framework//Versions/Current

What it wrong in with that Framework :
1. Xcode expect that iOS Framework have Info.plist in main Framework directory 
(mul.framework/Info.plist).
2. mul.framework//Versions/ and mul.framework//Resources is not needed and 
shouldn't be produced (Info.plist should be moved to root Framework directory)
3. mul.framework//Versions/Current symlink is pointing to not existing "A" 
version directory

Now I see that my patch should be simplified to few lines. I will provide fix 
later.
My previous wrong assumption was that CMake 3.4 do not change anything in 
creating iOS Bundles.

@Gregor Do you think it will be possible to fix that issue in CMake 3.4.0, to 
have full support for iOS (both from Application and Frameworks) ?

Best Regards
Bartosz

From: Gregor Jasny <gja...@googlemail.com>
Sent: Tuesday, November 10, 2015 9:54 PM
To: Bartosz Kosiorek; cmake-developers@cmake.org
Subject: Re: [cmake-developers] [PATCH] iOS Framework Bundle support

Hello,

On 10/11/15 16:22, Bartosz Kosiorek wrote:
> My name is Bartosz Kosiorek and I'm TomTom developer and Open Source 
> enthusiast.

I'm Gregor a part time contributor to CMake. During the last months I
mostly worked on Xcode support.

> Last time in our products, we notice that cmake is not creating correct iOS 
> Frameworks Bundle.
> For iOS Frameworks, not versioned Bundle is needed, eg.:
>
>   iOSFramework.framework/
>   iOSFramework
>   Info.plist
>   Headers
>
>
>
> Unfortunately with current version of CMake (3.4.0), it produces OS X 
> Framework Bundle, with versions inside, eg.:
>
>   MyFramework.framework/
> MyFramework -> Versions/Current/MyFramework
> Resources -> Versions/Current/Resources
> Versions/
> A/
> MyFramework
> Headers
> Resources/
>  Info.plist
> Current -> A
>
>
>
> You could test it with my example project in attachment 
> (cmake_shared_ios_framework.zip).

Unfortunately I cannot reproduce the problem. Could you please write
down the exact steps you took to compile the example in the zip file?
Please also Xcode and cmake version.

That's what I see (cmake master, Xcode generator and Xcode 7.1):

$ find _build/shared_empty/mul/Debug-iphonesimulator/mul.framework
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Headers
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Headers/mul.h
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Info.plist
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Modules
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Modules/module.modulemap
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/mul

> The iOS Application Bundle was already fixed in CMake 3.4.0. Unfortunately 
>

Re: [cmake-developers] [PATCH] iOS Framework Bundle support

2015-11-10 Thread Gregor Jasny via cmake-developers
Hello,

On 10/11/15 16:22, Bartosz Kosiorek wrote:
> My name is Bartosz Kosiorek and I'm TomTom developer and Open Source 
> enthusiast.

I'm Gregor a part time contributor to CMake. During the last months I
mostly worked on Xcode support.

> Last time in our products, we notice that cmake is not creating correct iOS 
> Frameworks Bundle.
> For iOS Frameworks, not versioned Bundle is needed, eg.:
> 
>   iOSFramework.framework/
>   iOSFramework
>   Info.plist
>   Headers
> 
> 
> 
> Unfortunately with current version of CMake (3.4.0), it produces OS X 
> Framework Bundle, with versions inside, eg.:
> 
>   MyFramework.framework/
> MyFramework -> Versions/Current/MyFramework
> Resources -> Versions/Current/Resources
> Versions/
> A/
> MyFramework
> Headers
> Resources/
>  Info.plist
> Current -> A
> 
> 
> 
> You could test it with my example project in attachment 
> (cmake_shared_ios_framework.zip).

Unfortunately I cannot reproduce the problem. Could you please write
down the exact steps you took to compile the example in the zip file?
Please also Xcode and cmake version.

That's what I see (cmake master, Xcode generator and Xcode 7.1):

$ find _build/shared_empty/mul/Debug-iphonesimulator/mul.framework
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Headers
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Headers/mul.h
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Info.plist
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Modules
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Modules/module.modulemap
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/mul

> The iOS Application Bundle was already fixed in CMake 3.4.0. Unfortunately 
> still iOS Frameworks are not produced correctly (Xcode refuses to sign such 
> Frameworks if you would like to push it into iOS device).
> 
> In attachment I added solution to produce correct iOS Framework (for OSX 
> Frameworks will be produced normally).
> 
> 
> 
> Could you please give some comment about that?
> 
> Do you think architecture of that solution is correct?

I'd go for an early return from cmOSXBundleGenerator::CreateFramework if
we're building for iOS. The code of CreateIOSFramework is just too similar.

> I would like to do next:
> 
> - Refactor code, to have more explicitly names (OSX, iOS or Apple)
> 
> - Update documentation
> 
> - add some unit tests for creating iOS Frameworks

I would like to see a test for that topic. If you'd like to try please
have a look at:
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=744e6c497c01cb3a3129ca66d1cabfa83e17dbd4
https://cmake.org/gitweb?p=cmake.git;a=tree;f=Tests/RunCMake/XcodeProject;hb=HEAD
https://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/RunCMake/README.rst;hb=HEAD

You need to build cmake via the Xcode generator and run the tests.
During development you can filter just for the XcodeProject tests:

bin/Debug/ctest -R RunCMake.XcodeProject --verbose

Thanks,
Gregor
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] [PATCH] iOS Framework Bundle support

2015-11-10 Thread Bartosz Kosiorek
Hi 

Generally I created this cmake scripts to to able to test creating iOS/OSX 
Application Bundle and iOS/OSX Dynamic Framework Bundle.
By default it produces iOS application Bundle and iOS Framework Bundle.

Steps to reproduce:
1. Download and install CMake 3.4.0
2. Unpack and unpack cmake_shared_ios_framework.zip
3. cd cmake_shared_ios_framework
4. mkdir build
5. cd build
6. ../../../cmake-3.4.0-rc3-Darwin-x86_64/CMake.app/Contents/bin/cmake ..
7. make

Expected result:
- Correct iOS Application Bundle in directory: addDemoCmake.app
- Correct iOS Dynamic Framework Bundle in directory: 
shared_empty/mul/mul.framework/

Current result:
- Correct iOS Application Bundle in directory: addDemoCmake.app
- Incorrect iOS Dynamic Framework Bundle in directory: 
shared_empty/mul/mul.framework/
It looks like:

find mul.framework/
mul.framework/
mul.framework//Headers
mul.framework//Headers/mul.h
mul.framework//Modules
mul.framework//Modules/module.modulemap
mul.framework//mul
mul.framework//Resources
mul.framework//Resources/Info.plist
mul.framework//Versions
mul.framework//Versions/Current

What it wrong in with that Framework :
1. Xcode expect that iOS Framework have Info.plist in main Framework directory 
(mul.framework/Info.plist). 
2. mul.framework//Versions/ and mul.framework//Resources is not needed and 
shouldn't be produced (Info.plist should be moved to root Framework directory)
3. mul.framework//Versions/Current symlink is pointing to not existing "A" 
version directory

Now I see that my patch should be simplified to few lines. I will provide fix 
later.
My previous wrong assumption was that CMake 3.4 do not change anything in 
creating iOS Bundles.

@Gregor Do you think it will be possible to fix that issue in CMake 3.4.0, to 
have full support for iOS (both from Application and Frameworks) ?
 
Best Regards
Bartosz

From: Gregor Jasny <gja...@googlemail.com>
Sent: Tuesday, November 10, 2015 9:54 PM
To: Bartosz Kosiorek; cmake-developers@cmake.org
Subject: Re: [cmake-developers] [PATCH] iOS Framework Bundle support

Hello,

On 10/11/15 16:22, Bartosz Kosiorek wrote:
> My name is Bartosz Kosiorek and I'm TomTom developer and Open Source 
> enthusiast.

I'm Gregor a part time contributor to CMake. During the last months I
mostly worked on Xcode support.

> Last time in our products, we notice that cmake is not creating correct iOS 
> Frameworks Bundle.
> For iOS Frameworks, not versioned Bundle is needed, eg.:
>
>   iOSFramework.framework/
>   iOSFramework
>   Info.plist
>   Headers
>
>
>
> Unfortunately with current version of CMake (3.4.0), it produces OS X 
> Framework Bundle, with versions inside, eg.:
>
>   MyFramework.framework/
> MyFramework -> Versions/Current/MyFramework
> Resources -> Versions/Current/Resources
> Versions/
> A/
> MyFramework
> Headers
> Resources/
>  Info.plist
> Current -> A
>
>
>
> You could test it with my example project in attachment 
> (cmake_shared_ios_framework.zip).

Unfortunately I cannot reproduce the problem. Could you please write
down the exact steps you took to compile the example in the zip file?
Please also Xcode and cmake version.

That's what I see (cmake master, Xcode generator and Xcode 7.1):

$ find _build/shared_empty/mul/Debug-iphonesimulator/mul.framework
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Headers
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Headers/mul.h
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Info.plist
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Modules
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/Modules/module.modulemap
_build/shared_empty/mul/Debug-iphonesimulator/mul.framework/mul

> The iOS Application Bundle was already fixed in CMake 3.4.0. Unfortunately 
> still iOS Frameworks are not produced correctly (Xcode refuses to sign such 
> Frameworks if you would like to push it into iOS device).
>
> In attachment I added solution to produce correct iOS Framework (for OSX 
> Frameworks will be produced normally).
>
>
>
> Could you please give some comment about that?
>
> Do you think architecture of that solution is correct?

I'd go for an early return from cmOSXBundleGenerator::CreateFramework if
we're building for iOS. The code of CreateIOSFramework is just too similar.

> I would like to do next:
>
> - Refactor code, to have more explicitly names (OSX, iOS or Apple)
>
> - Update documentation
>
> - add some unit tests for creating iOS Frameworks

I would like to see a test for that topic. If you'd like to try please
have a look at:
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=744e6c49