Re: [CMake] subversion
The discussion is interesting and ends with the question, whether the macro "Subversion_IS_WC" is usable. As I understand the other arguments are *leave the FATAL_ERROR as default for backwards compatibility *the suggested patch hides the error message if error_quite is set . *calling svn info twice is felt to be a waste, if the result is desired anyway. So, I would suggest to extend Erik Johanssons patch from http://www.mail-archive.com/cmake@cmake.org/msg26817.html by storingto the error message and svn error code in an extra variable. Than, we have the ability to ignore errors due to "wrong" working directories and to analyze the error, if the user is interested in the error. In my opinion, a hard fail is annoying, because the user is not able to recover from the error. Regards, Andreas Am 27.06.2016 um 12:57 schrieb Marcel Loose: See also https://cmake.org/Bug/view.php?id=10200 Cheers, Marcel Loose. On 27/06/16 09:23, Andreas Naumann wrote: Thanks for the 6 year old hint. But obviously, the patch is not in any recent cmake version. Therefore, I could use it in my own project and ship my own FindSubversion.cmake.. which is quite ugly. *Gesendet:* Montag, 27. Juni 2016 um 03:11 Uhr *Von:* Nagger <nag...@gmx.de> *An:* cmake@cmake.org *Betreff:* Re: [CMake] subversion Am 24.06.2016 um 19:48 schrieb Andreas Naumann: > At the moment, I check, if my directory is a working copy and if it is > not, the version variable is not defined. In my oppinion, it would be > better, if the macro from the subversion module would simply define a > variable "is_working_directory" instead of failing hard. See https://cmake.org/pipermail/cmake/2010-January/034862.html -- Powered by www.kitware.com <http://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 -- 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
Re: [CMake] subversion
See also https://cmake.org/Bug/view.php?id=10200 Cheers, Marcel Loose. On 27/06/16 09:23, Andreas Naumann wrote: > Thanks for the 6 year old hint. But obviously, the patch is not in any > recent cmake version. > Therefore, I could use it in my own project and ship my own > FindSubversion.cmake.. which is quite ugly. > > *Gesendet:* Montag, 27. Juni 2016 um 03:11 Uhr > *Von:* Nagger <nag...@gmx.de> > *An:* cmake@cmake.org > *Betreff:* Re: [CMake] subversion > Am 24.06.2016 um 19:48 schrieb Andreas Naumann: > > > At the moment, I check, if my directory is a working copy and if it is > > not, the version variable is not defined. In my oppinion, it would be > > better, if the macro from the subversion module would simply define a > > variable "is_working_directory" instead of failing hard. > > See https://cmake.org/pipermail/cmake/2010-January/034862.html > > > -- > > Powered by www.kitware.com <http://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 > > <> signature.asc Description: OpenPGP digital signature -- 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
Re: [CMake] subversion
Thanks for the 6 year old hint. But obviously, the patch is not in any recent cmake version. Therefore, I could use it in my own project and ship my own FindSubversion.cmake.. which is quite ugly. Gesendet: Montag, 27. Juni 2016 um 03:11 Uhr Von: Nagger <nag...@gmx.de> An: cmake@cmake.org Betreff: Re: [CMake] subversion Am 24.06.2016 um 19:48 schrieb Andreas Naumann: > At the moment, I check, if my directory is a working copy and if it is > not, the version variable is not defined. In my oppinion, it would be > better, if the macro from the subversion module would simply define a > variable "is_working_directory" instead of failing hard. See https://cmake.org/pipermail/cmake/2010-January/034862.html -- 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 -- 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
Re: [CMake] subversion
Am 24.06.2016 um 19:48 schrieb Andreas Naumann: At the moment, I check, if my directory is a working copy and if it is not, the version variable is not defined. In my oppinion, it would be better, if the macro from the subversion module would simply define a variable "is_working_directory" instead of failing hard. See https://cmake.org/pipermail/cmake/2010-January/034862.html -- 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
Re: [CMake] subversion
Hi Andreas, I think the FindSubversion module predates CMake 2.8, which introduced "message(WARNING ...)". I think a warning would be better than an error in this case; and I think the same argument holds for Subversion_WC_LOG, which also generates an error if invoked from a non-working copy. Cheers, Marcel Loose. Op 24-06-16 om 19:48 schreef Andreas Naumann: > Dear cmake users, > > I have a question if, and how, you use the Subversion module of cmake. > The module provides the macro Subversion_WC_INFO, which extracts > information of a working copy. I use this information, to generate a sub > minor revision number of my project. > If I checkout my project using svn, it works. But if I export it, the > modules failes with a fatal error. > At the moment, I check, if my directory is a working copy and if it is > not, the version variable is not defined. In my oppinion, it would be > better, if the macro from the subversion module would simply define a > variable "is_working_directory" instead of failing hard. > What do you think about this idea? How do you use the subversion module? > The patch would be easy, and I would send one to the developer mailing > list, if desired. > > Regards, > Andreas signature.asc Description: OpenPGP digital signature -- 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
[CMake] subversion
Dear cmake users, I have a question if, and how, you use the Subversion module of cmake. The module provides the macro Subversion_WC_INFO, which extracts information of a working copy. I use this information, to generate a sub minor revision number of my project. If I checkout my project using svn, it works. But if I export it, the modules failes with a fatal error. At the moment, I check, if my directory is a working copy and if it is not, the version variable is not defined. In my oppinion, it would be better, if the macro from the subversion module would simply define a variable "is_working_directory" instead of failing hard. What do you think about this idea? How do you use the subversion module? The patch would be easy, and I would send one to the developer mailing list, if desired. Regards, Andreas -- 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
Re: [CMake] [SUBVERSION] Retrieve details of your working copy
Tristan Carel wrote: now the RC2 That looks good. Thanks for making the changes. Please open a feature request here: http://www.cmake.org/Bug and attach the lateset revision of the file. Send me the bug number please. Then I'll do the final testing and integration into CMake upstream. Thanks, -Brad ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [SUBVERSION] Retrieve details of your working copy
Tristan Carel wrote: To use it: ### Extract information from the current subversion working copy INCLUDE(UseSubversion.cmake) IF(SUBVERSION_SVN_FOUND) SUBVERSION_REPOSITORY(${PROJECT_SOURCE_DIR}) ENDIF(SUBVERSION_SVN_FOUND) This looks like a nice module. You should be able to convert it to a find module to improve the interface since it just finds an executable and provides a macro. Try renaming the module to FindSubversion.cmake and following the conventions specified in the Modules/readme.txt file in the CMake source tree. Then you should be able to do FIND_PACKAGE(Subversion) IF(SUBVERSION_FOUND) SUBVERSION_REPOSITORY(${PROJECT_SOURCE_DIR}) ENDIF(SUBVERSION_FOUND) If you get this working please post the module for further review and we'll look at putting it in upstream cmake. Thanks, -Brad ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [SUBVERSION] Retrieve details of your working copy
On 10/26/06, Brad King [EMAIL PROTECTED] wrote: Tristan Carel wrote: To use it: ### Extract information from the current subversion working copy INCLUDE(UseSubversion.cmake) IF(SUBVERSION_SVN_FOUND) SUBVERSION_REPOSITORY(${PROJECT_SOURCE_DIR}) ENDIF(SUBVERSION_SVN_FOUND) This looks like a nice module. You should be able to convert it to a find module to improve the interface since it just finds an executable and provides a macro. Try renaming the module to FindSubversion.cmake and following the conventions specified in the Modules/readme.txt file in the CMake source tree In Modules/readme.txt, in the list of variables to provide, I can read: --- XXX_EXECUTABLE Where to find the XXX tool. XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX. --- Subversion is a set of tool. For the moment the module only uses the command `svn' but we can imagine that one day the module could provide commands to be used in server side (thank to `svnlook' for example) So as the module refers to a set: - Do I need to define SUBVERSION_EXECUTABLE? - SUBVERSION_EXECUTABLE refers to the main program of the set? in this case `svn' FIND_PACKAGE(Subversion) IF(SUBVERSION_FOUND) SUBVERSION_REPOSITORY(${PROJECT_SOURCE_DIR}) ENDIF(SUBVERSION_FOUND) FindSubversion.cmake - capitalized vs IF(SUBVERSION_FOUND) - uppercased but: 1. CMake defines the variable `Subversion_FIND_QUIETLY' if option `QUIET' is specified in the `FIND_PACKAGE' command. 2. Most modules provided whose name is capitalized use uppercases variables. Ok Ok, the problem is resolved if the module is named FindSUBVERSION.cmake but it's less sexy :) So? What's your philisophy? I've got 2 questions about the QUIET option in the command FIND_PACKAGE in `Modules/Readme.txt', we can read: If this variable is set the module should not complain about not being able to find the package and should never issue a FATAL_ERROR. 1. Does it means too No fatal error even when user calls a macro defined in this module ? 2 Is a fatal error recommanded above? I guess a FATAL_ERROR message in a module is rude but in this case necessary. --- UseSubversion.cmake 2006-10-26 13:00:40.0 -0400 +++ FindSubversion.cmake2006-10-26 12:59:01.0 -0400 @@ -1,4 +1,4 @@ -# - Extract information from a subversion repository +# - Extract information from a subversion working copy # The module defines the following variables: # SUBVERSION_SVN_EXECUTABLE - path to the subversion command line client # SUBVERSION_VERSION_SVN - version of the subversion command line client @@ -62,9 +62,11 @@ ERROR_VARIABLE svn_info_error) IF(NOT ${svn_info_error}) - MESSAGE(ERROR + IF(NOT Subversion_FIND_QUIETLY) + MESSAGE(ERROR while executing command `svn info ${location}'. Error message: ${svn_info_error}) + ENDIF(NOT Subversion_FIND_QUIETLY) ELSE(NOT ${svn_info_error}) STRING(REGEX REPLACE ^(.*\n)?svn, version ([.0-9]+).* \\2 @@ -85,4 +87,4 @@ ENDIF(SUBVERSION_SVN_EXECUTABLE) -# UseSubversion.cmake ends here. +# FindSubversion.cmake ends here. Thx -- Tristan Carel Music with dinner is an insult both to the cook and the violinist. http://tristan-carel.com ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [SUBVERSION] Retrieve details of your working copy
Tristan Carel wrote: In Modules/readme.txt, in the list of variables to provide, I can read: --- XXX_EXECUTABLE Where to find the XXX tool. XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX. --- Subversion is a set of tool. For the moment the module only uses the command `svn' but we can imagine that one day the module could provide commands to be used in server side (thank to `svnlook' for example) So as the module refers to a set: - Do I need to define SUBVERSION_EXECUTABLE? - SUBVERSION_EXECUTABLE refers to the main program of the set? in this case `svn' The readme is meant to specify a naming convention for each purpose. You can use SUBVERSION_SVN_EXECUTABLE. FIND_PACKAGE(Subversion) IF(SUBVERSION_FOUND) SUBVERSION_REPOSITORY(${PROJECT_SOURCE_DIR}) ENDIF(SUBVERSION_FOUND) FindSubversion.cmake - capitalized vs IF(SUBVERSION_FOUND) - uppercased You're right. This should have been IF(Subversion_FOUND) in my example. but: 1. CMake defines the variable `Subversion_FIND_QUIETLY' if option `QUIET' is specified in the `FIND_PACKAGE' command. 2. Most modules provided whose name is capitalized use uppercases variables. Ok Ok, the problem is resolved if the module is named FindSUBVERSION.cmake but it's less sexy :) So? What's your philisophy? For a while I was arguming that the case-ness should always match but I think its too late. Just use what you think is nice and document it. You could name all your variables Subversion_SVN_EXECUTABLE, etc. I've got 2 questions about the QUIET option in the command FIND_PACKAGE in `Modules/Readme.txt', we can read: If this variable is set the module should not complain about not being able to find the package and should never issue a FATAL_ERROR. 1. Does it means too No fatal error even when user calls a macro defined in this module ? No, it just means the FIND_PACKAGE command will never cause an error. 2 Is a fatal error recommanded above? I guess a FATAL_ERROR message in a module is rude but in this case necessary. It should be used if the REQUIRED option is given to the command. Look at the bottom of FindBoost.cmake for the correct user feedback messages based on QUIET and REQUIRED. -Brad ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [SUBVERSION] Retrieve details of your working copy
On 10/26/06, Brad King [EMAIL PROTECTED] wrote: Tristan Carel wrote: In Modules/readme.txt, in the list of variables to provide, I can read: [...] FindSubversion.cmake - capitalized vs IF(SUBVERSION_FOUND) - uppercased [...] For a while I was arguming that the case-ness should always match but I think its too late. I agree! don't lose hope:) RC1 in attachment. I use `Subversion_WC_INFO' both as variable and macro. As the variable Subversion_WC_INFO contains the output of the command run by the macro Subversion_WC_INFO, I guess it makes sense. As there are 2 specific namespaces, there are no behavior problem. I don't think it can confuse people. Thx for the review! -- Tristan Carel http://tristan-carel.com Women want mediocre men, and men are working hard to become as mediocre as possible. (Margaret Mead) FindSubversion.cmake Description: Binary data ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [SUBVERSION] Retrieve details of your working copy
Tristan Carel wrote: RC1 in attachment. That looks pretty nice. Here are a few comments: 1.) Please change EXEC_PROGRAM to EXECUTE_PROCESS. You can use the new OUTPUT_STRIP_TRAILING_WHITESPACE option in CVS CMake's EXECUTE_PROCESS to avoid extra newlines. Since the module will not be distributed in a cmake without that feature it should work. 2.) There is a MESSAGE(ERROR) call. This is invalid. It should be MESSAGE(SEND_ERROR). 3.) The proper way to detect if there was a problem with executing a process is to use the RESULT_VARIABLE option for EXECUTE_PROCESS. If it is set to anything other than 0 then there was an error and the variable contains a message describing it or the return value. You can then still use the ERROR_VARIABLE to display other output. 4.) When using the STRING(REGEX) command the input argument should always be quoted: STRING(REGEX REPLACE ... Subversion_VERSION_SVN ${Subversion_VERSION_SVN}) should be STRING(REGEX REPLACE ... Subversion_VERSION_SVN ${Subversion_VERSION_SVN}) Otherwise if the variable is empty STRING will complain about having too few arguments. 5.) There should be no TABs in the source file. 6.) Why is Subversion_SVN_EXECUTABLE marked as advanced only when the macro is called? Is that a cut-and-paste error? Thanks, -Brad ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [SUBVERSION] Retrieve details of your working copy
On 10/26/06, Brad King [EMAIL PROTECTED] wrote: Tristan Carel wrote: That looks pretty nice. Here are a few comments: 1.) Please change EXEC_PROGRAM to EXECUTE_PROCESS. Done. You can use the new OUTPUT_STRIP_TRAILING_WHITESPACE option in CVS CMake's EXECUTE_PROCESS to avoid extra newlines. Since the module will not be distributed in a cmake without that feature it should work. I can't access the repository right now, I can't make tests to view the difference but I trust you. 2.) There is a MESSAGE(ERROR) call. This is invalid. It should be MESSAGE(SEND_ERROR). You're right ... one of my bad habits:/ 3.) The proper way to detect if there was a problem with executing a process is to use the RESULT_VARIABLE option for EXECUTE_PROCESS. If it is set to anything other than 0 then there was an error and the variable contains a message describing it or the return value. You can then still use the ERROR_VARIABLE to display other output. I know, I found a case where `svn info' didn't return 1 whereas the path to the working copy was wrong. But I'm not able to reproduce this case = I changed the ugly test 4.) When using the STRING(REGEX) command the input argument should always be quoted: STRING(REGEX REPLACE ... Subversion_VERSION_SVN ${Subversion_VERSION_SVN}) should be STRING(REGEX REPLACE ... Subversion_VERSION_SVN ${Subversion_VERSION_SVN}) Otherwise if the variable is empty STRING will complain about having too few arguments. Do you believe me if I say I'm a shell wizard? :) 5.) There should be no TABs in the source file. Whooo you use a smart script to check contributors ugliness :) 6.) Why is Subversion_SVN_EXECUTABLE marked as advanced only when the macro is called? Is that a cut-and-paste error? Yeah, I guess it's an acceptable reason. now the RC2 Thank you -- Tristan Carel Music with dinner is an insult both to the cook and the violinist. FindSubversion-rc2.cmake Description: Binary data ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake