Recommandation for macOS framework install rules

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Recommandation for macOS framework install rules

Lucas Soltic
Hello,

By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/local by default) as a base for relative install paths. But when you define install rules for macOS frameworks, it doesn't make much sense to install them there. I'd rather expect something like /Library/Frameworks.

On the other side, if you have more things to install like a "readme" or documentation that should go into /usr/local/share, it doesn't make sense to have them installed in /Library/Frameworks. So you can't just change CMAKE_INSTALL_PREFIX to be /Library/Frameworks.

What do you recommend to keep installation rules simple (ie. remain relative) and yet support installation of both frameworks and other things?

Best regards,
Lucas
--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Recommandation for macOS framework install rules

J Decker
It's not entirely related other than Mac....

I had to test

if( __COMPILER_GNU AND NOT CMAKE_COMPILER_IS_GNUCC )

instead of just CMAKE_COMPILER_IS_GNUCC (which was unset)

__COMPILER_GNU was found after doing a dump...

I suppose there's some modern way I'm supposed to test GCC that works on all systems?


On Wed, Jan 17, 2018 at 2:49 PM, Lucas Soltic <[hidden email]> wrote:
Hello,

By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/local by default) as a base for relative install paths. But when you define install rules for macOS frameworks, it doesn't make much sense to install them there. I'd rather expect something like /Library/Frameworks.

On the other side, if you have more things to install like a "readme" or documentation that should go into /usr/local/share, it doesn't make sense to have them installed in /Library/Frameworks. So you can't just change CMAKE_INSTALL_PREFIX to be /Library/Frameworks.

What do you recommend to keep installation rules simple (ie. remain relative) and yet support installation of both frameworks and other things?

Best regards,
Lucas
--

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:
https://cmake.org/mailman/listinfo/cmake


--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Recommandation for macOS framework install rules

Robert Maynard
Are you just checking if the compiler is GCC? if so I would use
COMPILER_ID https://cmake.org/cmake/help/v3.8/variable/CMAKE_LANG_COMPILER_ID.html

On Wed, Jan 17, 2018 at 6:19 PM, J Decker <[hidden email]> wrote:

> It's not entirely related other than Mac....
>
> I had to test
>
> if( __COMPILER_GNU AND NOT CMAKE_COMPILER_IS_GNUCC )
>
> instead of just CMAKE_COMPILER_IS_GNUCC (which was unset)
>
> __COMPILER_GNU was found after doing a dump...
>
> I suppose there's some modern way I'm supposed to test GCC that works on all
> systems?
>
>
> On Wed, Jan 17, 2018 at 2:49 PM, Lucas Soltic <[hidden email]>
> wrote:
>>
>> Hello,
>>
>> By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/local
>> by default) as a base for relative install paths. But when you define
>> install rules for macOS frameworks, it doesn't make much sense to install
>> them there. I'd rather expect something like /Library/Frameworks.
>>
>> On the other side, if you have more things to install like a "readme" or
>> documentation that should go into /usr/local/share, it doesn't make sense to
>> have them installed in /Library/Frameworks. So you can't just change
>> CMAKE_INSTALL_PREFIX to be /Library/Frameworks.
>>
>> What do you recommend to keep installation rules simple (ie. remain
>> relative) and yet support installation of both frameworks and other things?
>>
>> Best regards,
>> Lucas
>> --
>>
>> 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:
>> https://cmake.org/mailman/listinfo/cmake
>
>
>
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake
>
--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Recommandation for macOS framework install rules

Lucas Soltic
In reply to this post by Lucas Soltic
Hello,
Should I conclude that there are no recommendations?

Best regards,
Lucas

> Le 17 janv. 2018 à 23:49, Lucas Soltic <[hidden email]> a écrit :
>
> Hello,
>
> By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/local by default) as a base for relative install paths. But when you define install rules for macOS frameworks, it doesn't make much sense to install them there. I'd rather expect something like /Library/Frameworks.
>
> On the other side, if you have more things to install like a "readme" or documentation that should go into /usr/local/share, it doesn't make sense to have them installed in /Library/Frameworks. So you can't just change CMAKE_INSTALL_PREFIX to be /Library/Frameworks.
>
> What do you recommend to keep installation rules simple (ie. remain relative) and yet support installation of both frameworks and other things?
>
> Best regards,
> Lucas
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Recommandation for macOS framework install rules

Sean McBride
On macOS, the most usual thing is for your code to be self-contained in your .app bundle.  Perhaps if you described more what kind of thing you are building and why you don't want to do the usual thing, people will have more advice...


On Fri, 19 Jan 2018 19:44:03 +0100, Lucas Soltic said:

