Re: [CMake] Differentiate between Linux and FreeBSD
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dizzy Sent: 22 April 2008 12:31 To: cmake@cmake.org Subject: Re: [CMake] Differentiate between Linux and FreeBSD On Monday 21 April 2008 12:51:46 Horacio Sanson wrote: I can use IF(WIN32) and IF(UNIX) to set some variables depending if cmake is executed in Windows or UNIX systems. The problem is that UNIX in this context includes both Linux and FreeBSD. Has CMake a way to know if it is running in a Linux box or a FreeBSD box?? Why do you need to know if it is a Linux or a FreeBSD? The generic way to tell is to call the 'uname' command, which generically tells you what operating system you are running on. You can contrive to call this from within CMake if you care to. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Problem added file dependency to a library.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alexander Neundorf Sent: 25 March 2008 16:58 To: cmake@cmake.org Subject: Re: [CMake] Problem added file dependency to a library. I'd suggest use add_custom_command(OUTPUT .../ext.obj ... ) for that and then add the object file to the source files for the library. Does that work ? Yes that works great. I've had lots of trouble getting add_custom_command(OUTPUT ...) rules working in the past, but this appears to do the trick nicely. Thanks. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Problem added file dependency to a library.
Hi there, I'm having major woes trying to add a file dependency to a library, and was wondering if anyone can point me in the right direction. I have a library which depends upon an external object file, produced by a process outside of cmake. I've created a custom target to fire that process off, which makes an object file, but I can't get the library to rebuild its target when that external object changes. What I'm trying to do is this: # Create the foo library target. ADD_LIBRARY(foo test.cpp) # Add rules to build the external object file SET(OUTFILE ${CMAKE_BINARY_DIR}/ext.obj) ADD_CUSTOM_TARGET(foo.external COMMAND doit.bat ${OUTFILE}) # Make the library actually depend upon the external object file: ADD_DEPENDENCIES(foo foo.external) # Make this library depend upon the external target so that it gets built. GET_TARGET_PROPERTY(LIBFILE foo ${CMAKE_BUILD_TYPE}_LOCATION) SET_SOURCE_FILES_PROPERTIES(${LIBFILE} PROPERTIES OBJECT_DEPENDS ${OUTFILE}) However this doesn't force a relink of foo.lib when ${OUTFILE} changes. How do I go about doing that? Many thanks, Joe p.s. I know that this example also doesn't link ${OUTFILE} into foo.lib - my actual example is more complicated than this, using a customer linker_language to run my own linker command using CMAKE_mylinklanguage_CREATE_STATIC_LIBRARY, but that doesn't change the essence of the question. p.s. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Project sub folders in visual studio solution files.
Does anyone have a fix for creating a project hierarchy in visual studio solution files? The number of projects we have is now rather too many to be organised in a single list in the global solution file, and I'd love to put them into folders. Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Project sub folders in visual studio solution files.
Thanking you sir. Joe -Original Message- From: Sylvain Benner [mailto:[EMAIL PROTECTED] Sent: 10 March 2008 10:44 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Project sub folders in visual studio solution files. Does anyone have a fix for creating a project hierarchy in visual studio solution files? Hello, I filled a feature request with an attached patch here: http://public.kitware.com/Bug/view.php?id=6577 --Sylvain ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Excluding non local headers from dependency generation.
Hey folks, I'm trying to speed up the cmake configuration - is there an easy way of excluding non local headers from the dependency calculations in cmake? Ideally it would be good to specify that a particular INCLUDE_DIRECTORIES entry should not be considered in the dependency checks. Is this possible? Actually looking again at the docs, is it possible that if I specify SYSTEM to INCLUDE_DIRECTORIES that it already does this? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] return and break commands
How easy would it be to port this functionality to 2.4.x? Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Martin Sent: 23 January 2008 15:56 To: cmake@cmake.org Subject: [CMake] return and break commands I just checked into CVS return and break commands for CMake. They work pretty much how you would expect the usual C return and break commands to work. A couple quick notes: 1) Macros are like cpp macros (not functions), a return in a macro is no different than an inline return. 2) return from a directory/file (as opposed to a function) will stop processing that CMakeLists file and return control to the parent (whoever called add_subdirectory) if there is a parent. 3) break works on foreach and while loops. A break inside an if/else clause breaks you out of the enclosing foreach or while loop just like C. The same idea holds for return statements inside an if/else/foreach/while, they return you out of the current function or directory. 4) return invoked from an included file should stop processing the current file and take you back to the point of the include command. (forgot to add a test for this one, but really, what are the odds untested cases would have a bug in them :) *kidding* 5) basically these commands should do something fairly intuitive Give me a holler if there are problems. Ken Ken Martin PhD Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] return and break commands
What would be useful, would be to be able to interrupt the current CMakeLists file, from within a macro. The usage case would be: CMakeLists.txt (from a subdirectory): INCLUDE(my_macros) MY_CONFIG_MACRO() # normal stuff follows The MY_CONFIG_MACRO() checks the environment, and determines whether the current project is suitable, and causes interruption of the cmakelists file if so. In the plan you've just implemented one would have to do: INCLUDE(my_macros) MY_CONFIG_MACRO(CONTINUE ) IF(NOT CONTINUE) RETURN ENDIF(NOT CONTINUE) # normal stuff follows Which seems a bit message, as now the implementation of the local configuration details needs to be explicit in each and every cmake file. Can you consider not overloading the RETURN command and introducing a separate command so that the two usage cases can be distinguished. In practice I think that it would be useful to both RETURN from a macro, and EXIT the current CMakeLists.txt file within a macro. You could make RETURN == EXIT if called directly from a CMakeLists file (as opposed to inside a macro). That would provide maximum flexibility. Thanks, Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Martin Sent: 23 January 2008 15:56 To: cmake@cmake.org Subject: [CMake] return and break commands I just checked into CVS return and break commands for CMake. They work pretty much how you would expect the usual C return and break commands to work. A couple quick notes: 1) Macros are like cpp macros (not functions), a return in a macro is no different than an inline return. 2) return from a directory/file (as opposed to a function) will stop processing that CMakeLists file and return control to the parent (whoever called add_subdirectory) if there is a parent. 3) break works on foreach and while loops. A break inside an if/else clause breaks you out of the enclosing foreach or while loop just like C. The same idea holds for return statements inside an if/else/foreach/while, they return you out of the current function or directory. 4) return invoked from an included file should stop processing the current file and take you back to the point of the include command. (forgot to add a test for this one, but really, what are the odds untested cases would have a bug in them :) *kidding* 5) basically these commands should do something fairly intuitive Give me a holler if there are problems. Ken Ken Martin PhD Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] return and break commands
I don't mind porting the bits myself, but as it's cvs it's a bit hard to determine what changes are required :). (No atomic commit numbers!) I don't suppose you have a commit email or log somewhere which would tell me all the version numbers of that change do you? Joe -Original Message- From: Ken Martin [mailto:[EMAIL PROTECTED] Sent: 25 January 2008 15:18 To: Josef Karthauser; cmake@cmake.org Subject: RE: [CMake] return and break commands It would not be that hard to port it, but...I'm pretty sure we are done with the 2.4 branch. 2.4.8 is probably the last of the 2.4 releases. We are (and have been) gearing up for the 2.6 release which I hope we will get into beta in a few weeks. - Ken Ken Martin PhD Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 -Original Message- From: Josef Karthauser [mailto:[EMAIL PROTECTED] Sent: Friday, January 25, 2008 3:11 AM To: Ken Martin; cmake@cmake.org Subject: RE: [CMake] return and break commands How easy would it be to port this functionality to 2.4.x? Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Martin Sent: 23 January 2008 15:56 To: cmake@cmake.org Subject: [CMake] return and break commands I just checked into CVS return and break commands for CMake. They work pretty much how you would expect the usual C return and break commands to work. A couple quick notes: 1) Macros are like cpp macros (not functions), a return in a macro is no different than an inline return. 2) return from a directory/file (as opposed to a function) will stop processing that CMakeLists file and return control to the parent (whoever called add_subdirectory) if there is a parent. 3) break works on foreach and while loops. A break inside an if/else clause breaks you out of the enclosing foreach or while loop just like C. The same idea holds for return statements inside an if/else/foreach/while, they return you out of the current function or directory. 4) return invoked from an included file should stop processing the current file and take you back to the point of the include command. (forgot to add a test for this one, but really, what are the odds untested cases would have a bug in them :) *kidding* 5) basically these commands should do something fairly intuitive Give me a holler if there are problems. Ken Ken Martin PhD Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] return and break commands
-Original Message- From: Ken Martin [mailto:[EMAIL PROTECTED] Sent: 25 January 2008 15:04 To: Josef Karthauser; cmake@cmake.org Subject: RE: [CMake] return and break commands What would be useful, would be to be able to interrupt the current CMakeLists file, from within a macro. We initially implemented it that way but due to some obscure parts of the US export control laws we realized we would never be able to distribute it. OK, I just made that up, but I'm sure most of you believed me, well ... maybe not that many :). Seriously though, for macros what you are looking for is the current behavior I believe. Consider a macro like an inline expansion. A return in a macro is the same as a return in the CMakeLists file. Functions though are different and have scope etc. Hope that helps. Ah ok. I'm still using 2.4.7. Are functions a new unreleased thing? So from what you've just said I expect that RETURN in a macro in 2.4.7 will cause the current CMakeLists.txt file to end processing. Is that correct? So, the next question, is how easy is to back port this to 2.4.7? I've got a really big need for it, but enough local patches that I can't go forward to 2.nextone yet. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Re: Get full output library filename
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodolfo Lima Sent: 12 January 2008 01:42 To: cmake@cmake.org Subject: [CMake] Re: Get full output library filename Rodolfo Lima escreveu: Hi, is there a way to get the full library name of a library target? I just found target's property LOCATION, I always thought it would be the directory where the target would be created, but it includes the target file name. Sorry for the noise. Does it correctly include the contents of ${BUILD_TYPE}_POSTFIX? I'm using 2.4.7, and reported a few weeks ago that the value of LOCATION doesn't include the postfix. Andreas Pakulat confirmed that he was seeing the same thing. Are you saying that it works for you? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Re: Get full output library filename
It must have been fixed in the repository then. Hmm, ok I'd better go track the patch down :). Thanks for the confirmation. Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodolfo Schulz de Lima Sent: 14 January 2008 17:40 To: cmake@cmake.org Subject: [CMake] Re: Get full output library filename Josef Karthauser wrote: Does it correctly include the contents of ${BUILD_TYPE}_POSTFIX? I'm using 2.4.7, and reported a few weeks ago that the value of LOCATION doesn't include the postfix. Andreas Pakulat confirmed that he was seeing the same thing. Are you saying that it works for you? Well, I'm using cmake-cvs (as of 2008/01/14) and it works correctly, and also includes ${BUILD_TYPE}_POSTFIX. Regards, Rodolfo Lima. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Re: Get full output library filename
Hmm, I can't see where it would have been fixed. Can one of the developers please comment? Thanks, Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josef Karthauser Sent: 14 January 2008 17:44 To: Rodolfo Schulz de Lima; cmake@cmake.org Subject: RE: [CMake] Re: Get full output library filename It must have been fixed in the repository then. Hmm, ok I'd better go track the patch down :). Thanks for the confirmation. Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodolfo Schulz de Lima Sent: 14 January 2008 17:40 To: cmake@cmake.org Subject: [CMake] Re: Get full output library filename Josef Karthauser wrote: Does it correctly include the contents of ${BUILD_TYPE}_POSTFIX? I'm using 2.4.7, and reported a few weeks ago that the value of LOCATION doesn't include the postfix. Andreas Pakulat confirmed that he was seeing the same thing. Are you saying that it works for you? Well, I'm using cmake-cvs (as of 2008/01/14) and it works correctly, and also includes ${BUILD_TYPE}_POSTFIX. Regards, Rodolfo Lima. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Suppression of progress reports in Makefiles?
Is it easy to suppress the addition of the progress report information from generated Makefiles? They're useful, but I'd like to switch them off as speed is more important to me right now. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Bug in GET_TARGET_PROPERTY? (was CMAKE_CONFIG_POSTFIX vs GET_TARGET_PROPERTY(FILE foo LOCATION) )
It wasn't just the office party talking, I've rechecked today and it definitely isn't working as I'd expect: SET(CMAKE_DEBUG_POSTFIX _d) Project(Hello) add_library (Hello hello.cxx hello.h) get_target_property(FILE Hello LOCATION) message(Lib is called: ${FILE}) Run cmake on this and I get the output: $ nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. [100%] Building CXX object CMakeFiles/Hello.dir/hello.obj hello.cxx Linking CXX static library Hello_d.lib [100%] Built target Hello Am I misunderstanding the usage of get_target_property or is there a bug here? Joe From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josef Karthauser Sent: 20 December 2007 17:11 To: cmake@cmake.org Subject: [CMake] CMAKE_CONFIG_POSTFIX vs GET_TARGET_PROPERTY(FILE fooLOCATION) Am I going mad? (could be, it was the office party last night). I want to add a '_d' to the end of debug libraries, which it appears that I can do using something like: SET(CMAKE_DEBUG_WIN32_POSTFIX _d CACHE INTERNAL Postfix for debug library names FORCE) Later deep in some macros the code wants to find the filename associated with a given library: GET_TARGET_PROPERTY(FILE ${LIBNAME} LOCATION) Strangely, although the build makes a 'LIBNAME_d.lib' library, the get target property appears to return the name of the library without the _d. Am I hallucinating? Joe p.s. this is with 2.4.7. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] RE: Bug in GET_TARGET_PROPERTY? (was CMAKE_CONFIG_POSTFIX vs GET_TARGET_PROPERTY(FILE foo LOCATION) )
Whoops, I forgot the cmake output: Lib is called: C:/Devel/SVN/trunk/build/test/qqq/Hello/Hello.lib Vs nmake output: Linking CXX static library Hello_d.lib Joe From: Josef Karthauser Sent: 21 December 2007 09:05 To: Josef Karthauser; cmake@cmake.org Subject: Bug in GET_TARGET_PROPERTY? (was CMAKE_CONFIG_POSTFIX vs GET_TARGET_PROPERTY(FILE foo LOCATION) ) It wasn't just the office party talking, I've rechecked today and it definitely isn't working as I'd expect: SET(CMAKE_DEBUG_POSTFIX _d) Project(Hello) add_library (Hello hello.cxx hello.h) get_target_property(FILE Hello LOCATION) message(Lib is called: ${FILE}) Run cmake on this and I get the output: $ nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. [100%] Building CXX object CMakeFiles/Hello.dir/hello.obj hello.cxx Linking CXX static library Hello_d.lib [100%] Built target Hello Am I misunderstanding the usage of get_target_property or is there a bug here? Joe From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josef Karthauser Sent: 20 December 2007 17:11 To: cmake@cmake.org Subject: [CMake] CMAKE_CONFIG_POSTFIX vs GET_TARGET_PROPERTY(FILE fooLOCATION) Am I going mad? (could be, it was the office party last night). I want to add a '_d' to the end of debug libraries, which it appears that I can do using something like: SET(CMAKE_DEBUG_WIN32_POSTFIX _d CACHE INTERNAL Postfix for debug library names FORCE) Later deep in some macros the code wants to find the filename associated with a given library: GET_TARGET_PROPERTY(FILE ${LIBNAME} LOCATION) Strangely, although the build makes a 'LIBNAME_d.lib' library, the get target property appears to return the name of the library without the _d. Am I hallucinating? Joe p.s. this is with 2.4.7. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] MSVC turn off RelWithDebInfo and MinSizeRel
Yeah, that's a pain. I recently submitted a bug fix which allows configurations other than these stock four to be used, however sometimes these stock four get added in addition, and sometimes they're not. I've not managed to determine where or why. It's my understanding that the MSVC configuration type stuff has a few too many assumptions in the code, and is probably due a complete overhaul at some point. Maybe that's already been done for the next major release? Joe From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Torsten Martinsen Sent: 20 December 2007 08:11 To: David Cole Cc: cmake@cmake.org Subject: RE: [CMake] MSVC turn off RelWithDebInfo and MinSizeRel Unfortunately, this does not work. I just tried adding SET(CMAKE_CONFIGURATION_TYPES Debug;RelWithDebInfo) at the top of my CMakeLists.txt, then deleted my build tree and ran cmake. The generated project files still contain Debug, Release, MinSizeRel and RelWithDebInfo. -Torsten From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Cole Sent: 20 December 2007 01:32 To: Jesse Corrington Cc: cmake@cmake.org Subject: Re: [CMake] MSVC turn off RelWithDebInfo and MinSizeRel SET(CMAKE_CONFIGURATION_TYPES Debug;Release) in your CMakeLists.txt. (Or just edit that value in CMakeSetup to change it in the cache.) If you do it with a simple set in the CMakeLists.txt then you will not see that reflected in the CMakeSetup GUI, but it will be in effect at generation time and you should end up with sln/vcproj files with just the two types. HTH, David On 12/19/07, Jesse Corrington [EMAIL PROTECTED] wrote: Is there anyway to have CMake not generate these two configurations, and just generate the standard release and debug configurations instead? Thanks. This e-mail and any files sent with it contain information that may be privileged or confidential and is the property of the GateHouse Group. This information is intended solely for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use the message or any part thereof. If you have received this e-mail in error, please notify the sender immediately, and delete all copies of this message. In accordance with GateHouse Security Policy, e-mails sent or received may be monitored. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] MSVC turn off RelWithDebInfo and MinSizeRel
We do something like this: MACRO(ADD_CONFIGURATION CONFIGURATION PLATFORM COMPILER_FLAGS LINKER_FLAGS) # The configuration label we use internally the platform appended on it. SET( CONFIG_LABEL ${CONFIGURATION}_${PLATFORM} ) SET( ${CONFIG_LABEL}_PLATFORM ${PLATFORM} CACHE STRING FORCE ) DEBUG_MESSAGE(GEO_VERBOSE_CONFIG Adding configuration ${CONFIG_LABEL} for platform ${PLATFORM}) DEBUG_MESSAGE(GEO_VERBOSE_CONFIG \tcompiler flags ${COMPILER_FLAGS}) # Add the configuration to the list of configurations SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} ${CONFIG_LABEL} CACHE INTERNAL FORCE ) ... more stuff ENDMACRO(ADD_CONFIGURATION) I've tried initialising it with # Add the configuration to the list of configurations SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} CACHE INTERNAL FORCE ) but that doesn't remove the stock configurations, if they are already there. Joe From: David Cole [mailto:[EMAIL PROTECTED] Sent: 20 December 2007 15:20 To: Josef Karthauser Cc: Torsten Martinsen; cmake@cmake.org Subject: Re: [CMake] MSVC turn off RelWithDebInfo and MinSizeRel I will see if I can find / figure out what I did to make this work -- I know I've done it before to eliminate all but one config type... How about this in the CMakeLists.txt file instead? (Force it into the cache rather than using a simple set.) SET(CMAKE_CONFIGURATION_TYPES Debug;Release CACHE STRING limited configs FORCE) Maybe? David On 12/20/07, Josef Karthauser [EMAIL PROTECTED] wrote: Yeah, that's a pain. I recently submitted a bug fix which allows configurations other than these stock four to be used, however sometimes these stock four get added in addition, and sometimes they're not. I've not managed to determine where or why. It's my understanding that the MSVC configuration type stuff has a few too many assumptions in the code, and is probably due a complete overhaul at some point. Maybe that's already been done for the next major release? Joe From: cmake-bounces+joe.karthauser= [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Torsten Martinsen Sent: 20 December 2007 08:11 To: David Cole Cc: cmake@cmake.org Subject: RE: [CMake] MSVC turn off RelWithDebInfo and MinSizeRel Unfortunately, this does not work. I just tried adding SET(CMAKE_CONFIGURATION_TYPES Debug;RelWithDebInfo) at the top of my CMakeLists.txt, then deleted my build tree and ran cmake. The generated project files still contain Debug, Release, MinSizeRel and RelWithDebInfo. -Torsten From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Cole Sent: 20 December 2007 01:32 To: Jesse Corrington Cc: cmake@cmake.org Subject: Re: [CMake] MSVC turn off RelWithDebInfo and MinSizeRel SET(CMAKE_CONFIGURATION_TYPES Debug;Release) in your CMakeLists.txt. (Or just edit that value in CMakeSetup to change it in the cache.) If you do it with a simple set in the CMakeLists.txt then you will not see that reflected in the CMakeSetup GUI, but it will be in effect at generation time and you should end up with sln/vcproj files with just the two types. HTH, David On 12/19/07, Jesse Corrington [EMAIL PROTECTED] wrote: Is there anyway to have CMake not generate these two configurations, and just generate the standard release and debug configurations instead? Thanks. This e-mail and any files sent with it contain information that may be privileged or confidential and is the property of the GateHouse Group. This information is intended solely for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use the message or any part thereof. If you have received this e-mail in error, please notify the sender immediately, and delete all copies of this message. In accordance with GateHouse Security Policy, e-mails sent or received may be monitored. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMAKE_CONFIG_POSTFIX vs GET_TARGET_PROPERTY(FILE foo LOCATION)
Am I going mad? (could be, it was the office party last night). I want to add a '_d' to the end of debug libraries, which it appears that I can do using something like: SET(CMAKE_DEBUG_WIN32_POSTFIX _d CACHE INTERNAL Postfix for debug library names FORCE) Later deep in some macros the code wants to find the filename associated with a given library: GET_TARGET_PROPERTY(FILE ${LIBNAME} LOCATION) Strangely, although the build makes a 'LIBNAME_d.lib' library, the get target property appears to return the name of the library without the _d. Am I hallucinating? Joe p.s. this is with 2.4.7. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] PRE_BUILD custom commands don't appear to be working....
I'm going to try that today. From: David Cole [mailto:[EMAIL PROTECTED] Sent: 14 December 2007 18:18 To: Bill Hoffman Cc: Josef Karthauser; cmake@cmake.org Subject: Re: [CMake] PRE_BUILD custom commands don't appear to be working But you should be able to put your custom command in its own custom target and then use ADD_DEPENDENCIES to make the custom target build *before* any build steps for the library... Have you tried that? HTH, David On 12/14/07, Bill Hoffman [EMAIL PROTECTED] wrote: Josef Karthauser wrote: I don't suppose anyone had any thought on this one did they? http://www.cmake.org/HTML/Documentation.html ADD_CUSTOM_COMMAND: Add a custom build rule to the generated build system. Note that the PRE_BUILD option is only supported on Visual Studio 7 or later. For all other generators PRE_BUILD will be treated as PRE_LINK. We have tried, and this is next to impossible to do with a makefile, sorry... -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] PRE_BUILD custom commands don't appear to be working....
-Original Message- From: Bill Hoffman [mailto:[EMAIL PROTECTED] Sent: 14 December 2007 14:16 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] PRE_BUILD custom commands don't appear to be working Josef Karthauser wrote: I don't suppose anyone had any thought on this one did they? http://www.cmake.org/HTML/Documentation.html ADD_CUSTOM_COMMAND: Add a custom build rule to the generated build system. Note that the PRE_BUILD option is only supported on Visual Studio 7 or later. For all other generators PRE_BUILD will be treated as PRE_LINK. We have tried, and this is next to impossible to do with a makefile, sorry... I was thinking, could you please make cmake generate a warning when PRE_BUILD is used and it knows that it can't implement it? That would go a long way to resolving this. If someone is relying on its behaviour, and then uses a generator that doesn't support it, it's good for them to know at cmake time. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Adding a header dependency on a generated header file. (was PRE_BUILD custom commands don't appear to be working....)
So, I've created a new target to generate the header, and made the library target depend upon it. How do I now make sure that the generated header is considered in the dependency checks for the objects build from the CPP files that #include it? Joe From: David Cole [mailto:[EMAIL PROTECTED] Sent: 14 December 2007 18:18 To: Bill Hoffman Cc: Josef Karthauser; cmake@cmake.org Subject: Re: [CMake] PRE_BUILD custom commands don't appear to be working But you should be able to put your custom command in its own custom target and then use ADD_DEPENDENCIES to make the custom target build *before* any build steps for the library... Have you tried that? HTH, David On 12/14/07, Bill Hoffman [EMAIL PROTECTED] wrote: Josef Karthauser wrote: I don't suppose anyone had any thought on this one did they? http://www.cmake.org/HTML/Documentation.html ADD_CUSTOM_COMMAND: Add a custom build rule to the generated build system. Note that the PRE_BUILD option is only supported on Visual Studio 7 or later. For all other generators PRE_BUILD will be treated as PRE_LINK. We have tried, and this is next to impossible to do with a makefile, sorry... -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Compilation speed with CMake/NMake combination, making it faster?
-Original Message- From: Daniel [mailto:[EMAIL PROTECTED] Sent: 14 December 2007 15:23 To: Josef Karthauser Cc: CMake ML Subject: Re: [CMake] Compilation speed with CMake/NMake combination, making it faster? [cut] Don't forget about the fast targets, I make heavy use of them. If you have multiple targets you can build a single target foo without checking dependencies by typing nmake foo/fast In cmd you might need to use a backslash. I have my project split to include several static libs, so I can build only the section that I am working on. That's what I've done in the end. I've used CMake to make a per-source and per-project batch file (in the CMakeFiles/ directory) and then we call that from within visual studio in a custom tool. This enables the developers access to the 'NMake .../foo.obj' and 'NMake project/fast' targets on a convenient keyboard short cut. It's improved things no end. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] turning off compile testing
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jesse Corrington Sent: 12 December 2007 00:46 To: cmake@cmake.org Subject: [CMake] turning off compile testing Is there any way to turn off try compile during configuration? We do it this way: cmake -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_C_COMPILER_WORKS=1 -DHAVE_CMAKE_SIZEOF_VOID_P=1 . Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] turning off compile testing
-Original Message- We do it this way: cmake -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_C_COMPILER_WORKS=1 -DHAVE_CMAKE_SIZEOF_VOID_P=1 . That looks like a bad idea to me The void one in particular. You should really be careful about setting stuff like this by hand It's a hack granted, but there is no other way of telling CMake to ignore the compiler - the compiler tests aren't as clean as one might like, and so fail for some of the compilers that we use. The HAVE_CMAKE_SIZEOF_VOID_P variable is used, if I remember correctly, to determine whether the host environment is 32 or 64 bit in order to select the correct compiler. However as we are cross compiling, the host environment is entirely irrelevant, however without this variable set cmake persists in trying to work it out. I'm sure that most of this pain goes away in the 2.7 release - I'm looking forward to evaluating the new cross build stuff sometime early next year. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] PRE_BUILD custom commands don't appear to be working....
I'm trying to add a prebuild custom command to a NMake target, but it doesn't appear to be running in the right place. Here's an example: CMakelists.txt: Project(Hello) add_library (Hello hello.cxx hello.h) add_custom_command(TARGET Hello PRE_BUILD COMMAND ${CMAKE_COMMAND} ARGS -P ${PROJECT_SOURCE_DIR}/Hello.cmake ) Hello.cmake MESSAGE(Hello.cmake ran) So, I would hope that the Hello.cmake file would get run first, but it appears to be run as if it is a POST_BUILD. $ cmake.exe -G NMake Makefiles . ... stuff .. $ nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. [100%] Building CXX object CMakeFiles/Hello.dir/hello.obj hello.cxx Linking CXX static library Hello.lib Prebuild rule ran [100%] Built target Hello [EMAIL PROTECTED] /c/Devel/SVN/trunk/build/test/qq/Hello Doesn't PRE_BUILD request that that command gets run before the hello.cxx file gets compiled? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Compilation speed with CMake/NMake combination, making it faster?
So we've got a fairly sizable amount of code described in the CMake framework now, about 10 or so libraries, and 4 projects which consume them. We're now hitting upon compilation time as an issue, as it takes much longer than our previous framework did. I'm wondering what can be done to speed it up. My thoughts on the matter are: * We're using an NMake build tree, is NMake particularly slow? Do any of the other makes work more efficiently? * Does all the percentage complete processing add a significant overhead to the build time? * It seems to take CMake/NMake a long time to determine that no work needs to be done. It can take 20 seconds or longer for all the dependency targets to be checked, no work to be done, and only then will the project start compiling. Does anyone have any thoughts on this matter? I'd appreciate any ideas on how to speed this up. Thanking you, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Compilation speed with CMake/NMake combination, making it faster?
-Original Message- From: Torsten Martinsen [mailto:[EMAIL PROTECTED] Sent: 11 December 2007 09:08 To: Josef Karthauser; CMake ML Subject: RE: [CMake] Compilation speed with CMake/NMake combination, making it faster? * We're using an NMake build tree, is NMake particularly slow? Do any of the other makes work more efficiently? Be aware that nmake builds are much slower than using devenv, as nmake starts a cl.exe process for every single file, whereas devenv calls cl.exe with several source files. This costs, due to the high process overhead on Windows. I understand that. I'm still interested in hearing from folks how might have optimised this though. Our builds feel much slower than I'd expect from previous experience with make file driven builds. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Creating a visual studio project with non .cpp or .h files in it.
-Original Message- From: Bill Hoffman [mailto:[EMAIL PROTECTED] Sent: 06 December 2007 13:23 To: Josef Karthauser Cc: Sylvain Benner; CMake ML Subject: Re: [CMake] Creating a visual studio project with non .cpp or .h files in it. Josef Karthauser wrote: It would be useful if there was a standard way of doing this within CMake; maybe there is in 2.6? Anyway, I boiled your ideas down into a single 'ADD_DOCUMENTATION()' command - see attached patch to 2.4.7. It should probably be called ADD_AUX_FILE() or something though, as we also use it to add external foo.cmake files to the visual project files for ease of editing within the Visual Studio environment. Actually, I would think that the right way to do this would be to allow for custom targets to have sources. I don't think we need a whole new command for this. That's essentially the approach that Sylvain took by making their own alternative CUSTOM_TARGET command. I didn't want too much addition stuff, and so just added the simplest thing I could think of. At some point we'll move up to 2.6, and I want our local changes to be obvious. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Bug in EXECUTE_PROCESS?
Is this a bug? EXECUTE_PROCESS( COMMAND badcmd_that_doesnt_exist ERROR_VARIABLE ERROR ) IF(ERROR) MESSAGE(FATAL_ERROR Error! Command doesn't exist.) ENDIF(ERROR) as the fatal_error is never raised. If not, what's the canonical way of reliably determining whether the process succeeded or failed? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Creating a visual studio project with non .cpp or .h files in it.
Hi folks, I'm still trying to solve this one - alas it's alluding me. I want to create a visual studio project file which only has non-compiling files in it, for instance CMake macro files or documentation. This I want so that people can easily edit them from within visual studio. I can't work out how to do it. So, imagine that I have the files 'foo.txt' and 'bar.txt' which I want to add to a project. If they were part of a library project I would add them to the project file by doing: ADD_LIBRARY(Library_Name lib.cpp foo.txt bar.txt) and that would be enough for cmake to include the .txt files in the vcproj file along with the C++ source code. However what if I want to have a visual studio which has C++ files what do I do to get the visual studio file to be brought into existence? Does anyone know? I could do with being put out of my misery! :) Joe -Original Message- From: Josef Karthauser Sent: 02 November 2007 15:23 To: 'Joshua Jensen'; Philip Lowman Cc: CMake ML Subject: RE: [CMake] Adding non .cpp or .h file to a visual studio project. From: Joshua Jensen [mailto:[EMAIL PROTECTED] Sent: 02 November 2007 15:09 To: Philip Lowman Cc: Josef Karthauser; CMake ML Subject: Re: [CMake] Adding non .cpp or .h file to a visual studio project. Philip Lowman wrote: Josef Karthauser wrote: Hi there again, I’m using cmake to create some visual studio projects, and want to include some non-C files (config.txt for instance) into the vcproj file so that my Visual Studio users can edit the file from within the IDE. I can’t add them using ADD_LIBRARY or ADD_EXECUTABLE, so how do I register them? This works for me on CMake 2.4.6 and Visual Studio 8: SET_SOURCE_FILES_PROPERTIES(readme.txt PROPERTIES HEADER_FILE_ONLY true) ADD_LIBRARY(foo foo.cc readme.txt) I tried it this morning, and I didn't even need the SET_SOURCE_FILES_PROPERTIES. Sure, but if you do ADD_LIBRARY(foo readme.txt) you get an error. So how do you create a project which only has non-C objects? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Bug in EXECUTE_PROCESS?
-Original Message- From: Jesper Eskilson [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Eskilson Sent: 04 December 2007 13:41 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Bug in EXECUTE_PROCESS? Josef Karthauser wrote: Is this a bug? EXECUTE_PROCESS( COMMAND badcmd_that_doesnt_exist ERROR_VARIABLE ERROR ) IF(ERROR) MESSAGE(FATAL_ERROR Error! Command doesn’t exist.) ENDIF(ERROR) as the fatal_error is never raised. If not, what’s the canonical way of reliably determining whether the process succeeded or failed? Without actually checking the docs, I would guess that ERROR contains the exit code of the process, i.e. non-zero on failure. Try comparing ERROR against 0 instead. My bad! I didn't read the docs carefully enough. ERROR_VARIABLE actually indicates the variable which should take the output of the stderr channel. What I should have been using was RESULT_VARIABLE. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Rediscovering the compiler.
Is there a canonical way of forcing cmake (2.4.7) to rediscover the compiler, without blowing the CMakeCache and build directory away altogether and starting again? I guess that there are a few variables which if I reset them will drive this behaviour. Which ones are sufficient? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Obtaining a subversion revision number at build time ?
Is there a supported method for getting a subversion revision number at build time? I see that I can do it at build tree generation time by using: FIND_PACKAGE(Subversion) IF(Subversion_FOUND) Subversion_WC_INFO(${CMAKE_HOME_DIRECTORY} Project) MESSAGE(Current revision is ${Project_WC_REVISION}) ENDIF(Subversion_FOUND) However if I want to do this in a target it appears that I need to do it from a foo.cmake file and call that from the target like so: ADD_CUSTOM_TARGET(FOO ALL COMMAND ${CMAKE_COMMAND} ARGS -P ${PROJECT_SOURCE_DIR}/subversion.cmake ) with the file subversion.cmake taking the form: FIND_PACKAGE(Subversion) IF(Subversion_FOUND) Subversion_WC_INFO(${CMAKE_HOME_DIRECTORY} Project) MESSAGE(Current revision is ${Project_WC_REVISION}) ENDIF(Subversion_FOUND) as above. But if I do this I get the error: CMake Error: Error in cmake code at C:/Devel/SVN/trunk/Bin/CMake/share/cmake-2.4/Modules/FindSubversion.cmak e:57: Command MARK_AS_ADVANCED not scriptable Is this a limitation that I can work around in some fashion? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Creating librarys with different names from their targets.
I've got a library which I want to build from a target which has a different name. Is there any way of doing this? If I do, ADD_LIBRARY(Foo source.cpp) this creates a target called 'Foo' which builds 'Foo.lib'. However I want the library 'Foo.lib' to be built from a target call 'Foo.Code'. Is this possible? (I've not explained the whole picture as it's more complicated than this). this ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Using gmake with windows CL compiler?
Does anyone here have gnumake working with the windows CL compiler? We're using nmake targets, and I tried instead to use gmake, however there were lots of problems due to backslashes instead of slashes, etc. I'd appreciate hearing from anyone who has got this working. Many thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Using gmake with windows CL compiler?
The mailing list archives say don't use Cygwin gmake for this. http://www.cmake.org/pipermail/cmake/2006-August/010617.html I've done it, just make sure you are using MinGW GNU Make and not Cygwin GNU Make. Also you will eventually run into the command line that is too log bug, since GNU Make can't use response files like NMake can. It might also be important what SHELL is set too. Use the MinGW Makefiles generator. Excellent. This is exactly the feedback I was looking for. Thanks :). Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Setting up dependencies for non C++ files.
We've got a load of 'shader' files which need to be compiled. I've added custom targets for them, however like .cpp and .h files they have #include directives in as they can include other files. Is there an easy way of utilising cmake's dependency checking stuff to get it to track these dependencies as if they were .h files? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Setting up dependencies for non C++ files.
We've got a load of 'shader' files which need to be compiled. I've added custom targets for them, however like .cpp and .h files they have #include directives in as they can include other files. Is there an easy way of utilising cmake's dependency checking stuff to get it to track these dependencies as if they were .h files? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Causing cmake to use stderr instead of stdout.
Is it possible (with relative easy) to have cmake send all output to stderr instead of stdout? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Causing cmake to use stderr instead of stdout.
:) Sure I can do that. However I was trying to use 'dos'. World of pain. Using cygwin's bourne shell instead :). Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dizzy Sent: 19 November 2007 16:48 To: cmake@cmake.org Subject: Re: [CMake] Causing cmake to use stderr instead of stdout. On Monday 19 November 2007 18:37:02 Josef Karthauser wrote: Is it possible (with relative easy) to have cmake send all output to stderr instead of stdout? Well on a bourne shell I think you can do: cmake /path/to/sources 12 And it will run cmake redirecting fd 1 (stdout) to fd 2 (stderr). If you need to further direct the output make sure you write that before 12 part as in: cmake /path/to/sources 2 logfile.txt 12 -- Mihai RUSUEmail: [EMAIL PROTECTED] Linux is obsolete -- AST ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Setting environment variables for custom targets
I'm using a custom target to run an external command to build some objects, however the external command needs some environment variables setting to run properly. Is there a way of setting an environment variable within CMAKE, so that it gets used during the build? It doesn't appear that, SET(ENV{MYVAR} FOO) ADD_CUSTOM_TARGET(MYTARGET mycommand args), does the right thing, as the environment var MYVAR is only set during the cmake build, but not populated at build time and so not utilised by the custom target. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Setting environment variables for custom targets
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brandon Van Every Sent: 15 November 2007 14:17 To: cmake@cmake.org Subject: Re: [CMake] Setting environment variables for custom targets It doesn't appear that, SET(ENV{MYVAR} FOO) ADD_CUSTOM_TARGET(MYTARGET mycommand args), does the right thing, as the environment var MYVAR is only set during the cmake build, but not populated at build time and so not utilised by the custom target. Wrap your external command in a CMake script. How so? Can you give me an example? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Adding non .cpp or .h file to a visual studio project.
Hi there again, I'm using cmake to create some visual studio projects, and want to include some non-C files (config.txt for instance) into the vcproj file so that my Visual Studio users can edit the file from within the IDE. I can't add them using ADD_LIBRARY or ADD_EXECUTABLE, so how do I register them? Does anyone know? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Adding non .cpp or .h file to a visual studio project.
From: Joshua Jensen [mailto:[EMAIL PROTECTED] Sent: 02 November 2007 15:09 To: Philip Lowman Cc: Josef Karthauser; CMake ML Subject: Re: [CMake] Adding non .cpp or .h file to a visual studio project. Philip Lowman wrote: Josef Karthauser wrote: Hi there again, I’m using cmake to create some visual studio projects, and want to include some non-C files (config.txt for instance) into the vcproj file so that my Visual Studio users can edit the file from within the IDE. I can’t add them using ADD_LIBRARY or ADD_EXECUTABLE, so how do I register them? This works for me on CMake 2.4.6 and Visual Studio 8: SET_SOURCE_FILES_PROPERTIES(readme.txt PROPERTIES HEADER_FILE_ONLY true) ADD_LIBRARY(foo foo.cc readme.txt) I tried it this morning, and I didn't even need the SET_SOURCE_FILES_PROPERTIES. Sure, but if you do ADD_LIBRARY(foo readme.txt) you get an error. So how do you create a project which only has non-C objects? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Make clean - doesn't clean dependencies.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 01 November 2007 23:09 To: Josef Karthauser; CMake ML Subject: Re: [CMake] Make clean - doesn't clean dependencies. Josef Karthauser wrote: It doesn't appear that a 'make clean' in a subdirectory of the build tree cleans any of the dependencies. Does anyone know of a way that it can be persuaded to? make depend For more info, cmake creates: make help You don't appear to have understood what I was asking. I was talking about clean, not depend. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Make clean - doesn't clean dependencies.
It doesn't appear that a 'make clean' in a subdirectory of the build tree cleans any of the dependencies. Does anyone know of a way that it can be persuaded to? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Fixed : RE: [CMake] Make clean - doesn't clean dependencies.
Sent: 01 November 2007 10:59 It doesn't appear that a 'make clean' in a subdirectory of the build tree cleans any of the dependencies. Does anyone know of a way that it can be persuaded to? I've fixed it, see the attached patch. (I'll also submit this as a bug). Joe fix_clean.patch Description: fix_clean.patch ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Passing a string through a macro, without escaping (\) woes!
I've got a problem with backslashes in strings, and macros This works: SET(PATH c:/test/path) FILE(TO_NATIVE_PATH ${PATH} CPATH) MESSAGE(Path: ${CPATH}) It displays Path: c:\test\path as expected (on windows) However this fails: MACRO(MYMESSAGE MSG) MESSAGE(${MSG}) ENDMACRO(MYMESSAGE MSG) MYMESSAGE(MyPath: ${CPATH}) With the error: syntax error, unexpected cal_ERROR, expecting $end (17), when parsing string MyPath: c:\test\path MyPath: c:\test\path CMake Error: Invalid escape sequence \P How do I prevent the parsing of \P? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Switching off dependencies at compile time (with Makefiles)?
I want to run nmake/make on a cmake generated build tree, but in such a way that only the targets in the current directory get built. That is I want to assume that any libraries that a given project depends on (which have separate CMakeLists.txt files) are already built, and want to suppress nmake from attempting to build them. Is this possible? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Switching off dependencies at compile time (with Makefiles)?
-Original Message- From: David Cole [mailto:[EMAIL PROTECTED] Sent: 26 October 2007 15:04 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Switching off dependencies at compile time (with Makefiles)? - do a make help to get the list of available make targets - use make targetname to build a target and everything it depends on - use make targetname/fast to build just that target make targetname/fast is the friend of the developer who knows what he is doing... :) I guess what I want is an all/fast - to build all the targets in the current directory, but nothing else. joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Calling macros from within macros.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brandon Van Every Sent: 24 October 2007 18:08 To: cmake@cmake.org Subject: [CMake] Calling macros from within macros. On 10/24/07, Alexander Neundorf [EMAIL PROTECTED] wrote: On Wednesday 24 October 2007, Josef Karthauser wrote: Is it not possible to call a variable macroname from within a macro? MACRO(INDIRECT_MACRO MACRONAME LIST) FOREACH(L ${LIST}) ${MACRONAME}(${L}) ENDFOREACH(L) ENDMACRO(INDIRECT_MACRO) INDIRECT_MACRO(MESSAGE ONE TWO THREE) No, variable function/macronames are not supported. Maybe there is already a feature request in the bug tracker for this. Variable *variable* names are certainly possible, however, so that might help with whatever you were trying to do. It doesn't :/ I definitely need macro names to do it neatly. Ho hum, I'll expand them out literally. :) Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Adding a project to a solution.
Hi there again J, With respect to the Visual Studio generators, I'm wondering what logic cmake uses to determine which projects to add to the solution file. I had assumed that anything which was linked as a library was automatically added, but it isn't. Is there an easy way of adding dependences from sibling directories to a solution? Example, Test/ Library/ Project/ Project uses Library, like so: Project/CMakeLists.txt: PROJECT(Project) TARGET_LINK_LIBRARIES(Project Library) However Library.vcproj doesn't show up in Project's solution file. Can I specify that it should, or do I need to hack code? Thanks J Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Adding a project to a solution.
-Original Message- From: David Cole [mailto:[EMAIL PROTECTED] Sent: 25 October 2007 16:28 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Adding a project to a solution. This code: PROJECT(Project) TARGET_LINK_LIBRARIES(Project Library) ...doesn't make sense. The first argument to TARGET_LINK_LIBRARIES should be a cmake target name (first arg to ADD_EXECUTABLE, ADD_LIBRARY or ADD_CUSTOM_TARGET) not a cmake project name... It should be something like: PROJECT(Project) ADD_LIBRARY(ProjectLib lib1.cxx lib2.cxx .) TARGET_LINK_LIBRARIES(ProjectLib Library) If I understand correctly, Project label get used to create sln files, but otherwise aren't used for anything. This means that actually what I had wasn't wrong, as I would generate a Project.sln and a Project.vcproj in my Project/ subdirectory - this sounds reasonable to me. The generated *.vcproj files map one-to-one with cmake targets. (There is one .vcproj file for each ADD_EXECUTABLE, ADD_LIBRARY and ADD_CUSTOM_TARGET command...) Each project statement should map to a .sln file that contains any necessary .vcproj files. I've got that. However, the .sln file doesn't appear to reference the .vcproj files for objects specified in the target_link_libraries. I would expect these to get added too. So, for your (modification of my) example above, the Project.sln file will have a link to ProjectLib.vcproj, but it should also have a link to Library.vcproj (in whatever directory it lives in) to be a complete solution. It doesn't appear from my experimentation that this works - or otherwise something I'm doing is breaking it. The top level project statement is the one that generates the top level .sln file with the ALL_BUILD target that builds *everything*... That I understand, however the sub-projects also want the linked libraries added to their solutions. Does that make sense, or am I smoking crack? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Calling macros from within macros.
Is it not possible to call a variable macroname from within a macro? MACRO(INDIRECT_MACRO MACRONAME LIST) FOREACH(L ${LIST}) ${MACRONAME}(${L}) ENDFOREACH(L) ENDMACRO(INDIRECT_MACRO) INDIRECT_MACRO(MESSAGE ONE TWO THREE) Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Caching calculated values.
-Original Message- From: Amitha Perera [mailto:[EMAIL PROTECTED] Sent: 22 October 2007 18:53 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Caching calculated values. On Mon 22 Oct 2007, Josef Karthauser wrote: As each set of calculations are connected to a single CMakeList.txt file, it should be possible to avoid recalculating, and useing cached values where possible. In order to do that however I need to know whether a CMakeLists.txt file is stale, with respect to the last time it ran, or not. Is there an easy way for me to determine from within a CMakeLists.txt file, whether it is out-of-date? In the VXL project, we use a serial number for that purpose. Something like # The serial number below will allow the maintainers to force builds # to update cached results. Whenever you make a change that makes it # necessary for cached values to be updated, increment the serial # number. The format follows a DNS-style numbering: the current date # followed by a modification time within the day. # SET( VXL_CONFIG_SERIAL_CURRENT 2006-16-03-002 ) In the end I've come up with a method based around dropping a file in each project build directory, and then comparing its time stamp with that of the associated CMakeLists.txt file. Instead of calling PROJECT, I just call GEO_PROJECT. This then manages the correct setting of the relevant USE_CACHE setting for each project, which is utilised elsewhere by the code that needs to avoid doing the work. Joe MACRO(GEO_PROJECT PROJECTNAME) PROJECT(${PROJECTNAME}) DEBUG_MESSAGE(GEO_CACHE_VERBOSE Configuring project ${PROJECTNAME}) # We record the source files in per-project source variablesa # with this prefix. SET(GEO_SOURCE GEO_SOURCE_${PROJECTNAME}) # Create the cache file. SET(GEO_CACHE_FILE ${PROJECT_BINARY_DIR}/source.cached) # If cached file exists, and is younger than CMakeLists.txt then # use the cache. SET(${GEO_SOURCE}_USE_CACHE 0) IF(EXISTS ${GEO_CACHE_FILE}) DEBUG_MESSAGE(GEO_CACHE_VERBOSE Cache exists) DEBUG_MESSAGE(GEO_CACHE_VERBOSE Cmakelists file: ${PROJECT_SOURCE_DIR} CMakeLists.txt) DEBUG_MESSAGE(GEO_CACHE_VERBOSE Geocache file: ${GEO_CACHE_FILE}) IF(NOT ${PROJECT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${GEO_CACHE_FILE}) DEBUG_MESSAGE(GEO_CACHE_VERBOSE CMakelists newer) SET(${GEO_SOURCE}_USE_CACHE 1) ENDIF(NOT ${PROJECT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${GEO_CACHE_FILE}) ENDIF(EXISTS ${GEO_CACHE_FILE}) DEBUG_MESSAGE(GEO_CACHE_VERBOSE Use cache: ${${GEO_SOURCE}_USE_CACHE}) # If not using the cache, then erase the previously cached list # and start again. IF(NOT ${GEO_SOURCE}_USE_CACHE) # Clear the file names SET(${GEO_SOURCE} CACHE INTERNAL FORCE) FOREACH(PFORM ${ALL_PLATFORMS}) SET(${GEO_SOURCE}_${PFORM} CACHE INTERNAL FORCE) ENDFOREACH(PFORM) # Create the cache file. MESSAGE((Re-)Configuring project ${PROJECTNAME}) FILE(WRITE ${GEO_CACHE_FILE} Cache exists) ELSE(NOT ${GEO_SOURCE}_USE_CACHE) DEBUG_MESSAGE(GEO_CACHE_VERBOSE \tUsing cached file list) ENDIF(NOT ${GEO_SOURCE}_USE_CACHE) ENDMACRO(GEO_PROJECT) ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Selecting compiler on Windows platform
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josef Karthauser Sent: 22 October 2007 13:59 To: [EMAIL PROTECTED]; cmake@cmake.org Subject: RE: [CMake] Selecting compiler on Windows platform However, I’d like to control this from within a CMake file, and this doesn’t appear possible. From what I can see, CMakeDetermineCXXCompiler is loaded and executed prior to the CMakeLists.txt file, which means that I cannot set the compiler internally. Is this true, Yes, this is true. One reason is that one build tree must not use several compilers for one language, because all the configure checks are global for one build tree and so the results are only correct for the compiler which was used when they were executed. This seems overly restrictive, a tree might contain a number of sub- trees which use different compilers. Whilst I understand the need to keep things consistent by default, if a user wants to shoot themselves in the foot it ought to be allowed. (Tools not policy! :) I guess I'm going to have to run CMakeDetermineCXXCompiler again myself. :/. For the record, I've solved the problem by setting the environment variables that I require and then running the the determine and test modules again, like so: SET(ENV{CC} gcc) SET(ENV{CXX} g++) INCLUDE(CMakeDetermineCCompiler) INCLUDE(CMakeDetermineCXXCompiler) INCLUDE(CMakeTestCCompiler) INCLUDE(CMakeTestCXXCompiler) This appears to work, although it of course doesn't disable the initial automatic compiler test. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Selecting compiler on Windows platform
-Original Message- From: Josef Karthauser Sent: 23 October 2007 10:29 To: Josef Karthauser; [EMAIL PROTECTED]; cmake@cmake.org Subject: RE: [CMake] Selecting compiler on Windows platform This seems overly restrictive, a tree might contain a number of sub- trees which use different compilers. Whilst I understand the need to keep things consistent by default, if a user wants to shoot themselves in the foot it ought to be allowed. (Tools not policy! :) I guess I'm going to have to run CMakeDetermineCXXCompiler again myself. :/. For the record, I've solved the problem by setting the environment variables that I require and then running the the determine and test modules again, like so: SET(ENV{CC} gcc) SET(ENV{CXX} g++) INCLUDE(CMakeDetermineCCompiler) INCLUDE(CMakeDetermineCXXCompiler) INCLUDE(CMakeTestCCompiler) INCLUDE(CMakeTestCXXCompiler) This appears to work, although it of course doesn't disable the initial automatic compiler test. Actually, this doesn't work. :/ By this time CMake has automatically noticed that I have a working CL.exe in the path, and setup for it. When I then change to gcc, and rerun the Determine and Test scripts it still has a number of variables set which it got by running the Visual C configuration stuff - this causes the later stages of configuration to fail. :/ So I tried another thing, basically setting the correct environment variables from within CMake, and then shelling out to a new CMake to do the correct configuration, like so: # Set correct environment variables, depending upon platform and configuration type, etc. CONFIGURE_COMPILER() # Re-invoke cmake with the correct compiler set populate the build tree IF(NOT GEO_INNER_CMAKE AND NOT GEO_CONFIGURED) EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -DGEO_INNER_CMAKE=1 -DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE}\ -G \${CMAKE_GENERATOR}\ ${CMAKE_HOME_DIRECTORY} ) SET(GEO_CONFIGURED 1 CACHE INTERNAL FORCE) MESSAGE(FATAL_ERROR CMake configure internal loop and exited.) ENDIF(NOT GEO_INNER_CMAKE AND NOT GEO_CONFIGURED) MESSAGE(Inner loop got here.) ADD_SUBDIRECTORIES(...) etc. However now this doesn't work, because although the inner cname does configure correctly and run, the outer one blats the cache file when it exists with the FATAL_ERROR and unconfigures all the projects. :/. Is there a way of causing CMake to exit without touching the cache, so that I can use it to drive an internal cmake? Either that, or what is the correct sequence of modules to run internally, once I've set the correct environment variables, to get it to reconfigure the compiler. I'd really appreciate some help with this. The problem I'm trying to solve is how to set up a number of configurations/build trees, each configured for a different compiler, from a single source tree. I want to describe the compilers from within CMake; obviously I could create an external batch file, but then I'd have some compiler stuff (like library paths, include paths, etc) in the CMakeLists.txt file, and some info like ENV{PATH}, ENV{CC}, ENV{CXX} in the batch file. I really want it all in a single place. Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Selecting compiler on Windows platform
I’m a bit confused, as ever ☺. I’ve got a number of windows compilers, cl and gcc for instance, and I want to specify which one I want to use. I can do this using an environment variable thus, % env CXX=gcc cmake –G’NMake Makefiles’ . which allows CMakeDetermineCXXCompiler.cmake to override the ‘cl’ default that the NMake generator sets. However, I’d like to control this from within a CMake file, and this doesn’t appear possible. From what I can see, CMakeDetermineCXXCompiler is loaded and executed prior to the CMakeLists.txt file, which means that I cannot set the compiler internally. Is this true, or is there something I’m not aware of? What I’d like to do is something like: CMakeLists.txt: IF(... some condition ...) SET(ENV{CXX} “gcc”) ELSE SET(ENV{CXX} “cl”) ENDIF(... some condition ...) ... NORMAL BUILD RULES ... Should this be possible? If not, I’ll have to wrap the contents of the CMakeLists file with a IF(INNERLOOP) and then call CMake –DINNERLOOP=1 from within the CMakeLists.txt file, after setting the environment variable, which is a bit gnarly. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Selecting compiler on Windows platform
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 22 October 2007 13:36 To: cmake@cmake.org Subject: Re: [CMake] Selecting compiler on Windows platform On Monday 22 October 2007 11:34, Josef Karthauser wrote: ... However, I’d like to control this from within a CMake file, and this doesn’t appear possible. From what I can see, CMakeDetermineCXXCompiler is loaded and executed prior to the CMakeLists.txt file, which means that I cannot set the compiler internally. Is this true, Yes, this is true. One reason is that one build tree must not use several compilers for one language, because all the configure checks are global for one build tree and so the results are only correct for the compiler which was used when they were executed. This seems overly restrictive, a tree might contain a number of sub-trees which use different compilers. Whilst I understand the need to keep things consistent by default, if a user wants to shoot themselves in the foot it ought to be allowed. (Tools not policy! :) I guess I'm going to have to run CMakeDetermineCXXCompiler again myself. :/. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] NMake questions if I may.
Do we have any NMake users out there? I'm sure someone might be able to answer this for me. It looks like in the past NMake had a -J option, which like the -j of gnu's gmake, causes parallel compilation where possible. This appears to be missing with the NMake I've got with Visual Studio 2005 though. Was it ever there, is there a version with it in? Where did it go? Also, bsdmake has a useful -k option which causes make to continue to compile things, even if one of the targets is broken in some way (-k == continue in spite of errors). Does anyone know whether there is an equivalent for NMake? Thanks in advance, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] NMake questions if I may.
From: David Cole [mailto:[EMAIL PROTECTED] Sent: 22 October 2007 14:29 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] NMake questions if I may. nmake /? in a visual studio command prompt should look something like this: C:\Program Files\Microsoft Visual Studio 8\VCnmake /? Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. Usage: NMAKE @commandfile NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets] Options: [CUT] /K Build unrelated targets on error [CUT] As you can see, /K is build unrelated targets on error (in other words, targets that do not depend on the failed target...) Hmm, interesting. I'm running nmake /K on a CMake built tree, but doesn't appear to proceed to the next build target when a failure occurs on my custom target: Compilation failed with 24 errors Compilation failed NMAKE : fatal error U1077: '..\..\..\..\..\Bin\RsxFxCompiler.EXE' : return code '0x1' Stop. NMAKE : fatal error U1077: 'c:\Program Files\Microsoft Visual Studio 8\VC\BIN\n make.exe' : return code '0x2' Stop. NMAKE : warning U4010: 'all' : build failed; /K specified, continuing ... NMAKE : warning U4011: 'default_target' : not all dependents available; target not built Does the top level makefile call NMake on sub-makefiles? It should probably propagate the /K flag down. Is that what's happening I wonder. As far as we know, nmake does not support parallel builds... if you find out otherwise, please post back to the list and share the information ? with all of us...! I did a search on the net, and found documentation that stated that NMake did support /J. My assumption is that somehow it got removed, or that the documentation was in error. I think I'm probably going to have to migrate to gmake if this proves to be a problem for me. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Checking to see if a filename is of a given file type.
Is there a canonical way of matching a filename against a number of filetypes? I have a list of files MY_FILES, and I'd like to efficiently extract those which match a given list of filename extensions, in otherwords something like this: SET(ALL_FILES_VAR this.c that.cpp something.h test.dat readme.txt) SET(EXTENSIONS c cpp) MATCH_FILES(MATCHED_FILES_VAR ALL_FILES_VAR EXTENSIONS) MESSAGE(Should just contain this.c that.cpp : ${MATCHED_FILES_VAR}) The problem I'm trying to solve is, given a list of files, run a specific custom target generator for all those of a given type. Something like this: MAKE_TARGETS(HANDLER LIST_OF_FILES EXTENSION_FILTER) Or explicitly MAKE_TARGETS(DOXIGEN LIST_OF_FILES c cpp) or MAKE_TARGETS(LATEX LIST_OF_FILES tex tek) Any thought would be very welcomely received. It maybe I'm trying to reinvent the wheel here. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Marking a library dependency from within a library.
I have a library (libA), which depends upon another library (libB) for its implementation.I also have an executable (execC) which uses LibA. Is there an easy way of getting LibB added to the list of dependencies, so what when I do Add_Executable(exeC) Target_Link_Libraries(exeC libA) it knows (because of definitions in the CMakeLists.txt for libA) that it should also link libB? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Getting a list of all the variables.
How do I get a list of all variables currently defined within a run of CMake? Is there any easy way of dumping all the variables and their values, at the end of a CMakeLists.txt file for instance? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMAKE_PROJECT_NAME
Isn't the value of CMAKE_PROJECT_NAME supposed to contain the name given to the last PROJECT() call? It appears with the current version of CMAKE that it gets the value of the first call to PROJECT, and isn't subsequently updated. For example: CMakeLists.txt: Project(foo) MESSAGE(${CMAKE_PROJECT_NAME}) Project(bar) MESSAGE(${CMAKE_PROJECT_NAME}) Outputs: foo foo when run. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Overriding default source groups
I'm wondering what the best way to override the default 'Header Files' and 'Source Files' SOURCE_GROUPs? I'm creating SOURCE_GROUPs by hand, and I don't want the default ones to be active. Looking at the code, I think it might require a source hack, but I thought I'd better check first. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Changing VS2005 Configuration
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jakob Santner Sent: 12 October 2007 07:40 To: cmake@cmake.org Subject: [CMake] Changing VS2005 Configuration Hello, I am using Visual Studio 8 and cmake 2.4p7 and am trying to set the configuration for a specific project to 'Release'. So I added SET(CMAKE_BUILD_TYPE Release) to CMakeLists.txt and ran cmake. The Visual Studio configuration manager still lists all projects in 'Debug' configuration. What am I doing wrong? For visual studio project files, you can set the configurations to include using the CMAKE_CONFIGURATION_TYPES variable. SET(CMAKE_CONFIGURATION_TYPES Release) Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Excluding a file from a particular configuration with Visual Studio
In my patched version at: svn co svn://svn.luaplus.org/CMake/patches/All CMake There is a new source file property called EXCLUDED_FROM_BUILD. SET_SOURCE_FILES_PROPERTIES($(MY_SRCS) PROPERTIES EXCLUDED_FROM_BUILD true) This handles Visual Studio .vcproj files, but it doesn't handle it on a per configuration basis. The patch may get you halfway there, though. Brill, I'll check it out. Ta. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Excluding a file from a particular configuration with Visual Studio
What's the canonical way of marking a file as being excluded from a given Visual Studio configuration? Is there one? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Excluding a file from a particular configuration with Visual Studio
-Original Message- From: Sylvain Benner [mailto:[EMAIL PROTECTED] Sent: 12 October 2007 13:00 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Excluding a file from a particular configuration with Visual Studio What's the canonical way of marking a file as being excluded from a given Visual Studio configuration? No this is not supported. I think it's better to use preprocessor to do this kind of stuff. Maybe, but I'm going to do something a bit more snazzy. I've got a number of configurations, for which I'm creating NMake build trees. However I'm also populating the source tree with vcproj/sln files, which run an 'nmake' to do the build. It would be useful for those vcprojs to indicate which files are included in which target configurations, as it is how the developers are currently used to working. I'll hack the source to add this functionality. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] A nice fix for windows cl compilation (to support XBox360 for instance)
Hey there, I've submitted a patch to the bug tracker, under number 0005865, for people who generate make/nmake files under Windows with the Microsoft compiler (cl.exe). The old behaviour was that the linker (link.exe) was picked up from the path at compile time. The new behaviour is that it is assumed to be in the same location as the compiler. This means that it is now trivial to compile Xbox360 stuff, for instance. Just add this to your CMakeFiles.txt: SET(ENV{PATH} C:/Program Files/Microsoft Xbox 360 SDK/bin/win32/;$ENV{PATH}) This puts the xbox compiler in the path before the win32 compiler, which means cmake will find that one. Then at nmake time it doesn't matter what is in the path, as with the patch the linker (link.exe) used will be the correct one (in the same directory as the cl.exe) instead of the one in the path, which is probably the win32 one. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Turning a string into a list.
Does anyone know how to turn a string, such as one;two;three into a list, so that I can enumerate the elements in a list? I want something like: SET(Q one;two;three) FOREACH(I TO_LIST(Q)) ... ENDFOREACH(). Ah, ignore me. Of course I just expand the string: SET(Q one;two;three) FOREACH(I ${Q}) ... ENDFOREACH(). Sorry for the noise. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Turning a string into a list.
Does anyone know how to turn a string, such as one;two;three into a list, so that I can enumerate the elements in a list? I want something like: SET(Q one;two;three) FOREACH(I TO_LIST(Q)) ... ENDFOREACH(). Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Removing the first element from a list
How does one go about removing the first element of a list? I want to make a state machine, something like: WHILE(${LISTVAR}) # Get command from first entry SHIFT(CMD ${LISTVAR}) # Get argument SHIFT(CMD ${LISTVAR} # Consume . ENDWHILE() Where SHIFT is the magic to remove the first element from the list. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Removing the first element from a list
-Original Message- From: Sylvain Benner [mailto:[EMAIL PROTECTED] Sent: 11 October 2007 16:16 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Removing the first element from a list How does one go about removing the first element of a list Have a look to the LIST command, you'll have everything you need. Any idea why this works, MACRO(TEST) SET(Q ${ARGN}) WHILE(${Q}) # Get the command LIST(GET Q 1 CMD) LIST(REMOVE_AT Q 1) MESSAGE(Command was ${CMD}) ENDWHILE(Q) ENDMACRO(TEST) TEST(NOT A B NOT C D CLEAR) But this doesn't? MACRO(SHIFT RESULT LISTVAR) LIST(GET LISTVAR 1 RESULT) LIST(REMOVE_AT LISTVAR 1) ENDMACRO(SHIFT) MACRO(TEST) SET(Q ${ARGN}) WHILE(${Q}) # Get the command SHIFT(CMD Q) MESSAGE(Command was ${CMD}) ENDWHILE(Q) ENDMACRO(TEST) TEST(NOT A B NOT C D CLEAR) Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Removing the first element from a list
How does one go about removing the first element of a list Have a look to the LIST command, you'll have everything you need. Fantastic. That's not described in the book :). Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Removing the first element from a list
From: Sylvain Benner [mailto:[EMAIL PROTECTED] Sent: 11 October 2007 16:40 To: Josef Karthauser Cc: cmake@cmake.org Subject: Re: [CMake] Removing the first element from a list correction: MACRO(SHIFT RESULT LISTVAR) LIST(GET ${LISTVAR} 1 ${RESULT}) LIST(REMOVE_AT ${LISTVAR} 1) ENDMACRO(SHIFT) rule: Dereferencing a macro variable gives you the variable name. Dereferencing twice gives you the value of the passed variable. The other way is to call your original macro like this : SHIFT(${CMD} ${Q}) Thanks muchly. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Calling cmake from within cmake.
I want to recursively call cmake from a cmakelists.txt file to create build directories for other projects. I'm sure I saw something in the docs that suggested a neat way of doing it that didn't involve executing cmake explicitly as an external command, but I can't find it now I look again. Can anyone tell me what it is off the top of their heads please? Ta, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Calling cmake from within cmake.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josef Karthauser Sent: 08 October 2007 16:36 To: cmake@cmake.org Subject: [CMake] Calling cmake from within cmake. I want to recursively call cmake from a cmakelists.txt file to create build directories for other projects. I'm sure I saw something in the docs that suggested a neat way of doing it that didn't involve executing cmake explicitly as an external command, but I can't find it now I look again. Can anyone tell me what it is off the top of their heads please? In the mean time I'm doing, EXEC_PROGRAM(${CMAKE_COMMAND} ${CONFIG_SUBDIR}/${CONFIG} ARGS -G NMake Makefiles -DCMAKE_BUILD_TYPE=${CONFIG} -DBUILD_SUBTREE=1 ${CMAKE_HOME_DIRECTORY} ) However that doesn't work because the double quotes aren't escaped. How do I escape quotes in cmake? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Removing configurations.
Quick question if I may. I can add a configuration by using following the instructions here: http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_wit h_a_custom_made_one_.3F How do I go about removing an existing one? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Supported configurations with Visual Studio builds
I’m confused (not for the first time! ☺). Why is it that cmGlobalVisualStudio7Generator only supports DEBUG, RELEASE, MINSIZEREL and RELWITHDEBINFO? They’re mostly placeholders anyway so it seems wierd that they are hardcoded and enforced. Is this a bug or a feature, does anyone know? If I rip out the checks in cmGlobalVisualStudio7Generator:: GenerateConfigurations is anything going to break? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Supported configurations with Visual Studio builds
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josef Karthauser Sent: 05 October 2007 15:44 To: cmake@cmake.org Subject: [CMake] Supported configurations with Visual Studio builds I’m confused (not for the first time! ☺). Why is it that cmGlobalVisualStudio7Generator only supports DEBUG, RELEASE, MINSIZEREL and RELWITHDEBINFO? They’re mostly placeholders anyway so it seems wierd that they are hardcoded and enforced. Is this a bug or a feature, does anyone know? If I rip out the checks in cmGlobalVisualStudio7Generator:: GenerateConfigurations is anything going to break? It looks like simply removing the hard coded test fixes the issue. I've raised a bug report in ticket 0005829. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Removing configurations.
I can add a configuration by using following the instructions here: http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_wit h_a_custom_made_one_.3F How do I go about removing an existing one? Answering my own question, I now see I don't need to. Instead I just define the configurations I'm interested in using the CMAKE_CONFIGURATION_TYPES variable. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Multiple makefile builds in a single in-source tree.
I'm trying to determine how much work is required modify cmake to support in-source build trees for multiple Makefile configurations. Currently, given a source tree such as: Source/ Proj1/ Proj2/ with CMakeLists.txt files at each level, it is possible to configure a Makefile style build tree in-source, by use of % cd Source % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RELEASE for a single configuration type, or out-of-tree using % cd Source % (mkdir release; cd release; cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RELEASE) % (mkdir debug; cd debug; cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=DEBUG) to create separate file trees configured for each kind of configuration. What I would like to do is to enable in-source build trees which support multiple configurations in a single tree. I have a proposal for how it would work, but I don't know how much of a change to the cmake code it would take to support it. The current in-source layout of a build tree looks like: Source/ CMakeLists.txt CMakeCache.txt CMakeFiles/ ... where the objects are built. Makefile Proj1/ CMakeLists.txt CMakeFiles/ ... Makefile Proj2/ CMakeLists.txt CMakeFiles/ ... Makefile What I want to be able to do is to generate 'Makefile' and 'CMakeFiles/' in a subdirectory of each directory, so if I ran for example: % cd Source % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=DEBUG - DCMAKE_INLINE_BUILD_PREFIX =DEBUGBUILD it would build the in-line tree configured for DEBUG, Source/ DEBUGBUILD/CMakeLists.txt DEBUGBUILD/CMakeCache.txt DEBUGBUILD/CMakeFiles/ ... where the objects are built. DEBUGBUILD/Makefile Proj1/ DEBUGBUILD/CMakeLists.txt DEBUGBUILD/CMakeFiles/ ... DEBUGBUILD/Makefile Proj2/ DEBUGBUILD/CMakeLists.txt DEBUGBUILD/CMakeFiles/ ... DEBUGBUILD/Makefile Of course the relative paths would be wired so as to allow it to be built by, % cd Source/DEBUGBUILD % make If this was possible, then a number of parallel configuration trees could be built: % cd Source % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INLINE_BUILD_PREFIX=DEBUGBUILD % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INLINE_BUILD_PREFIX=RELEASEBUILD generating, Source/ DEBUGBUILD/ RELEASEBUILD/ Proj1/ DEBUGBUILD/ RELEASEBUILD/ Proj2/ DEBUGBUILD/ RELEASEBUILD/ It would then be a simple step to insert Makefiles in the usual places that they lived, allowing: % cd Source % make DEBUG RELEASE or % make all or something. Can someone with a familiarity with the cmake code base point me in the right direction to implement this please? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Multiple makefile builds in a single in-source tree.
I'm trying to determine how much work is required modify cmake to support in-source build trees for multiple Makefile configurations. Currently, given a source tree such as: Source/ Proj1/ Proj2/ with CMakeLists.txt files at each level, it is possible to configure a Makefile style build tree in-source, by use of % cd Source % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RELEASE for a single configuration type, or out-of-tree using % cd Source % (mkdir release; cd release; cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RELEASE) % (mkdir debug; cd debug; cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=DEBUG) to create separate file trees configured for each kind of configuration. What I would like to do is to enable in-source build trees which support multiple configurations in a single tree. I have a proposal for how it would work, but I don't know how much of a change to the cmake code it would take to support it. The current in-source layout of a build tree looks like: Source/ CMakeLists.txt CMakeCache.txt CMakeFiles/ ... where the objects are built. Makefile Proj1/ CMakeLists.txt CMakeFiles/ ... Makefile Proj2/ CMakeLists.txt CMakeFiles/ ... Makefile What I want to be able to do is to generate 'Makefile' and 'CMakeFiles/' in a subdirectory of each directory, so if I ran for example: % cd Source % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=DEBUG - DCMAKE_INLINE_BUILD_PREFIX =DEBUGBUILD it would build the in-line tree configured for DEBUG, Source/ DEBUGBUILD/CMakeLists.txt DEBUGBUILD/CMakeCache.txt DEBUGBUILD/CMakeFiles/ ... where the objects are built. DEBUGBUILD/Makefile Proj1/ DEBUGBUILD/CMakeLists.txt DEBUGBUILD/CMakeFiles/ ... DEBUGBUILD/Makefile Proj2/ DEBUGBUILD/CMakeLists.txt DEBUGBUILD/CMakeFiles/ ... DEBUGBUILD/Makefile Of course the relative paths would be wired so as to allow it to be built by, % cd Source/DEBUGBUILD % make If this was possible, then a number of parallel configuration trees could be built: % cd Source % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INLINE_BUILD_PREFIX=DEBUGBUILD % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INLINE_BUILD_PREFIX=RELEASEBUILD generating, Source/ DEBUGBUILD/ RELEASEBUILD/ Proj1/ DEBUGBUILD/ RELEASEBUILD/ Proj2/ DEBUGBUILD/ RELEASEBUILD/ It would then be a simple step to insert Makefiles in the usual places that they lived, allowing: % cd Source % make DEBUG RELEASE or % make all or something. Can someone with a familiarity with the cmake code base point me in the right direction to implement this please? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Building both make files and visual studio files.
Hello again, I'm wondering what the best way to going about producing make files and visual studio files at the same time is. I want to use nmake to build my tree, but want visual studio project files so that the developers can continue to with within the visual studio environment, which would call the make as an external build tool. Does anyone do anything like this? I'm really new to cmake, and so am still working out the ropes. I apologise if this is a really obvious question. Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Building both make files and visual studio files.
-Original Message- From: Torsten Martinsen [mailto:[EMAIL PROTECTED] Sent: 01 October 2007 14:43 To: Josef Karthauser; Cmake Mailing List Subject: RE: [CMake] Building both make files and visual studio files. Josef Karthauser wrote: Hello again, I'm wondering what the best way to going about producing make files and visual studio files at the same time is. I want to use nmake to build my tree, but want visual studio project files so that the developers can continue to with within the visual studio environment, which would call the make as an external build tool. I would recommend to set up CMake to generate .vcproj files, and use those both for the IDE and for command-line builds (using vcbuild.exe or devenv.exe). Alas I don't think that that is going to be flexible enough. In order to do that we would need more flexibility within cmake for the generation of the vcproj files, as it only knows about conventional builds. For example Xbox360 builds don't have a VCCLCompilerTool, instead having a VCCLX360CompilerTool. I guess that answers my question - If I want custom vcproj files I'll have to write them myself, somehow. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMAKE_BUILD_TYPE and Makefiles
Am I correct in thinking that cmake doesn't support build types for make files? It doesn't seem to matter what I do with CMAKE_CONFIGURATION_TYPES, when I generate a set of make files, they appear to be created for a single generic target. Is there a 'canonical' way of coaxing cmake to generate make files for different configurations? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Confikgurations and Platforms in Visual Studio 8
I'm looking at cmake as a potential solution to some build problems I'm having. Am I right in thinking that cmake only allows for four hard-coded configuration labels, DEBUG/RELEASE/etc? Where should I look to add to these, as we've got more configurations than this. Also, does cmake have an idea of platforms, or does it assume Win32? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Confikgurations and Platforms in Visual Studio 8
I'm looking at cmake as a potential solution to some build problems I'm having. Am I right in thinking that cmake only allows for four hard-coded configuration labels, DEBUG/RELEASE/etc? Where should I look to add to these, as we've got more configurations than this. http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_wit h_a_custom_made_one_.3F Brilliant, that looks good. Also, does cmake have an idea of platforms, or does it assume Win32? CMake does not assume anything about Win32 or any other platform. What I mean is, in vcproj files combine the configuration and the platform labels to form a compilation target, i.e Release|Win32, Debug|x64. How do I go about specifying the platform parts of these with cmake? For example, I say I have 'Release', 'Debug', and 'Special' configurations, and Win32 and x64 platforms. Now suppose that I only support the following configurations: Release|Win32 Release|x64 Debug|Win32 Debug|x64 Special|x64 How do I go about specifying that to cmake? Much appreciated, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Confikgurations and Platforms in Visual Studio 8
Also, does cmake have an idea of platforms, or does it assume Win32? CMake does not assume anything about Win32 or any other platform. What I mean is, in vcproj files combine the configuration and the platform labels to form a compilation target, i.e Release|Win32, Debug|x64. How do I go about specifying the platform parts of these with cmake? For example, I say I have 'Release', 'Debug', and 'Special' configurations, and Win32 and x64 platforms. Now suppose that I only support the following configurations: Release|Win32 Release|x64 Debug|Win32 Debug|x64 Special|x64 How do I go about specifying that to cmake? Looking at the source, it appears (from cmLocalVisualStudio7Generator.cxx) that cmake assumes that visual studio only supports 'x64', 'ia64' and 'win32' as target platforms, and that this can only be changed in code. Is this right? Three questions then, if I may: * How do I go about specifying a particular platform in the CMakeList.txt file? * What is the easiest way to add additional platform support; can this only happen through modifying the code, or is there some other magic that can be done. (Other embedded platforms exist in VC8, which we're targeting). * Are these issues dealt with in the book? Or is there some other on-line documentation that I'm missing? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Building both make and vcproj files.
This may be common knowledge already, but I was wondering what the best way to get cmake to build both unix make files and visual studio files for the same project is. I'd like to use makefiles for building my project, but I still need vcproj files so that the developers can use visual studio for writing and debugging the code. The vcproj files would be Make projects, shelling out to call the command line make. Does anyone here already do something like this? Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Confikgurations and Platforms in Visual Studio 8
Also, does cmake have an idea of platforms, or does it assume Win32? CMake does not assume anything about Win32 or any other platform. What I mean is, in vcproj files combine the configuration and the platform labels to form a compilation target, i.e Release|Win32, Debug|x64. How do I go about specifying the platform parts of these with cmake? For example, I say I have 'Release', 'Debug', and 'Special' configurations, and Win32 and x64 platforms. Now suppose that I only support the following configurations: Release|Win32 Release|x64 Debug|Win32 Debug|x64 Special|x64 How do I go about specifying that to cmake? Answering my own question, after a bit of research, it appears that cmake doesn't natively deal with cross-platform building for Visual Studio Projects. Instead it tests to see whether to generate Win32 or x64 project file configurations. In the environment we've got, we want to build Win32, Xbox 360 and Playstation 3 binaries, all from a Win32 box. I wonder what the best way to tweak cmake to do this is. My first thoughts are to do away with Visual Studio altogether, as its vcproj files are pretty hard coded into cmake. Instead I'm playing with using a traditional make, but I still need vcproj external make files, as the developers are using visual studio. I've ordered the book - perhaps I'll get some hints from there. I'd be interested in hearing from anyone who is already doing this kind of thing. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake