[cmake-developers] [CMake 0012954]: cmake does not properly detect shared libraries on OpenBSD 5.0
The following issue has been SUBMITTED. == http://www.cmake.org/Bug/view.php?id=12954 == Reported By:Eric Anderson Assigned To: == Project:CMake Issue ID: 12954 Category: CMake Reproducibility:always Severity: major Priority: normal Status: new == Date Submitted: 2012-02-10 19:44 EST Last Modified: 2012-02-10 19:44 EST == Summary:cmake does not properly detect shared libraries on OpenBSD 5.0 Description: cmake does not properly detect shared libraries on OpenBSD 5.0. Shared libraries on that platform always end in .so.#.# When detecting shared libraries, cmake only considers files that end in .so Therefore in cmComputeLinkInformation::AddLibraryRuntimeInfo, libraries will not be considered for adding rpath information. Simplest fix is to put: LIST(APPEND CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES .so.[0-9]+.[0-9]+) Into some module, e.g. OpenBSD.cmake; there may be a better fix. I also tried CMAKE_SHARED_LIBRARY_SUFFIX, but that caused shared libraries to not build. Steps to Reproduce: Put a required shared library in a non-standard path. Setup cmake to include the rpath in the build tree: SET(CMAKE_SKIP_BUILD_RPATH FALSE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) Add a target that depends on that non-standard path Build the target Run ldd on the built executable (or try to execute it), it will fail to link to the special path. Note that if you set CMAKE_INSTALL_RPATH to include the non-standard path, the installed binary will work fine. == Issue History Date ModifiedUsername FieldChange == 2012-02-10 19:44 Eric Anderson New Issue == -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[CMake] ansi color
I'd like to be able to pipe cmake output and still have the ansi color codes when the output is not TTY, is there a way to do this? Thanks, Matt -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Copying Files into build-dir under Visual Studio vs. Codeblocks/Win32 vs. Codeblocks/Linux
2012/2/10 Stefan Fendt ste...@sfendt.de: Hi, I'm (still) quite unsure if this isn't an FAQ (or if not maybe should be one), but I have read through everything I could google-up regarding this topic and found nothing usable... I'm writing an x-platform-project which will be compiled using different compilers and or under different systems... for this project I am required to move some files from some location (source/data) into the build-directory. Whileas this works under Linux/Codeblocks/GCC as well as Windows/Codeblocks/MinGW it doesn't for Visual Studio... Under Visual Studio the files always are copied to some directory-location directly above the actual binary-directory. I've tried using ${CMAKE_CURRENT_BINARY} and it copies the files to the marked position: build/ --- copies into this directory build/Debug build/Release build/source After that I tried to do it with GET_TARGET_PROPERTY(... PROPERTY LOCATION). I then get something like this... 'build/$(Configuration)' ...which of course doesn't solve the problem, too... because the configuration under Visual Studio is only known after CMake-Generation of the solution and running the compiler... So, what is the suggested method of (if you can't avoid it) copying files from anywhere into the build-directory, which is as compiler agnostic as possible..? You may use CMAKE_CFG_INTDIR. Try: cmake --help-variable CMAKE_CFG_INTDIR You'll get some example with custom command/target. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMake with icc via configuration options when needing interprocedural optimization?
Thank you so much for the hint. Setting the environment variable CXX from within my CMakeLists.txt via SET(ENV{CXX} icpc) but before any call to project() or enable_language() seems indeed to do the trick. Setting CMAKE_CXX_FLAGS_RELEASE or CMAKE_CXX_FLAGS_DEBUG at this stage however does not work. This apparently needs to go after the project() statement. I could of course set the environment cxx-flags in the same way as above. This would somewhat sacrifice the nice RELEASE / DEBUG distinction but maybe this can be done by some if-statements (there certainly is a way to query the CMAKE_BUILD_TYPE variable, right?). Cheers, Oliver 2012/2/9 Michael Hertling mhertl...@online.de On 02/07/2012 02:43 PM, janitor 048 wrote: Hello, this is a question I recently asked on stackoverflow ( http://stackoverflow.com/questions/9129233/recommended-ways-to-use-cmake-with-icc-via-configuration-options ) but that has not received any response since then. Maybe this mailing list is a better place to ask... Here goes I would like to use the Intel compiler icc (or icpc) with a CMake-based project (on Linux for what it's worth). I can of course export the CXX variable when calling cmake, e.g. like CXX=icpc cmake ../ and this works fine. I would however like to make this choice available via a custom option. For this I parse custom option, e.g. cmake -DMY_COMPILER_OPTION=Intel .. as IF (MY_COMPILER_OPTION STREQUAL Intel) MESSAGE(STATUS ** Compiling with Intel settings **) SET(CMAKE_CXX_COMPILER icpc) SET(CMAKE_CXX_FLAGS_RELEASE -O3 -w) SET(CMAKE_CXX_FLAGS_DEBUG -g) ENDIF () and set CMAKE_CXX_COMPILER together with some compiler flags. This also works, however there is an important but. I would also like to use the option -ipo (interprocedural optimization) for my code when compiling with icc plus I need to compile a static library within the build process. For this to work, I need to use Intel's xiar (and also xilink I guess). cmake actually offers a special property for this set_property(TARGET mytarget PROPERTY INTERPROCEDURAL_OPTIMIZATION 1) however this only seems to works properly when the compiler has been set via the environment variable (then xiar is used). When setting the compiler via CMAKE_CXX_COMPILER this property is ignored. Is there another way to do this?. Some recommended way? Or at least a work-around? If it actually works well when the compiler is specified via the respective environment variable, you might try the following: IF (MY_COMPILER_OPTION STREQUAL Intel) MESSAGE(STATUS ** Compiling with Intel settings **) SET(ENV{CXX} icpc) SET(CMAKE_CXX_FLAGS_RELEASE -O3 -w) SET(CMAKE_CXX_FLAGS_DEBUG -g) ENDIF () However, note that you must do this *before* the language is enabled, i.e. before the PROJECT() or ENABLE_LANGUAGE() commands. Note further that this can be done only for the *initial* configuration of a build tree; afterwards, the compiler can't be changed anymore. In order to make that approach more robust, you might consider some refinements: IF (MY_COMPILER_OPTION STREQUAL Intel) FIND_PROGRAM(ICPC_PROGRAM icpc ...) IF(ICPC_PROGRAM) MESSAGE(STATUS ** Compiling with Intel settings **) IF(ENV{CXX}) MESSAGE(WARNING Overwriting CXX envvar) ENDIF() SET(ENV{CXX} ${ICPC_PROGRAM}) SET(CMAKE_CXX_FLAGS_RELEASE -O3 -w) SET(CMAKE_CXX_FLAGS_DEBUG -g) ELSE() MESSAGE(FATAL_ERROR Intel compiler not found) ENDIF() ENDIF () Regards, Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake presentation/tutorial in Toulouse/France (8thFebruary)
2012/2/10 aaron.mead...@thomsonreuters.com: I went through the slides; pretty good introduction-intermediate presentation. Thank you, and yes that was pretty much the target. We did dive into some more advanced feature on-demand during the presentation. I'm forwarding it to all the teams I work with here! If someone has remarks may be the more suitable way would be to file an issue on github: https://github.com/TheErk/CMake-tutorial/issues -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake presentation/tutorial in Toulouse/France (8thFebruary)
I did the same. And besides being a good CMake tutorial this is also awesome example how to make presentations with Latex :) Thanks for sharing sources. On Fri, Feb 10, 2012 at 4:03 AM, aaron.mead...@thomsonreuters.com wrote: I went through the slides; pretty good introduction-intermediate presentation. I'm forwarding it to all the teams I work with here! Aaron Meadows -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Eric Noulard Sent: Thursday, February 09, 2012 3:26 PM To: CMake ML Subject: Re: [CMake] CMake presentation/tutorial in Toulouse/France (8thFebruary) 2012/1/29 Eric Noulard eric.noul...@gmail.com: Hi All, Just a small advertisement. I will be giving a CMake presentation tutorial in Toulouse/France on February 8th, 2012: http://www.toulibre.org/evenements_a_venir À 20h00 Éric Noulard présentera CMake, outil de compilation et de test multi-plateforme. Presentation will be given in French. This is done and it was nice (at least from my side) The slides (in english) are here: http://noulard.name/CMake/CMake-tutorial-8feb2012.pdf The material I used for making the presentation is available here: http://noulard.name/CMake/CMake-tutorial-8feb2012.tar.bz2 and may be cloned/forked from github as well: https://github.com/TheErk/CMake-tutorial feel free to re-use/improve it. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMake with icc via configuration options when needing interprocedural optimization?
Thank you so much for the hint. Setting the environment variable CXX from within my CMakeLists.txt via SET(ENV{CXX} icpc) but before any call to project() or enable_language() seems indeed to do the trick. Setting CMAKE_CXX_FLAGS_RELEASE or CMAKE_CXX_FLAGS_DEBUG at this stage however does not work. This apparently needs to go after the project() statement. I could of course set the environment cxx-flags in the same way as above. This would somewhat sacrifice the nice RELEASE / DEBUG distinction but maybe this can be done by some if-statements (there certainly is a way to query the CMAKE_BUILD_TYPE variable, right?). if (CMAKE_BUILD_TYPE STREQUAL Debug) ... But noone stops you to put another if(Intel) behind the project() call to finish what you began before the project(). Eike -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake presentation/tutorial in Toulouse/France (8thFebruary)
2012/2/10 Yuri Timenkov y...@timenkov.ru: I did the same. And besides being a good CMake tutorial this is also awesome example how to make presentations with Latex :) Thanks for that too. Non mentionning that I did not have enough time to add the extra eye-candy animation using an impressive info file, see: http://impressive.sourceforge.net/. You would be surprised by the possibilities offered by the latex beamer+ impressive. Stopping here because I'm really going off-topic. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Copying Files into build-dir under Visual Studio vs. Codeblocks/Win32 vs. Codeblocks/Linux
(Wow, Eric, I didn't know about CMAKE_CFG_INTDIR! Seems like you are teaching me all kinds of things this week...) It sounds like what you are missing is having the command executed by Visual Studio, so it can do the substitution of the $(Configuration) variable, which is why you need to use the add_custom_command() function. As a side note, I've had to deal with this problem before and have handled it in a couple of different ways, depending on what I was trying to accomplish: 1) Finding DLLs -- for UnitTests that are run automatically, I write scripts ahead of time into directories for each configuration type which append the paths where various 3rd Party DLLs are stored, then execute those scripts as part of a post build event to run the UnitTest. 2) Test Data -- I use one of two methods: a) Copy all the data into each of the configuration directories ahead of time (by iteration over CMAKE_CONFIGURATION_TYPES). This saves needing to copy the identical file from a source data directory to a binary directory over and over each time I build. b) I change the executable so I can pass it a data directory to read from. This saves making many copies of identical data for each different configuration type. Hope that helps! Aaron Meadows -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Eric Noulard Sent: Friday, February 10, 2012 2:42 AM To: Stefan Fendt Cc: cmake@cmake.org Subject: Re: [CMake] Copying Files into build-dir under Visual Studio vs. Codeblocks/Win32 vs. Codeblocks/Linux 2012/2/10 Stefan Fendt ste...@sfendt.de: Hi, I'm (still) quite unsure if this isn't an FAQ (or if not maybe should be one), but I have read through everything I could google-up regarding this topic and found nothing usable... I'm writing an x-platform-project which will be compiled using different compilers and or under different systems... for this project I am required to move some files from some location (source/data) into the build-directory. Whileas this works under Linux/Codeblocks/GCC as well as Windows/Codeblocks/MinGW it doesn't for Visual Studio... Under Visual Studio the files always are copied to some directory-location directly above the actual binary-directory. I've tried using ${CMAKE_CURRENT_BINARY} and it copies the files to the marked position: build/ --- copies into this directory build/Debug build/Release build/source After that I tried to do it with GET_TARGET_PROPERTY(... PROPERTY LOCATION). I then get something like this... 'build/$(Configuration)' ...which of course doesn't solve the problem, too... because the configuration under Visual Studio is only known after CMake-Generation of the solution and running the compiler... So, what is the suggested method of (if you can't avoid it) copying files from anywhere into the build-directory, which is as compiler agnostic as possible..? You may use CMAKE_CFG_INTDIR. Try: cmake --help-variable CMAKE_CFG_INTDIR You'll get some example with custom command/target. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] PARENT_SCOPE for unset()?
I actually found that using the following worked the exact same for me: set( var PARENT_SCOPE ) It passed the NOT test in my if condition: if( NOT var ) ... endif() It might make more sense to require 2 parameters for set() (the variable name and its value). If setting to nothing, use a blank string. That way there is no ambiguity between PARENT_SCOPE and parameter 2. If people really want to unset the variable, I don't believe set() is the way... that's why unset() exists. Just my opinion. Only problem is, if you make this change, it isn't backward compatible and will probably break a lot of scripts. Looks like CMake is kind of boned here. Herb Sutter made a great point during GoingNative 2012 about how it's better to not have a feature than to misdesign it and be stuck supporting it forever. I think the latter part of the statement applies here :) This isn't a big deal though, just one of those if we could change it, this would make more sense kind of things. Big thanks for your help David, as usual. - Robert Dailey On Thu, Feb 9, 2012 at 6:19 PM, David Cole david.c...@kitware.com wrote: Yes, PARENT_SCOPE must occur as the last argument. Each command has its own code for processing its argument list. See Source/cmSetCommand.cxx for details on this one. Interesting (not quite the right adjective?) side effect: it's difficult to set a variable to the value PARENT_SCOPE because you have to do it indirectly... On Thu, Feb 9, 2012 at 7:12 PM, Robert Dailey rcdai...@gmail.com wrote: That worked, thanks David. I guess CMake goes right-to-left for function parameters? I don't see how else it doesn't think PARENT_SCOPE is a value instead of an option. - Robert Dailey On Thu, Feb 9, 2012 at 1:45 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:41 PM, Robert Dailey rcdai...@gmail.comwrote: I didn't try that because I thought it would actually treat PARENT_SCOPE as a string and add it to the variable. I did this instead: set( var PARENT_SCOPE ) That leaves it set, with a value of the empty string, in the parent scope. Give the one I sent a try. - Robert Dailey On Thu, Feb 9, 2012 at 1:26 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:22 PM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Thursday 09 February 2012, Robert Dailey wrote: It would seem useful to have a PARENT_SCOPE option for the unset() command, just like its set() counterpart. Is there a particular reason why it does not have it now? No, I think there is not particular reason. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake Does: set(var PARENT_SCOPE) have the intended effect? (If so, you could use that until such time as PARENT_SCOPE is added to unset.) -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] PARENT_SCOPE for unset()?
Also I wonder what happens if you do this: set( var PARENT_SCOPE PARENT_SCOPE PARENT_SCOPE ) - Robert Dailey On Fri, Feb 10, 2012 at 8:59 AM, Robert Dailey rcdai...@gmail.com wrote: I actually found that using the following worked the exact same for me: set( var PARENT_SCOPE ) It passed the NOT test in my if condition: if( NOT var ) ... endif() It might make more sense to require 2 parameters for set() (the variable name and its value). If setting to nothing, use a blank string. That way there is no ambiguity between PARENT_SCOPE and parameter 2. If people really want to unset the variable, I don't believe set() is the way... that's why unset() exists. Just my opinion. Only problem is, if you make this change, it isn't backward compatible and will probably break a lot of scripts. Looks like CMake is kind of boned here. Herb Sutter made a great point during GoingNative 2012 about how it's better to not have a feature than to misdesign it and be stuck supporting it forever. I think the latter part of the statement applies here :) This isn't a big deal though, just one of those if we could change it, this would make more sense kind of things. Big thanks for your help David, as usual. - Robert Dailey On Thu, Feb 9, 2012 at 6:19 PM, David Cole david.c...@kitware.com wrote: Yes, PARENT_SCOPE must occur as the last argument. Each command has its own code for processing its argument list. See Source/cmSetCommand.cxx for details on this one. Interesting (not quite the right adjective?) side effect: it's difficult to set a variable to the value PARENT_SCOPE because you have to do it indirectly... On Thu, Feb 9, 2012 at 7:12 PM, Robert Dailey rcdai...@gmail.com wrote: That worked, thanks David. I guess CMake goes right-to-left for function parameters? I don't see how else it doesn't think PARENT_SCOPE is a value instead of an option. - Robert Dailey On Thu, Feb 9, 2012 at 1:45 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:41 PM, Robert Dailey rcdai...@gmail.comwrote: I didn't try that because I thought it would actually treat PARENT_SCOPE as a string and add it to the variable. I did this instead: set( var PARENT_SCOPE ) That leaves it set, with a value of the empty string, in the parent scope. Give the one I sent a try. - Robert Dailey On Thu, Feb 9, 2012 at 1:26 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:22 PM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Thursday 09 February 2012, Robert Dailey wrote: It would seem useful to have a PARENT_SCOPE option for the unset() command, just like its set() counterpart. Is there a particular reason why it does not have it now? No, I think there is not particular reason. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake Does: set(var PARENT_SCOPE) have the intended effect? (If so, you could use that until such time as PARENT_SCOPE is added to unset.) -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] ansi color
On 2/10/2012 3:15 AM, Matt Fair wrote: I'd like to be able to pipe cmake output and still have the ansi color codes when the output is not TTY, is there a way to do this? Not currently. The isatty test is hard-coded here: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/kwsys/Terminal.c;hb=v2.8.7#l181 -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Copying Files into build-dir under Visual Studio vs. Codeblocks/Win32 vs. Codeblocks/Linux
On 02/10/2012 09:41 AM, Eric Noulard wrote: 2012/2/10 Stefan Fendt ste...@sfendt.de: Hi, I'm (still) quite unsure if this isn't an FAQ (or if not maybe should be one), but I have read through everything I could google-up regarding this topic and found nothing usable... I'm writing an x-platform-project which will be compiled using different compilers and or under different systems... for this project I am required to move some files from some location (source/data) into the build-directory. Whileas this works under Linux/Codeblocks/GCC as well as Windows/Codeblocks/MinGW it doesn't for Visual Studio... Under Visual Studio the files always are copied to some directory-location directly above the actual binary-directory. I've tried using ${CMAKE_CURRENT_BINARY} and it copies the files to the marked position: build/--- copies into this directory build/Debug build/Release build/source After that I tried to do it with GET_TARGET_PROPERTY(... PROPERTY LOCATION). I then get something like this... 'build/$(Configuration)' ...which of course doesn't solve the problem, too... because the configuration under Visual Studio is only known after CMake-Generation of the solution and running the compiler... So, what is the suggested method of (if you can't avoid it) copying files from anywhere into the build-directory, which is as compiler agnostic as possible..? You may use CMAKE_CFG_INTDIR. Try: cmake --help-variable CMAKE_CFG_INTDIR You'll get some example with custom command/target. Alternatively, you might use generator expressions in custom commands/ targets like $TARGET_FILE_DIR: Both, a generator expression and CMAKE_CFG_INTDIR, are evaluated at build time, but the former is able to handle the case of targets with individual output directories, i.e. with RUNTIME_OUTPUT_DIRECTORY[_CONFIG] properties set. Thus, if you actually intend to copy the files to the build directories of certain targets instead of the build directory, generator expressions might be the more robust choice. Regards, Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] PARENT_SCOPE for unset()?
On 02/10/2012 03:59 PM, Robert Dailey wrote: I actually found that using the following worked the exact same for me: set( var PARENT_SCOPE ) It passed the NOT test in my if condition: if( NOT var ) ... endif() Does it pass the NOT DEFINED test, too? There's a difference between an empty and an undefined variable, and that's sometimes significant. Regards, Michael It might make more sense to require 2 parameters for set() (the variable name and its value). If setting to nothing, use a blank string. That way there is no ambiguity between PARENT_SCOPE and parameter 2. If people really want to unset the variable, I don't believe set() is the way... that's why unset() exists. Just my opinion. Only problem is, if you make this change, it isn't backward compatible and will probably break a lot of scripts. Looks like CMake is kind of boned here. Herb Sutter made a great point during GoingNative 2012 about how it's better to not have a feature than to misdesign it and be stuck supporting it forever. I think the latter part of the statement applies here :) This isn't a big deal though, just one of those if we could change it, this would make more sense kind of things. Big thanks for your help David, as usual. - Robert Dailey On Thu, Feb 9, 2012 at 6:19 PM, David Cole david.c...@kitware.com wrote: Yes, PARENT_SCOPE must occur as the last argument. Each command has its own code for processing its argument list. See Source/cmSetCommand.cxx for details on this one. Interesting (not quite the right adjective?) side effect: it's difficult to set a variable to the value PARENT_SCOPE because you have to do it indirectly... On Thu, Feb 9, 2012 at 7:12 PM, Robert Dailey rcdai...@gmail.com wrote: That worked, thanks David. I guess CMake goes right-to-left for function parameters? I don't see how else it doesn't think PARENT_SCOPE is a value instead of an option. - Robert Dailey On Thu, Feb 9, 2012 at 1:45 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:41 PM, Robert Dailey rcdai...@gmail.comwrote: I didn't try that because I thought it would actually treat PARENT_SCOPE as a string and add it to the variable. I did this instead: set( var PARENT_SCOPE ) That leaves it set, with a value of the empty string, in the parent scope. Give the one I sent a try. - Robert Dailey On Thu, Feb 9, 2012 at 1:26 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:22 PM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Thursday 09 February 2012, Robert Dailey wrote: It would seem useful to have a PARENT_SCOPE option for the unset() command, just like its set() counterpart. Is there a particular reason why it does not have it now? No, I think there is not particular reason. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake Does: set(var PARENT_SCOPE) have the intended effect? (If so, you could use that until such time as PARENT_SCOPE is added to unset.) -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] PARENT_SCOPE for unset()?
On Fri, Feb 10, 2012 at 10:00 AM, Robert Dailey rcdai...@gmail.com wrote: Also I wonder what happens if you do this: set( var PARENT_SCOPE PARENT_SCOPE PARENT_SCOPE ) That sets var to PARENT_SCOPE;PARENT_SCOPE in the parent scope. - Robert Dailey On Fri, Feb 10, 2012 at 8:59 AM, Robert Dailey rcdai...@gmail.com wrote: I actually found that using the following worked the exact same for me: set( var PARENT_SCOPE ) It passed the NOT test in my if condition: if( NOT var ) ... endif() set(var) and set(var ) do two different things. The first, set(var), unsets the variable such that it is not even DEFINED as a variable. The second, set(var ), sets the variable such that is is DEFINED and has the value of the empty string. Similarly, with PARENT_SCOPE: set(var PARENT_SCOPE) and set(var PARENT_SCOPE) The if(NOT var) test works the same for variables that are not defined or are defined and empty. The if(NOT DEFINED var) test does not. set(var) was the way we did unset before the unset command existed. It might make more sense to require 2 parameters for set() (the variable name and its value). If setting to nothing, use a blank string. That way there is no ambiguity between PARENT_SCOPE and parameter 2. If people really want to unset the variable, I don't believe set() is the way... that's why unset() exists. Just my opinion. Only problem is, if you make this change, it isn't backward compatible and will probably break a lot of scripts. Looks like CMake is kind of boned here. Herb Sutter made a great point during GoingNative 2012 about how it's better to not have a feature than to misdesign it and be stuck supporting it forever. I think the latter part of the statement applies here :) This isn't a big deal though, just one of those if we could change it, this would make more sense kind of things. Big thanks for your help David, as usual. Agreed. We all agree with this. But we *are* sticking with set(var) being equivalent, ironically enough, to unset(var) for backwards compatibility, because there are many CMakeLists files which depend on this behavior. You're welcome. Thanks for the discussion, David - Robert Dailey On Thu, Feb 9, 2012 at 6:19 PM, David Cole david.c...@kitware.comwrote: Yes, PARENT_SCOPE must occur as the last argument. Each command has its own code for processing its argument list. See Source/cmSetCommand.cxx for details on this one. Interesting (not quite the right adjective?) side effect: it's difficult to set a variable to the value PARENT_SCOPE because you have to do it indirectly... On Thu, Feb 9, 2012 at 7:12 PM, Robert Dailey rcdai...@gmail.comwrote: That worked, thanks David. I guess CMake goes right-to-left for function parameters? I don't see how else it doesn't think PARENT_SCOPE is a value instead of an option. - Robert Dailey On Thu, Feb 9, 2012 at 1:45 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:41 PM, Robert Dailey rcdai...@gmail.comwrote: I didn't try that because I thought it would actually treat PARENT_SCOPE as a string and add it to the variable. I did this instead: set( var PARENT_SCOPE ) That leaves it set, with a value of the empty string, in the parent scope. Give the one I sent a try. - Robert Dailey On Thu, Feb 9, 2012 at 1:26 PM, David Cole david.c...@kitware.comwrote: On Thu, Feb 9, 2012 at 2:22 PM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Thursday 09 February 2012, Robert Dailey wrote: It would seem useful to have a PARENT_SCOPE option for the unset() command, just like its set() counterpart. Is there a particular reason why it does not have it now? No, I think there is not particular reason. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake Does: set(var PARENT_SCOPE) have the intended effect? (If so, you could use that until such time as PARENT_SCOPE is added to unset.) -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] ansi color
On 02/10/2012 09:15 AM, Matt Fair wrote: I'd like to be able to pipe cmake output and still have the ansi color codes when the output is not TTY, is there a way to do this? Thanks, Matt You might do this by yourself using sed/awk/perl/... and the ANSI CSIs; refer to [1] for a similar example. Instead of multiple -e command line sed expressions, it is probably more convenient to use a sed script with one line per color as last part of your pipe. Regards, Michael [1] http://www.mail-archive.com/cmake@cmake.org/msg40328.html -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Visual studio platform selection
Is there a way to select generators for 3rd party platforms in visual studio ? There exist only x86 or win32 to select from, but we have some other platform (pocketpc, smartphone, etc.), and some more provided by 3rd parties. I've tried to search for solutions, but found none this far. And if there is no such capability, is it planned to be included sometime? Thanks, Gzp -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Copying Files into build-dir under Visual Studio vs. Codeblocks/Win32 vs. Codeblocks/Linux
Specifically on point b below. I configure a header file with the location of each input file. That header file is then used in the unit tests as the path to the file. That way it works for anyone in any directory on any operating system. // Example Input header file namespace Test1 { const std::string TestFile(@DATA_DIR@/MyInputFile.dat); } Then in my CMakeLists.txt file I have a CMake variable (DATA_DIR) that the user can set. After the variable is set then I use configure_file(...) to configure the header. Then in the actual test if I need to use that file: void MyTest() { FILE* f = fopen(Test1::TestFile.c_str(), r); } This setup avoids any copying of the files (at least the data files) into various directories. Hope that helps Mike Jackson On Feb 10, 2012, at 9:22 AM, aaron.mead...@thomsonreuters.com wrote: (Wow, Eric, I didn't know about CMAKE_CFG_INTDIR! Seems like you are teaching me all kinds of things this week...) It sounds like what you are missing is having the command executed by Visual Studio, so it can do the substitution of the $(Configuration) variable, which is why you need to use the add_custom_command() function. As a side note, I've had to deal with this problem before and have handled it in a couple of different ways, depending on what I was trying to accomplish: 1) Finding DLLs -- for UnitTests that are run automatically, I write scripts ahead of time into directories for each configuration type which append the paths where various 3rd Party DLLs are stored, then execute those scripts as part of a post build event to run the UnitTest. 2) Test Data -- I use one of two methods: a) Copy all the data into each of the configuration directories ahead of time (by iteration over CMAKE_CONFIGURATION_TYPES). This saves needing to copy the identical file from a source data directory to a binary directory over and over each time I build. b) I change the executable so I can pass it a data directory to read from. This saves making many copies of identical data for each different configuration type. Hope that helps! Aaron Meadows -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Eric Noulard Sent: Friday, February 10, 2012 2:42 AM To: Stefan Fendt Cc: cmake@cmake.org Subject: Re: [CMake] Copying Files into build-dir under Visual Studio vs. Codeblocks/Win32 vs. Codeblocks/Linux 2012/2/10 Stefan Fendt ste...@sfendt.de: Hi, I'm (still) quite unsure if this isn't an FAQ (or if not maybe should be one), but I have read through everything I could google-up regarding this topic and found nothing usable... I'm writing an x-platform-project which will be compiled using different compilers and or under different systems... for this project I am required to move some files from some location (source/data) into the build-directory. Whileas this works under Linux/Codeblocks/GCC as well as Windows/Codeblocks/MinGW it doesn't for Visual Studio... Under Visual Studio the files always are copied to some directory-location directly above the actual binary-directory. I've tried using ${CMAKE_CURRENT_BINARY} and it copies the files to the marked position: build/--- copies into this directory build/Debug build/Release build/source After that I tried to do it with GET_TARGET_PROPERTY(... PROPERTY LOCATION). I then get something like this... 'build/$(Configuration)' ...which of course doesn't solve the problem, too... because the configuration under Visual Studio is only known after CMake-Generation of the solution and running the compiler... So, what is the suggested method of (if you can't avoid it) copying files from anywhere into the build-directory, which is as compiler agnostic as possible..? You may use CMAKE_CFG_INTDIR. Try: cmake --help-variable CMAKE_CFG_INTDIR You'll get some example with custom command/target. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe:
Re: [CMake] Copying Files into build-dir under Visual Studio vs.Codeblocks/Win32 vs. Codeblocks/Linux
That's a nice method too. I suppose the hard coding wouldn't matter in a UnitTest. Aaron Meadows -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Michael Jackson Sent: Friday, February 10, 2012 10:37 AM To: CMake ML Subject: Re: [CMake] Copying Files into build-dir under Visual Studio vs.Codeblocks/Win32 vs. Codeblocks/Linux Specifically on point b below. I configure a header file with the location of each input file. That header file is then used in the unit tests as the path to the file. That way it works for anyone in any directory on any operating system. // Example Input header file namespace Test1 { const std::string TestFile(@DATA_DIR@/MyInputFile.dat); } Then in my CMakeLists.txt file I have a CMake variable (DATA_DIR) that the user can set. After the variable is set then I use configure_file(...) to configure the header. Then in the actual test if I need to use that file: void MyTest() { FILE* f = fopen(Test1::TestFile.c_str(), r); } This setup avoids any copying of the files (at least the data files) into various directories. Hope that helps Mike Jackson On Feb 10, 2012, at 9:22 AM, aaron.mead...@thomsonreuters.com wrote: (Wow, Eric, I didn't know about CMAKE_CFG_INTDIR! Seems like you are teaching me all kinds of things this week...) It sounds like what you are missing is having the command executed by Visual Studio, so it can do the substitution of the $(Configuration) variable, which is why you need to use the add_custom_command() function. As a side note, I've had to deal with this problem before and have handled it in a couple of different ways, depending on what I was trying to accomplish: 1) Finding DLLs -- for UnitTests that are run automatically, I write scripts ahead of time into directories for each configuration type which append the paths where various 3rd Party DLLs are stored, then execute those scripts as part of a post build event to run the UnitTest. 2) Test Data -- I use one of two methods: a) Copy all the data into each of the configuration directories ahead of time (by iteration over CMAKE_CONFIGURATION_TYPES). This saves needing to copy the identical file from a source data directory to a binary directory over and over each time I build. b) I change the executable so I can pass it a data directory to read from. This saves making many copies of identical data for each different configuration type. Hope that helps! Aaron Meadows -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Eric Noulard Sent: Friday, February 10, 2012 2:42 AM To: Stefan Fendt Cc: cmake@cmake.org Subject: Re: [CMake] Copying Files into build-dir under Visual Studio vs. Codeblocks/Win32 vs. Codeblocks/Linux 2012/2/10 Stefan Fendt ste...@sfendt.de: Hi, I'm (still) quite unsure if this isn't an FAQ (or if not maybe should be one), but I have read through everything I could google-up regarding this topic and found nothing usable... I'm writing an x-platform-project which will be compiled using different compilers and or under different systems... for this project I am required to move some files from some location (source/data) into the build-directory. Whileas this works under Linux/Codeblocks/GCC as well as Windows/Codeblocks/MinGW it doesn't for Visual Studio... Under Visual Studio the files always are copied to some directory-location directly above the actual binary-directory. I've tried using ${CMAKE_CURRENT_BINARY} and it copies the files to the marked position: build/--- copies into this directory build/Debug build/Release build/source After that I tried to do it with GET_TARGET_PROPERTY(... PROPERTY LOCATION). I then get something like this... 'build/$(Configuration)' ...which of course doesn't solve the problem, too... because the configuration under Visual Studio is only known after CMake-Generation of the solution and running the compiler... So, what is the suggested method of (if you can't avoid it) copying files from anywhere into the build-directory, which is as compiler agnostic as possible..? You may use CMAKE_CFG_INTDIR. Try: cmake --help-variable CMAKE_CFG_INTDIR You'll get some example with custom command/target. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the
[Cmake-commits] CMake branch, next, updated. v2.8.7-2552-gbc679d0
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via bc679d042c6079d41abdbd26c6ee5107f7b3b527 (commit) via 2521461c725d1653433202d1fecb3e583494b77f (commit) from d7510a4a4f698fdbe1c951c65ce2392e934bb3ff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc679d042c6079d41abdbd26c6ee5107f7b3b527 commit bc679d042c6079d41abdbd26c6ee5107f7b3b527 Merge: d7510a4 2521461 Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Fri Feb 10 13:55:09 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Fri Feb 10 13:55:09 2012 -0500 Merge topic 'improve-findopenmp' into next 2521461 FindOpenMP: try the most likely flags first http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2521461c725d1653433202d1fecb3e583494b77f commit 2521461c725d1653433202d1fecb3e583494b77f Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Wed Feb 8 19:23:38 2012 +0100 Commit: Rolf Eike Beer e...@sf-mail.de CommitDate: Fri Feb 10 19:54:29 2012 +0100 FindOpenMP: try the most likely flags first Since we know which compiler we have we can test those OpenMP flags first that are likely to be correct. This doesn't make any difference for GNU compilers, but it should avoid useless try_compiles and output cluttering for all others. diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index ceac8d2..9d9fe0d 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -1,7 +1,7 @@ # - Finds OpenMP support # This module can be used to detect OpenMP support in a compiler. # If the compiler supports OpenMP, the flags required to compile with -# openmp support are set. +# openmp support are set. # # The following variables are set: # OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support @@ -13,6 +13,7 @@ #= # Copyright 2009 Kitware, Inc. # Copyright 2008-2009 André Rigland Brodtkorb andre.brodtk...@ifi.uio.no +# Copyright 2012 Rolf Eike Beer e...@sf-mail.de # # Distributed under the OSI-approved BSD License (the License); # see accompanying file Copyright.txt for details. @@ -31,26 +32,52 @@ unset(_ENABLED_LANGUAGES) set(_OPENMP_REQUIRED_VARS) -set(OpenMP_C_FLAG_CANDIDATES - #Gnu - -fopenmp - #Microsoft Visual Studio - /openmp - #Intel windows - -Qopenmp - #Intel - -openmp - #Empty, if compiler automatically accepts openmp - - #Sun - -xopenmp - #HP - +Oopenmp - #IBM XL C/c++ - -qsmp - #Portland Group - -mp -) +function(_OPENMP_FLAG_CANDIDATES LANG) + set(OpenMP_FLAG_CANDIDATES +#GNU +-fopenmp +#Microsoft Visual Studio +/openmp +#Intel windows +-Qopenmp +#Intel +-openmp +#Empty, if compiler automatically accepts openmp + +#Sun +-xopenmp +#HP ++Oopenmp +#IBM XL C/c++ +-qsmp +#Portland Group +-mp + ) + + set(OMP_FLAG_GNU -fopenmp) + set(OMP_FLAG_MSVC /openmp) + if(WIN32) +set(OMP_FLAG_Intel -Qopenmp) + else() +set(OMP_FLAG_Intel -openmp) + endif() + set(OMP_FLAG_SunPro -xopenmp) + set(OMP_FLAG_HP +Oopenmp) + set(OMP_FLAG_XL -qsmp) + set(OMP_FLAG_MIPSpro -mp) + set(OMP_FLAG_PGI -mp) + + # Move the flag that matches the compiler to the head of the list, + # this is faster and doesn't clutter the output that much. If that + # flag doesn't work we will still try all. + if(OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}) +list(REMOVE_ITEM OpenMP_FLAG_CANDIDATES ${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}) +list(INSERT OpenMP_FLAG_CANDIDATES 0 ${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}) + endif() + + set(OpenMP_${LANG}_FLAG_CANDIDATES ${OpenMP_FLAG_CANDIDATES} PARENT_SCOPE) +endfunction(_OPENMP_FLAG_CANDIDATES) + set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES}) # sample openmp source code to test @@ -65,16 +92,17 @@ int main() { #endif } ) -# if these are set then do not try to find them again, -# by avoiding any try_compiles for the flags -if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) - set(OpenMP_C_FLAG_CANDIDATES) - set(OpenMP_CXX_FLAG_CANDIDATES) -endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) # check c compiler if(NOT _HAVE_LANGUAGE_C EQUAL -1) - include(CheckCSourceCompiles) + # if these are set then do not try to find them again, + # by avoiding any try_compiles for the flags + if(OpenMP_C_FLAGS) +unset(OpenMP_C_FLAG_CANDIDATES) + else() +_OPENMP_FLAG_CANDIDATES(C) +include(CheckCSourceCompiles) + endif() foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
[Cmake-commits] CMake branch, next, updated. v2.8.7-2554-gc545412
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via c545412afaf6f28bcb9e9dd31d96dcd9e27ff5fc (commit) via ca7790240cf63cd6f449cbde2d8b9866bd22c7d8 (commit) from bc679d042c6079d41abdbd26c6ee5107f7b3b527 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c545412afaf6f28bcb9e9dd31d96dcd9e27ff5fc commit c545412afaf6f28bcb9e9dd31d96dcd9e27ff5fc Merge: bc679d0 ca77902 Author: Brad King brad.k...@kitware.com AuthorDate: Fri Feb 10 15:18:17 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Fri Feb 10 15:18:17 2012 -0500 Merge topic 'libarchive-old-glibc' into next ca77902 libarchive: Workaround mbsnrtowcs assertion failure on old glibc http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca7790240cf63cd6f449cbde2d8b9866bd22c7d8 commit ca7790240cf63cd6f449cbde2d8b9866bd22c7d8 Author: Brad King brad.k...@kitware.com AuthorDate: Fri Feb 10 15:16:06 2012 -0500 Commit: Brad King brad.k...@kitware.com CommitDate: Fri Feb 10 15:16:06 2012 -0500 libarchive: Workaround mbsnrtowcs assertion failure on old glibc The CMake TarTest fails with the error mbsnrtowcs.c:116: __mbsnrtowcs: Assertion `status == GCONV_OK || status != GCONV_EMPTY_INPUT || status == GCONV_ILLEGAL_INPUT || status == GCONV_INCOMPLETE_INPUT || status == GCONV_FULL_OUTPUT' failed. on very old glibc versions. Work around the problem by pretending that mbsnrtowcs does not exist. Libarchive will fall back to mbrtowc. diff --git a/Utilities/cmlibarchive/libarchive/archive_platform.h b/Utilities/cmlibarchive/libarchive/archive_platform.h index ce2f482..cdd9c7c 100644 --- a/Utilities/cmlibarchive/libarchive/archive_platform.h +++ b/Utilities/cmlibarchive/libarchive/archive_platform.h @@ -76,6 +76,11 @@ #define__FBSDID(a) struct _undefined_hack #endif +/* Old glibc mbsnrtowcs fails assertions in our use case. */ +#if defined(__GLIBC__) __GLIBC__ == 2 __GLIBC_MINOR__ = 1 +# undef HAVE_MBSNRTOWCS +#endif + /* Try to get standard C99-style integer type definitions. */ #if HAVE_INTTYPES_H #include inttypes.h --- Summary of changes: .../cmlibarchive/libarchive/archive_platform.h |5 + 1 files changed, 5 insertions(+), 0 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.7-2556-g805cf9f
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 805cf9fc9a54561b2a148cfb07d98f48c044c6e6 (commit) via 3bb87347d7d5c0410e7188124fb555eb6ca8f6e5 (commit) from c545412afaf6f28bcb9e9dd31d96dcd9e27ff5fc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=805cf9fc9a54561b2a148cfb07d98f48c044c6e6 commit 805cf9fc9a54561b2a148cfb07d98f48c044c6e6 Merge: c545412 3bb8734 Author: Alexey Ozeritsky aozerit...@gmail.com AuthorDate: Fri Feb 10 15:52:25 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Fri Feb 10 15:52:25 2012 -0500 Merge topic 'findblas-bugs' into next 3bb8734 FindBLAS: Unknown arguments specified fixed http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bb87347d7d5c0410e7188124fb555eb6ca8f6e5 commit 3bb87347d7d5c0410e7188124fb555eb6ca8f6e5 Author: Alexey Ozeritsky aozerit...@gmail.com AuthorDate: Sat Feb 11 00:49:45 2012 +0400 Commit: Alexey Ozeritsky aozerit...@gmail.com CommitDate: Sat Feb 11 00:49:45 2012 +0400 FindBLAS: Unknown arguments specified fixed diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 4efb6ec..919358a 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -543,7 +543,7 @@ if (BLA_VENDOR MATCHES Intel* OR BLA_VENDOR STREQUAL All) foreach (SEARCH_LIBS ${BLAS_SEARCH_LIBS}) string(REPLACE ; SEARCH_LIBS ${SEARCH_LIBS}) -if (${${_LIBRARIES}}) +if (${_LIBRARIES}) else () check_fortran_libraries( ${_LIBRARIES} --- Summary of changes: Modules/FindBLAS.cmake |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, master, updated. v2.8.7-309-g677047d
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, master has been updated via 677047dda0620fa675bcc1a8bacde5388ad954c3 (commit) from 0fcf69d72f113a989df43973e05c039e4bbd3d33 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=677047dda0620fa675bcc1a8bacde5388ad954c3 commit 677047dda0620fa675bcc1a8bacde5388ad954c3 Author: KWSys Robot kwro...@kitware.com AuthorDate: Sat Feb 11 00:05:07 2012 -0500 Commit: KWSys Robot kwro...@kitware.com CommitDate: Sat Feb 11 00:05:07 2012 -0500 KWSys Nightly Date Stamp diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 13de8a0..efbc816 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2012) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 10) +SET(KWSYS_DATE_STAMP_DAY 11) --- Summary of changes: Source/kwsys/kwsysDateStamp.cmake |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits