Re: [CMake] Getting the svn revision number of our source.

2014-07-01 Thread Michael Oldfield
On 02/07/14 09:04, Rick McGuire wrote:
 We like to include the SVN revision number in our build artifacts to
 help keep track of what version people are working with.  I found the
 following code on the mailing lists which appears to work fine:  
 
 # Get the SVN revision number of an svn command line client is
 # available.  This version will run at build time rather than only
 # at configuration generation time.
 FIND_PROGRAM(SVN_EXECUTABLE svn
   DOC subversion command line client)
 
 # only do this if we have an svn client.
 if (SVN_EXECUTABLE)
 MACRO(Subversion_GET_REVISION dir variable)
   EXECUTE_PROCESS(COMMAND ${SVN_EXECUTABLE} info ${dir}
 OUTPUT_VARIABLE ${variable}
 OUTPUT_STRIP_TRAILING_WHITESPACE)
   STRING(REGEX REPLACE ^(.*\n)?Revision: ([^\n]+).*
 \\2 ${variable} ${${variable}})
 ENDMACRO(Subversion_GET_REVISION)
 
 Subversion_GET_REVISION(${CMAKE_SOURCE_DIR} ORX_BLD_LVL)
 endif ()
 
 message(STATUS SVN Revision Number is ${ORX_BLD_LVL})
 
 
 Unfortunately, the first person not in the core team who building was running 
 a Spanish language version of SVN, so the ORX_BLD_LEVEL variable ended up 
 with the entire output of the svn info command because it could not find the 
 string REVISION.  This was not a good thing!
 
 
 Is there a better way to obtain the SVN revision number that does not suffer 
 from this sort of problem?
 
 
 Rick

Hi Rick,

You should try the command svnversion'. That should give just the
revision number, and no extraction code will be necessary.

Michael
-- 

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] Building both a .com and .exe executable on Windows.

2014-05-07 Thread Michael Oldfield
On 07/05/14 14:56, J Decker wrote:
 On Tue, May 6, 2014 at 5:54 PM, Michael Oldfield
 sag_mal_plue...@yahoo.com.au mailto:sag_mal_plue...@yahoo.com.au wrote:
 
 On 07/05/14 00:25, Rick McGuire wrote:
  Working on converting an existing project to cmake, which is going
  fairly well.  I've found answers to most of questions with some quick
  google searches, but I've run into an issue where I've not managed to
  find any answers yet.
 
  One part of the project generates two executables with the same name.
   The first is a non-console executable with a .exe extension, the
 second
  is a console version with a .com extension.  I know how to build the
  first, and I can build the second if I give it a different name
 and use
  a .exe extension, but I've not found a means of getting cmake to
  generate an executable with a .com extension.  Has anybody needed to
  deal with this issue before?
 
 Perhaps try set_target_properties?
 
 set_target_properties(MY_COM_TARGET PROPERTIES SUFFIX .com)
 
 
 that just sets the name, doesn't make a real .com; I don't think cmake
 has that support... have to add link flags probably also
  
 
 It's a long time since I've used this, so I can't remember whether you
 need the '.' in the property.

Of course, you're right. It's also a long time since I build a .com
executable.

Sorry for the noise,
Michael

-- 

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


Re: [CMake] Building both a .com and .exe executable on Windows.

2014-05-06 Thread Michael Oldfield
On 07/05/14 00:25, Rick McGuire wrote:
 Working on converting an existing project to cmake, which is going
 fairly well.  I've found answers to most of questions with some quick
 google searches, but I've run into an issue where I've not managed to
 find any answers yet.  
 
 One part of the project generates two executables with the same name.
  The first is a non-console executable with a .exe extension, the second
 is a console version with a .com extension.  I know how to build the
 first, and I can build the second if I give it a different name and use
 a .exe extension, but I've not found a means of getting cmake to
 generate an executable with a .com extension.  Has anybody needed to
 deal with this issue before?

Perhaps try set_target_properties?

set_target_properties(MY_COM_TARGET PROPERTIES SUFFIX .com)

It's a long time since I've used this, so I can't remember whether you
need the '.' in the property.

Michael
-- 

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