>Hello,
>Should I conclude that there are no recommendations?
>
>Best regards,
>Lucas
>
>> Le 17 janv. 2018 à 23:49, Lucas Soltic <[hidden email]> a écrit :
>>
>> Hello,
>>
>> By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/
>local by default) as a base for relative install paths. But when you
>define install rules for macOS frameworks, it doesn't make much sense to
>install them there. I'd rather expect something like /Library/Frameworks.
>>
>> On the other side, if you have more things to install like a "readme"
>or documentation that should go into /usr/local/share, it doesn't make
>sense to have them installed in /Library/Frameworks. So you can't just
>change CMAKE_INSTALL_PREFIX to be /Library/Frameworks.
>>
>> What do you recommend to keep installation rules simple (ie. remain
>relative) and yet support installation of both frameworks and other things?


--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Recommandation for macOS framework install rules

Lucas Soltic
In reply to this post by Lucas Soltic


Le 19 janv. 2018 à 20:01, J Decker <[hidden email]> a écrit :



On Fri, Jan 19, 2018 at 10:44 AM, Lucas Soltic <[hidden email]> wrote:
Hello,
Should I conclude that there are no recommendations?

I would think if there were platform exceptions they would be modifications to this... 


Thanks for your time :) I didn’t find anything related to frameworks there. But I don’t expect GNU-related page to contain anything specific to macOS. Nice documentation website though, didn’t know about it.

I also did a grep in CMake modules but didn’t find anything close to a framework install prefix.

Best regards,
Lucas

> Le 17 janv. 2018 à 23:49, Lucas Soltic <[hidden email]> a écrit :
>
> Hello,
>
> By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/local by default) as a base for relative install paths. But when you define install rules for macOS frameworks, it doesn't make much sense to install them there. I'd rather expect something like /Library/Frameworks.
>
> On the other side, if you have more things to install like a "readme" or documentation that should go into /usr/local/share, it doesn't make sense to have them installed in /Library/Frameworks. So you can't just change CMAKE_INSTALL_PREFIX to be /Library/Frameworks.
>
> What do you recommend to keep installation rules simple (ie. remain relative) and yet support installation of both frameworks and other things?
>
> Best regards,
> Lucas
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake

--

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:
https://cmake.org/mailman/listinfo/cmake


--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Recommandation for macOS framework install rules

Lucas Soltic
In reply to this post by Sean McBride
Hello,

The product is a cross-platform API that relies on CMake for the config part. We ship static and dynamic libraries for Linux, Windows and macOS. Additionally on macOS we want to provide frameworks to ease integration (headers and a few dependencies in the bundle framework, etc). In addition to the libraries, with also ship documentation, sample codes, etc.

When we ship we do a manual packaging of the files for now. We also have install rules if a user executes the install target from his own build of the product.

And by default as CMake also installs frameworks relatively to CMAKE_INSTALL_PREFIX, they get installed in /usr/local or one of its subdirectories. This might be ok for all the other files to install but not for frameworks, as documented on https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/InstallingFrameworks.html

Also I don't want to specify an absolute path in the install rule of the frameworks, because we generate a <Project>Config.cmake file and giving an absolute path to install() command makes the generated config non-relocatable. It doesn't look to be documented in https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-relocatable-packages but that's what I noticed.

Finally as we don't ship a .app bundle, we can't install our stuff in it. I hope it's clearer, please tell me if you still miss information.

Best regards,
Lucas

Le 22 janv. 2018 à 17:33, Sean McBride <[hidden email]> a écrit :

On macOS, the most usual thing is for your code to be self-contained in your .app bundle.  Perhaps if you described more what kind of thing you are building and why you don't want to do the usual thing, people will have more advice...


On Fri, 19 Jan 2018 19:44:03 +0100, Lucas Soltic said:

Hello,
Should I conclude that there are no recommendations?

Best regards,
Lucas

Le 17 janv. 2018 à 23:49, Lucas Soltic <[hidden email]> a écrit :

Hello,

By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/
local by default) as a base for relative install paths. But when you
define install rules for macOS frameworks, it doesn't make much sense to
install them there. I'd rather expect something like /Library/Frameworks.

On the other side, if you have more things to install like a "readme"
or documentation that should go into /usr/local/share, it doesn't make
sense to have them installed in /Library/Frameworks. So you can't just
change CMAKE_INSTALL_PREFIX to be /Library/Frameworks.

What do you recommend to keep installation rules simple (ie. remain
relative) and yet support installation of both frameworks and other things?



--

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:
https://cmake.org/mailman/listinfo/cmake