Re: [cmake-developers] Making GUI applications by default
On Mar 4, 2012, at 3:29 PM, Stephen Kelly wrote: Stephen Kelly steveire@... writes: Brad King wrote: The implementation is not what I had in mind when I said implies the platform-specific property. This should be its own property that one can set/get normally with no special C++-implemented mapping to the other two properties. The generators should look for this property first and only if not set look for the platform- specific property. If either is set the effect is the same. I see. That's a bit more painful. That will mean touching all generators, and I don't have the easy visual studio or mac access to implement or test them. I happened to read a little bit about CPack recently http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overview The recommendation is to not use MACOSX_BUNDLE when using cpack, I don't see that as a general recommendation for GUI applications on Mac OS X. Its only true if you use the Bundle generator, which does the equivalent of the MACOSX_BUNDLE conversion at cpack time (not install time). I wouldn't base a general statement on a generator where one has a broken make install just to make a cpack generator work. If you use any other cpack generator with a GUI application, you do use MACOSX_BUNDLE. Clint so I thought maybe that makes it different enough to WIN32_EXECUTABLE that they should be different CMAKE_ properties. set(CMAKE_WIN32_EXECUTABLE ON) set(CMAKE_MACOSX_BUNDLE ON) That would also mean that I can actually submit the patch. I'm not so keen on having to change every generator instead. Actually I think the existing patch is better than touching every generator anyway (that's at least in part why there is an abstraction). Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Brad King wrote: On 3/4/2012 5:29 PM, Stephen Kelly wrote: I happened to read a little bit about CPack recently http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overview The recommendation is to not use MACOSX_BUNDLE when using cpack, so I thought maybe that makes it different enough to WIN32_EXECUTABLE that they should be different CMAKE_ properties. set(CMAKE_WIN32_EXECUTABLE ON) set(CMAKE_MACOSX_BUNDLE ON) That would also mean that I can actually submit the patch. I'm not so keen on having to change every generator instead. Actually I think the existing patch is better than touching every generator anyway (that's at least in part why there is an abstraction). That's an argument to not have a generalized property name at all, so just SetPropertyDefault for WIN32_EXECUTABLE and MACOSX_BUNDLE would be sufficient. Ok. I have pushed win32_executable-and-macosx_bundle-initializers to stage. Can I go ahead and merge that to next? Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
On 3/5/2012 9:42 AM, Stephen Kelly wrote: Ok. I have pushed win32_executable-and-macosx_bundle-initializers to stage. Thanks. Can I go ahead and merge that to next? Almost. This hunk misses spaces after the period: - about creation of the Info.plist file for the application bundle.); + about creation of the Info.plist file for the application bundle. + This property is initialized by the value of the variable Fix that and then merge. Thanks, -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Brad King wrote: Fix that and then merge. Done, thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Clinton Stimpson wrote: I happened to read a little bit about CPack recently http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overview The recommendation is to not use MACOSX_BUNDLE when using cpack, I don't see that as a general recommendation for GUI applications on Mac OS X. Yes, my statement was a little over-general. Its only true if you use the Bundle generator, which does the equivalent of the MACOSX_BUNDLE conversion at cpack time (not install time). I wouldn't base a general statement on a generator where one has a broken make install just to make a cpack generator work. If you use any other cpack generator with a GUI application, you do use MACOSX_BUNDLE. I imagined that users could set the value of CMAKE_MACOSX_BUNDLE to True by default, but False if (${CPACK_GENERATOR} STREQUAL MACOSX_BUNDLE). Is that realistic? I don't really know much about cpack, bundles or Mac OSX in general. Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
2012/3/5 Stephen Kelly steve...@gmail.com: Clinton Stimpson wrote: I happened to read a little bit about CPack recently http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overview The recommendation is to not use MACOSX_BUNDLE when using cpack, I don't see that as a general recommendation for GUI applications on Mac OS X. Yes, my statement was a little over-general. Its only true if you use the Bundle generator, which does the equivalent of the MACOSX_BUNDLE conversion at cpack time (not install time). I wouldn't base a general statement on a generator where one has a broken make install just to make a cpack generator work. If you use any other cpack generator with a GUI application, you do use MACOSX_BUNDLE. I imagined that users could set the value of CMAKE_MACOSX_BUNDLE to True by default, but False if (${CPACK_GENERATOR} STREQUAL MACOSX_BUNDLE). Is that realistic? I don't really know much about cpack, bundles or Mac OSX in general. Not really, you may decide run MacOSXBundle CPack generator outside CMakeLists.txt i.e. at CPack time and not at CMake time: cpack -G OSXX11 I don't know much about this CPack generator but from my point of view the generator itself should check whether if the executable have been built properly and warn/error out with appropriate message if not. -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Eric Noulard wrote: 2012/3/5 Stephen Kelly steve...@gmail.com: Clinton Stimpson wrote: I happened to read a little bit about CPack recently http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overview The recommendation is to not use MACOSX_BUNDLE when using cpack, I don't see that as a general recommendation for GUI applications on Mac OS X. Yes, my statement was a little over-general. Its only true if you use the Bundle generator, which does the equivalent of the MACOSX_BUNDLE conversion at cpack time (not install time). I wouldn't base a general statement on a generator where one has a broken make install just to make a cpack generator work. If you use any other cpack generator with a GUI application, you do use MACOSX_BUNDLE. I imagined that users could set the value of CMAKE_MACOSX_BUNDLE to True by default, but False if (${CPACK_GENERATOR} STREQUAL MACOSX_BUNDLE). Is that realistic? I don't really know much about cpack, bundles or Mac OSX in general. Not really, you may decide run MacOSXBundle CPack generator outside CMakeLists.txt i.e. at CPack time and not at CMake time: cpack -G OSXX11 Right. Thanks for the info. At the least, this does provide a hammer for projects to use if wanted though, right? if (NOT MYPROJECT_BUILD_FOR_CPACK_BUNDLE) set(CMAKE_MACOSX_BUNDLE True) endif() cmake .. -DMYPROJECT_BUILD_FOR_CPACK_BUNDLE=True cpack ? Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Stephen Kelly steveire@... writes: Brad King wrote: The implementation is not what I had in mind when I said implies the platform-specific property. This should be its own property that one can set/get normally with no special C++-implemented mapping to the other two properties. The generators should look for this property first and only if not set look for the platform- specific property. If either is set the effect is the same. I see. That's a bit more painful. That will mean touching all generators, and I don't have the easy visual studio or mac access to implement or test them. I happened to read a little bit about CPack recently http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overview The recommendation is to not use MACOSX_BUNDLE when using cpack, so I thought maybe that makes it different enough to WIN32_EXECUTABLE that they should be different CMAKE_ properties. set(CMAKE_WIN32_EXECUTABLE ON) set(CMAKE_MACOSX_BUNDLE ON) That would also mean that I can actually submit the patch. I'm not so keen on having to change every generator instead. Actually I think the existing patch is better than touching every generator anyway (that's at least in part why there is an abstraction). Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
On 2/19/2012 4:57 PM, Stephen Kelly wrote: I've implemented this in my gitorious clone: https://gitorious.org/~steveire/cmake/steveires-cmake/commits/executable_gui-property I am not sure whether you want getting the EXECUTABLE_GUI property to work for the cross-platform abstraction too. Thanks for working on this. The implementation is not what I had in mind when I said implies the platform-specific property. This should be its own property that one can set/get normally with no special C++-implemented mapping to the other two properties. The generators should look for this property first and only if not set look for the platform- specific property. If either is set the effect is the same. Thanks, -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Brad King wrote: On 2/17/2012 9:27 AM, Stephen Kelly wrote: Then add SetPropertyDefault in the initialization of EXECUTABLE targets so that set(CMAKE_GUI_EXECUTABLE 1) will change the default for new executable targets in scope of the variable. Yes, I had the same idea last night after emailing. I can implement that. Great. On second thought I wonder if a better name for the property is EXECUTABLE_GUI since that uses the prefix EXECUTABLE_ which can be re-used later for other properties that are specific to executable targets. Then one could write set(CMAKE_EXECUTABLE_GUI 1) for the variable version and CMAKE_EXECUTABLE_ is the prefix for settings related to executables. I've implemented this in my gitorious clone: https://gitorious.org/~steveire/cmake/steveires- cmake/commits/executable_gui-property I am not sure whether you want getting the EXECUTABLE_GUI property to work for the cross-platform abstraction too. For now that is two commits. I can remove or squash the second commit depending on what you prefer. Let me know if I can merge to next. Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
2012/2/17 Stephen Kelly steve...@gmail.com: Hi there, Also in this thread one of the discussion topics was making CMake default to creating Gui-ready executables. That is, setting the WIN32_EXECUTABLE or MACOSX_BUNDLE property on the executable target. http://thread.gmane.org/gmane.comp.kde.devel.buildsystem/6961/focus=7005 By default CMake does not set those properties, which is actually uncommon. Generally in KDE at least, only unit tests and some small utilities are non- gui executables. We'd like to be able to specify with a defaultProperty something like set(CMAKE_CREATE_GUI_EXECUTABLES ON) You probably mean: set_property(GLOBAL PROPERTY CMAKE_CREATE_GUI_EXECUTABLES ON) which would set those target properties to True on the Windows and Mac platforms by default. For unit tests, we could then disable it again. Thoughts/comments? I have [at least] one project which build on Windows where some applications (not test) are not GUI apps. In fact those applications are seldom launched by the user because they are forked by some GUI apps. If this was set by default would my apps still be working as expected? or shall I put NON-GUI properties on them? If this was to be introduced I bet the default value of the property should be OFF (or not SET) for backward compatibility reason. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Eric Noulard wrote: 2012/2/17 Stephen Kelly steve...@gmail.com: Hi there, Also in this thread one of the discussion topics was making CMake default to creating Gui-ready executables. That is, setting the WIN32_EXECUTABLE or MACOSX_BUNDLE property on the executable target. http://thread.gmane.org/gmane.comp.kde.devel.buildsystem/6961/focus=7005 By default CMake does not set those properties, which is actually uncommon. Generally in KDE at least, only unit tests and some small utilities are non- gui executables. We'd like to be able to specify with a defaultProperty something like set(CMAKE_CREATE_GUI_EXECUTABLES ON) You probably mean: set_property(GLOBAL PROPERTY CMAKE_CREATE_GUI_EXECUTABLES ON) Nope, I meant the one I wrote. It'a similar to, eg, set(CMAKE_AUTOMOC ON) and many others. which would set those target properties to True on the Windows and Mac platforms by default. For unit tests, we could then disable it again. Thoughts/comments? I have [at least] one project which build on Windows where some applications (not test) are not GUI apps. In fact those applications are seldom launched by the user because they are forked by some GUI apps. If this was set by default would my apps still be working as expected? If you change nothing they will continue to work as expected. If you add set(CMAKE_CREATE_GUI_EXECUTABLES ON) then you would have to use set_target_property(foo WIN32_EXECUTABLE 0) on the non-gui executable in the project. Note that I think I caused confusion for you when I wrote 'by default'. I didn't actually mean that CMake should change its default behaviour in a source incompatible way. I meant 'default' in the sense of cmTarget::SetPropertyDefault, in the same way that set(CMAKE_AUTOMOC ON) sets the AUTOMOC property to true by default for all targets that follow. or shall I put NON-GUI properties on them? If this was to be introduced I bet the default value of the property should be OFF (or not SET) for backward compatibility reason. Of course. I don't intend to change the default behaviour of CMake, just the default value of the property *if* set(CMAKE_CREATE_GUI_EXECUTABLES) is ON. Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
Brad King wrote: On 2/17/2012 5:44 AM, Stephen Kelly wrote: I meant 'default' in the sense of cmTarget::SetPropertyDefault, in the same way that set(CMAKE_AUTOMOC ON) sets the AUTOMOC property to true by default for all targets that follow. [snip] default value of the property *if* set(CMAKE_CREATE_GUI_EXECUTABLES) is ON. Instead of a special behavior for WIN32_EXECUTABLE and MACOSX_BUNDLE property defaults, consider creating a new property that generalizes the concept, such as GUI_EXECUTABLE. Teach the code and update the documentation to specify that the property implies WIN32_EXECUTABLE and MACOSX_BUNDLE on the respective platforms. Then add SetPropertyDefault in the initialization of EXECUTABLE targets so that set(CMAKE_GUI_EXECUTABLE 1) will change the default for new executable targets in scope of the variable. Yes, I had the same idea last night after emailing. I can implement that. Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making GUI applications by default
On 2/17/2012 9:27 AM, Stephen Kelly wrote: Then add SetPropertyDefault in the initialization of EXECUTABLE targets so that set(CMAKE_GUI_EXECUTABLE 1) will change the default for new executable targets in scope of the variable. Yes, I had the same idea last night after emailing. I can implement that. Great. On second thought I wonder if a better name for the property is EXECUTABLE_GUI since that uses the prefix EXECUTABLE_ which can be re-used later for other properties that are specific to executable targets. Then one could write set(CMAKE_EXECUTABLE_GUI 1) for the variable version and CMAKE_EXECUTABLE_ is the prefix for settings related to executables. Thanks, -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[cmake-developers] Making GUI applications by default
Hi there, Also in this thread one of the discussion topics was making CMake default to creating Gui-ready executables. That is, setting the WIN32_EXECUTABLE or MACOSX_BUNDLE property on the executable target. http://thread.gmane.org/gmane.comp.kde.devel.buildsystem/6961/focus=7005 By default CMake does not set those properties, which is actually uncommon. Generally in KDE at least, only unit tests and some small utilities are non- gui executables. We'd like to be able to specify with a defaultProperty something like set(CMAKE_CREATE_GUI_EXECUTABLES ON) which would set those target properties to True on the Windows and Mac platforms by default. For unit tests, we could then disable it again. Thoughts/comments? Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers