Re: [CMake] New warnings in CMake 2.8.4-rc2
See the cmake command line help for: --no-warn-unused-cli= Don't warn about command line options. I would just add "--no-warn-unused-cli" to the ExternalProject_Add calls and require CMake 2.8.4. (There is no ExternalProject_Add in CMake 2.6...) On Sat, Mar 26, 2011 at 9:22 AM, Johnson, Hans J wrote: > David, > > I am trying to remove all warnings from my Cmake build process: During a > "-DCMAKE_BUILD_TYPE:STRING=Debug" build I get the following warning: > * > > CMake Warning: The variable, 'CMAKE_CXX_FLAGS_RELEASE', specified manually, > was not used during the generation. > > I believe that I get an alternate warning when building in Release mode that > > CMAKE_CXX_FLAGS_DEBUG is specified manually. > > * > I was reading this thread: > http://www.cmake.org/pipermail/cmake/2011-February/042474.html > > Here is my situation, and I'd like your advice on how to resolve it: > > I am using ExternalProject_Add feature of cmake, and I want all external > packages to be built with the same compiler options: > > set(EXTERNAL_PACKAGES BRAINSMultiModeSegment BRAINSFit BRAINSDemonWarp > BRAINSCut BRAINSResample > BRAINSABC BRAINSConstellationDetector BRAINSMush BRAINSROIAuto GTRACT > ${DicomToNrrdConverter} ${DicomSignature} ${BRAINSImageEval} > BRAINSInitilizedControlPoints ) > > foreach(proj ${EXTERNAL_PACKAGES}) > # message(STATUS "Building ExternalProject ${proj}") > # message(STATUS "BRAINSCommonLib_DIR = ${BRAINSCommonLib_DIR}") > ExternalProject_Add(${proj} > DOWNLOAD_COMMAND "" > SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${proj} > BINARY_DIR ${proj}-build > #DEPENDS BRAINSCommonLib SlicerExecutionModel > CMAKE_GENERATOR ${gen} > CMAKE_ARGS > -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE} > -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG} > -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} > -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} > -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} > -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} > -DITK_DIR:PATH=${ITK_DIR} > INSTALL_COMMAND "" > ) > endforeach() > > = > Is there a way inside the CMakeLists.txt file to avoid these warnings? > > The only solution I can think of is to add a tremendous amount of > if/then/else logic to explicitly handle all permutations of options so that > only the minimal set of options is sent. That is going to be a maintenance > nightmare. > > This code needs to compile similarly under cmake 2.6.4 and 2.8.4, or I'll > need to again add build logic to our testing scripts. > > Thanks, > Hans > > > > -- > Notice: This UI Health Care e-mail (including attachments) is covered by > the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is > confidential and may be legally privileged. If you are not the intended > recipient, you are hereby notified that any retention, dissemination, > distribution, or copying of this communication is strictly prohibited. > Please reply to the sender that you have received the message in error, then > delete it. Thank you. > -- > ___ 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] New warnings in CMake 2.8.4-rc2
> Basically, we call several CMake projects from the same shell scripts, > and each CMake invokation receive the same set of global parameters. > The same way you can invoke a compiler with several -D options and > safely ignore the definitions you do not care about. Or the same way > you can place as many variables as you want in the environment and let > a program decides whether it "wants" to use it or not. I'm looking for > the same feature for CMake. I used to do it with -D option switch, it > seems I can't do it anymore. echo -e 'IF (NOT CMAKE_VERSION VERSION_LESS 2.8.4)\nMESSAGE(STATUS --no-warn-unused-cli)\nENDIF (NOT CMAKE_VERSION VERSION_LESS 2.8.4)" >> cmake_since_2.8.4.cmake EXTRA_CMAKE_ARGS=$(cmake -P cmake_since_2.8.4 | sed 's/^-- //') HTH 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] New warnings in CMake 2.8.4-rc2
-- Forwarded message -- From: Emmanuel Blot Date: Fri, Feb 18, 2011 at 11:48 PM Subject: Re: [CMake] New warnings in CMake 2.8.4-rc2 To: David Cole > If a variable is not used, then simply do not define it on the cmake > command line. Thanks, but I simply can't. If I could, I would have done it since 2.8.4-RC1 ;-) Basically, we call several CMake projects from the same shell scripts, and each CMake invokation receive the same set of global parameters. The same way you can invoke a compiler with several -D options and safely ignore the definitions you do not care about. Or the same way you can place as many variables as you want in the environment and let a program decides whether it "wants" to use it or not. I'm looking for the same feature for CMake. I used to do it with -D option switch, it seems I can't do it anymore. > The other option is simply to ignore all of our "was not used" output. > They are only warnings. They do not actually affect the generated > build tree. But we just don't want warnings. False warnings simply distract the developer that have no choice but start ignoring them - and fail to detect real and useful ones. > I guess I don't understand your "big picture" here. It seems to me > that it should be easy to resolve this one way or another, even if > it's not pretty and elegant. Sure. I'm just looking to invoke CMake with a set of variables, some of which being useful for a given CMake script, some others being safely ignored - as they used to be, BTW. How to do this? "make" accepts a random list of definitions: make key1=value1 key2=value2 ... "gcc" accepts a random list of definitions: gcc -DKEY1=value1 -DKEY2=value2 What is the equivalent way of passing such arguments to a CMake script ? Thanks Emmanuel. ___ 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] New warnings in CMake 2.8.4-rc2
On Thu, Feb 17, 2011 at 4:37 PM, Emmanuel Blot wrote: >> The only warning that is enabled by default is to warn you about >> misspelled -D options that you pass on the command line. (We think >> they *may* be misspelled because they are not referenced in the >> configure/generate steps... So it's just a warning.) > >> You can suppress this by also passing "--no-warn-unused-cli" on the >> CMake command line. Or by avoiding passing in the unused variables in >> the first place. Or by sticking with CMake 2.8.3 that does not produce >> this warning. >> >> Those are your 3 options for avoiding this warning. > > The question is HOW do you "stick with cmake 2.8.3" - or stick with cmake > 2.8.4. > > This is the actual issue: there's no way to "stick with" a minor > release of cmake when you distribute code, because you cannot enforce > a minor release of cmake (a regular linux distribution will upgrade > the minor version at some point, and this cannot be controlled). So at > some point somewhere, building with cmake will throw new warnings, and > there's no way to control this. As the "--no-warn-unused-cli" option > would simply break the build with a previous minor release of CMake, > this means that the script calling CMake needs to detect the version > of cmake, and tweak the cmake command line accordingly. Dirty, at > best. > > From my perspective - that I understand is not shared - it would have > been great not introducing this kind of compatibility break between > CMake minor release by default. It could have been enabled with a new > POLICY or with an explicit option switch. > > Maybe I'm looking in the wrong direction: is there a way to specify > these variable definitions without the -D option switch? - such as > environment variables for example? > > Thanks. > If a variable is not used, then simply do not define it on the cmake command line. If I do this: $ cmake -DNO_SUCH_VARIABLE=OFF . I get this: -- Configuring done -- Generating done CMake Warning: The variable, 'NO_SUCH_VARIABLE', specified manually, was not used during the generation. -- Build files have been written to: ... If I do this: $ cmake . -- Configuring done -- Generating done -- Build files have been written to: ... Voila. No warning. The other option is simply to ignore all of our "was not used" output. They are only warnings. They do not actually affect the generated build tree. I guess I don't understand your "big picture" here. It seems to me that it should be easy to resolve this one way or another, even if it's not pretty and elegant. David ___ 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] New warnings in CMake 2.8.4-rc2
> The only warning that is enabled by default is to warn you about > misspelled -D options that you pass on the command line. (We think > they *may* be misspelled because they are not referenced in the > configure/generate steps... So it's just a warning.) > You can suppress this by also passing "--no-warn-unused-cli" on the > CMake command line. Or by avoiding passing in the unused variables in > the first place. Or by sticking with CMake 2.8.3 that does not produce > this warning. > > Those are your 3 options for avoiding this warning. The question is HOW do you "stick with cmake 2.8.3" - or stick with cmake 2.8.4. This is the actual issue: there's no way to "stick with" a minor release of cmake when you distribute code, because you cannot enforce a minor release of cmake (a regular linux distribution will upgrade the minor version at some point, and this cannot be controlled). So at some point somewhere, building with cmake will throw new warnings, and there's no way to control this. As the "--no-warn-unused-cli" option would simply break the build with a previous minor release of CMake, this means that the script calling CMake needs to detect the version of cmake, and tweak the cmake command line accordingly. Dirty, at best. >From my perspective - that I understand is not shared - it would have been great not introducing this kind of compatibility break between CMake minor release by default. It could have been enabled with a new POLICY or with an explicit option switch. Maybe I'm looking in the wrong direction: is there a way to specify these variable definitions without the -D option switch? - such as environment variables for example? Thanks. ___ 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] New warnings in CMake 2.8.4-rc2
On Thu, Feb 17, 2011 at 11:47 AM, Alexander Neundorf wrote: > On Wednesday 16 February 2011, you wrote: >> > So what is the recommended way to suppress the warnings whatever the >> > CMake 2.8.x release ? >> >> 2.8.4 has been released, the warnings seem to be enabled without a new >> policy setting ;-( > > Please post to the mailing list, I'm not really involved in these wanings. > > 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 > The only warning that is enabled by default is to warn you about misspelled -D options that you pass on the command line. (We think they *may* be misspelled because they are not referenced in the configure/generate steps... So it's just a warning.) You can suppress this by also passing "--no-warn-unused-cli" on the CMake command line. Or by avoiding passing in the unused variables in the first place. Or by sticking with CMake 2.8.3 that does not produce this warning. Those are your 3 options for avoiding this warning. HTH, David ___ 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] New warnings in CMake 2.8.4-rc2
On Wednesday 16 February 2011, you wrote: > > So what is the recommended way to suppress the warnings whatever the > > CMake 2.8.x release ? > > 2.8.4 has been released, the warnings seem to be enabled without a new > policy setting ;-( Please post to the mailing list, I'm not really involved in these wanings. 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
Re: [CMake] New warnings in CMake 2.8.4-rc2
On 02/05/2011 11:33 AM, Johan Björk wrote: > Hi Guys, > > I ran into a very similar issue, It seems that CMAKE_TOOLCHAIN_FILE does > not trigger the whatever "mark as used" code in question, so even if it > actually *does* use the variable, you still get a warning. > > Example output: > Johan-Bjorks-MacBook-Pro-2:build-morpher phb$ cmake -G Xcode > -DCMAKE_TOOLCHAIN_FILE=~/DEV/client/cmake/morpher-toolchain.cmake ../ > .. > -- Configuring done > -- Generating done > CMake Warning: The variable, 'CMAKE_TOOLCHAIN_FILE', specified manually, > was not used during the generation. > -- Build files have been written to: /Users/phb/DEV/client/build-morpher I can only get this to happen by running CMake on a build tree that already exists. The variable *does* get used on the *first* run in a fresh tree. It does *not* get used later because you don't need to specify it to regenerate. CMake has already recorded a rule to load the file in CMakeFiles/CMakeSystem.cmake and does not support changing the toolchain of an existing build tree. IOW, this is a legitimate instance of the warning. -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] New warnings in CMake 2.8.4-rc2
Hi Guys, I ran into a very similar issue, It seems that CMAKE_TOOLCHAIN_FILE does not trigger the whatever "mark as used" code in question, so even if it actually *does* use the variable, you still get a warning. Example output: Johan-Bjorks-MacBook-Pro-2:build-morpher phb$ cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=~/DEV/client/cmake/morpher-toolchain.cmake ../ .. -- Configuring done -- Generating done CMake Warning: The variable, 'CMAKE_TOOLCHAIN_FILE', specified manually, was not used during the generation. -- Build files have been written to: /Users/phb/DEV/client/build-morpher /Johan On Wed, Feb 2, 2011 at 7:29 PM, Alexander Neundorf wrote: > On Wednesday 02 February 2011, Eric Noulard wrote: > > 2011/2/2 Emmanuel Blot : > > >> Currently, there is no way to turn this off. > > > > > > Very, very bad news ;-( > > > IMHO, this is a recurrent issue with CMake. It seems there is no way > > > to guarantee that a project that builds well with a version of CMake > > > will build the same way with the next minor iteration (used to be > > > called "patch release"). > > > > I think "recurrent" is a relatively tough statement, I'm using > > CMake for 7+ years now and never get caught by such an issue. > > > > I think that, CMake developpers are indeed very concerned with > > backward compatibilty. > > Yes. It is one of _the_ main concerns. > If any change is made which is obvously backward incompatible (except for > internal stuff), it is rejected. > If there is a change with slight chances of breaking something somewhere in > some cases, it is at least discussed at length, with the outcome, that > either > it is internal stuff, so people shouldn't rely on, or a policy is added, or > it is rejected. > It may happen that a change which breaks something is overlooked, but if > you > report it during the rc phase, this most probably will get fixed. > (not sure this applies to the new warnings, since they are only warnings > after > all) > > I'm caring for KDE since, damn, almost 5 years now, and it's not bad. > There are very few breakages, or IOW, current KDE requires cmake 2.6.4, and > I'm not aware of any problems with newer versions of CMake. > > 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 > ___ 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] New warnings in CMake 2.8.4-rc2
On Wednesday 02 February 2011, Eric Noulard wrote: > 2011/2/2 Emmanuel Blot : > >> Currently, there is no way to turn this off. > > > > Very, very bad news ;-( > > IMHO, this is a recurrent issue with CMake. It seems there is no way > > to guarantee that a project that builds well with a version of CMake > > will build the same way with the next minor iteration (used to be > > called "patch release"). > > I think "recurrent" is a relatively tough statement, I'm using > CMake for 7+ years now and never get caught by such an issue. > > I think that, CMake developpers are indeed very concerned with > backward compatibilty. Yes. It is one of _the_ main concerns. If any change is made which is obvously backward incompatible (except for internal stuff), it is rejected. If there is a change with slight chances of breaking something somewhere in some cases, it is at least discussed at length, with the outcome, that either it is internal stuff, so people shouldn't rely on, or a policy is added, or it is rejected. It may happen that a change which breaks something is overlooked, but if you report it during the rc phase, this most probably will get fixed. (not sure this applies to the new warnings, since they are only warnings after all) I'm caring for KDE since, damn, almost 5 years now, and it's not bad. There are very few breakages, or IOW, current KDE requires cmake 2.6.4, and I'm not aware of any problems with newer versions of CMake. 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
Re: [CMake] New warnings in CMake 2.8.4-rc2
On Wed, Feb 2, 2011 at 11:46 AM, Eric Noulard wrote: > 2011/2/2 Bill Hoffman : >> On 2/2/2011 11:14 AM, Emmanuel Blot wrote: Currently, there is no way to turn this off. >>> >>> Very, very bad news ;-( >>> IMHO, this is a recurrent issue with CMake. It seems the >> >> I was wrong. Please read Brad King's posts on this, and then see if it >> answers your questions. > > I think nothing has been switch ON by default **but** the check of command > line defined options, as Brad said: > >>> - User passes -DCMAKE_BIULD_TYPE on the command line and gets a warning >>> because it is misspelled and therefore unused. This is ON by default >>> but can be disabled with --no-warn-unused-cli, or by *gasp* not passing >>> unused variables. > > Now frankly I still agree that the default should be to switch it OFF and > put it ON using a new policy and/or switch it ON using > --warn-unused-cli > > > -- > 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 > Normally, I would agree with you that new features should be OFF by default, and explicitly activated. But with this particular feature, it would be utterly useless if it was OFF by default. It's a *warning* about unused command line variables (and it's only a warning, people, feel free to ignore it if you like -- it does no harm, and changes no behavior -- ignore it if you're not willing to avoid it). There are 2 ways to avoid this new warning with CMake 2.8.4: - reference all variables passed in on the command line (after all, if it's not referenced, why pass it in?) - use the new "--no-warn-unused-cli" command line option to avoid the warning The other way to avoid the warning is to continue using CMake 2.8.3 or earlier. David ___ 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] New warnings in CMake 2.8.4-rc2
2011/2/2 Bill Hoffman : > On 2/2/2011 11:14 AM, Emmanuel Blot wrote: >>> >>> Currently, there is no way to turn this off. >> >> Very, very bad news ;-( >> IMHO, this is a recurrent issue with CMake. It seems the > > I was wrong. Please read Brad King's posts on this, and then see if it > answers your questions. I think nothing has been switch ON by default **but** the check of command line defined options, as Brad said: >> - User passes -DCMAKE_BIULD_TYPE on the command line and gets a warning >> because it is misspelled and therefore unused. This is ON by default >> but can be disabled with --no-warn-unused-cli, or by *gasp* not passing >> unused variables. Now frankly I still agree that the default should be to switch it OFF and put it ON using a new policy and/or switch it ON using --warn-unused-cli -- 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] New warnings in CMake 2.8.4-rc2
2011/2/2 Emmanuel Blot : >> Currently, there is no way to turn this off. > > Very, very bad news ;-( > IMHO, this is a recurrent issue with CMake. It seems there is no way > to guarantee that a project that builds well with a version of CMake > will build the same way with the next minor iteration (used to be > called "patch release"). I think "recurrent" is a relatively tough statement, I'm using CMake for 7+ years now and never get caught by such an issue. I think that, CMake developpers are indeed very concerned with backward compatibilty. POLICY are made for that. CMake test suite and related dashboard are there too. The fact is sometimes you can not imagine what people do with the software you make :-] So breakage during RC is not that bad. >From my point view this reveals two things: - the whole CMake test suite is not covering enough use case but there is no so much people volunteering for enhancing the test suite - There is a a lot of enhancement request for CMake coming from the community so CMake urgently need new stringent builtin checks in order to avoid the "noise of misusage" (no blame to anyone just a feeling from reading the ML) > Adding new options, new error detections to CMake is great, but > turning on these new features by default is often a source of issues. > We cannot control which minor release of CMake a client uses to build > up an application. Controlling a major version is ok (2.6 vs. 2.8), > but controlling a patch release is impossible, as CMake gets > automatically updated in Linux distributions, for example. In the end, I off course agree with you that one should avoid such "default new behavior", I think in this case it is possible so may be switching those warning off by default would be the way to go for 2.8.4 (my personal opinion though). >> The idea was to catch misspelled words. > > The idea is definitely nice, but why do not turn on this kind of new > policies on explicit request (either with a new option switch and/or a > new POLICY statement) as long as CMake does not reach a new major > milestone? > Dealing with the constant modifications of CMake options is a tough > job for a software maintainer, I believe. Dealing with constant user request is a tough job for developers too, Just kidding :-] -- 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] New warnings in CMake 2.8.4-rc2
On 2/2/2011 11:14 AM, Emmanuel Blot wrote: Currently, there is no way to turn this off. Very, very bad news ;-( IMHO, this is a recurrent issue with CMake. It seems the I was wrong. Please read Brad King's posts on this, and then see if it answers your questions. -Bill ___ 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] New warnings in CMake 2.8.4-rc2
> Currently, there is no way to turn this off. Very, very bad news ;-( IMHO, this is a recurrent issue with CMake. It seems there is no way to guarantee that a project that builds well with a version of CMake will build the same way with the next minor iteration (used to be called "patch release"). Adding new options, new error detections to CMake is great, but turning on these new features by default is often a source of issues. We cannot control which minor release of CMake a client uses to build up an application. Controlling a major version is ok (2.6 vs. 2.8), but controlling a patch release is impossible, as CMake gets automatically updated in Linux distributions, for example. > Are the warnings valid? It > means you are giving -D options on the command line, and those variables are > never touched in the project. Seems like you would not want to use them > anymore. It seems, but it is not always the case. For example, the same command line parameters may be given to several CMake scripts, and depending on the script, the script may or may not use them. It's far easier do to this way rather than specifying a very specific command line for every single project. > The idea was to catch misspelled words. The idea is definitely nice, but why do not turn on this kind of new policies on explicit request (either with a new option switch and/or a new POLICY statement) as long as CMake does not reach a new major milestone? Dealing with the constant modifications of CMake options is a tough job for a software maintainer, I believe. So if I understand it right, the only way to keep the project building without new warning is to tweak the way CMake is invoked. Trouble is, does CMake 2.8.0 accept the -- disable warning option switches? In other words, how should I invoke CMake so that it can build the same, existing projects whatetever the actual CMake 2.8.x release ? Thanks, Manu ___ 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] New warnings in CMake 2.8.4-rc2
On 2/2/2011 9:21 AM, Michael Jackson wrote: On Feb 2, 2011, at 9:08 AM, Brad King wrote: cmake --help: --warn-uninitialized= Warn about uninitialized values. --warn-unused-vars = Warn about unused variables. --no-warn-unused-cli= Don't warn about command line options. -Brad So does the -warn-uninitialized ENABLE or DISABLE the new warnings? What Bill and Brad are saying, in my opinion, are opposite. Maybe just some more clarification on this would be great. My mistake, you can turn it off. -Bill ___ 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] New warnings in CMake 2.8.4-rc2
On 2/2/2011 9:59 AM, Micha Renner wrote: Am Mittwoch, den 02.02.2011, 09:12 -0500 schrieb Bill Hoffman: On 2/2/2011 6:10 AM, Micha Renner wrote: Am Mittwoch, den 02.02.2011, 12:00 +0100 schrieb Emmanuel Blot: Hello, How to disable the new warnings CMake 2.8.4-rc2 emits, such as the following ones? I support this question too. There should be a way to switch off this feature of CMake, especially when variables are used uninitialized. Currently, there is no way to turn this off. Are the warnings valid? In my case not. My approach was uninitialized variables do not hurt. An example (pseudo code): The first thing I do is a platform check. IF(MSVC) UseAndFind(TLIBWIN) ELSEIF(APPLE) UseAndFind(TLIBQUARTZ) ELSEIF(UNIX) UseAndFind(TLIBUNIX) END() Then somewhere in the build-tree: TARGET_LINK_LIBRARIES(tm ${TLIBWIN} ${TLIBQUARTZ} ${TLIBUNIX}) That was a simple solution. It would be interesting to see, what your CMakeLists(Version 1.0) file says :) It should not warn about that by default. It only warns by default for unused variables passed on the command line. -Bill ___ 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] New warnings in CMake 2.8.4-rc2
Am Mittwoch, den 02.02.2011, 09:49 -0500 schrieb Brad King: > On 2/2/2011 9:21 AM, Michael Jackson wrote: > > On Feb 2, 2011, at 9:08 AM, Brad King wrote: > >> > >> cmake --help: > >> > >> --warn-uninitialized= Warn about uninitialized values. > >> --warn-unused-vars = Warn about unused variables. > >> --no-warn-unused-cli= Don't warn about command line options. > > > > So does the -warn-uninitialized ENABLE or DISABLE the new warnings? > > It does what the documentation says (enable). Bill's answer > was incorrect unless he was referring to something else. There > are three cases: > > - User passes -DCMAKE_BIULD_TYPE on the command line and gets a warning > because it is misspelled and therefore unused. This is ON by default > but can be disabled with --no-warn-unused-cli, or by *gasp* not passing > unused variables. > > - Project does ${UNINITIALIZED_VAR} and nothing happens, but it can > be a warning if --warn-uninitialized is passed. This is intended to > help cleanup project source code. > > - Project does set(VAR_THAT_IS_NOT_USED 1) and nothing happens, but > can be a warning if --warn-unused-vars is passed. Yes, this is my solution, but is it in this form documented? Micha ___ 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] New warnings in CMake 2.8.4-rc2
On 2/2/2011 9:21 AM, Michael Jackson wrote: > On Feb 2, 2011, at 9:08 AM, Brad King wrote: >> >> cmake --help: >> >> --warn-uninitialized= Warn about uninitialized values. >> --warn-unused-vars = Warn about unused variables. >> --no-warn-unused-cli= Don't warn about command line options. > > So does the -warn-uninitialized ENABLE or DISABLE the new warnings? It does what the documentation says (enable). Bill's answer was incorrect unless he was referring to something else. There are three cases: - User passes -DCMAKE_BIULD_TYPE on the command line and gets a warning because it is misspelled and therefore unused. This is ON by default but can be disabled with --no-warn-unused-cli, or by *gasp* not passing unused variables. - Project does ${UNINITIALIZED_VAR} and nothing happens, but it can be a warning if --warn-uninitialized is passed. This is intended to help cleanup project source code. - Project does set(VAR_THAT_IS_NOT_USED 1) and nothing happens, but can be a warning if --warn-unused-vars is passed. -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] New warnings in CMake 2.8.4-rc2
On Feb 2, 2011, at 9:12 AM, Bill Hoffman wrote: > On 2/2/2011 6:10 AM, Micha Renner wrote: >> Am Mittwoch, den 02.02.2011, 12:00 +0100 schrieb Emmanuel Blot: >>> Hello, >>> >>> How to disable the new warnings CMake 2.8.4-rc2 emits, such as the >>> following ones? >> >> I support this question too. >> >> There should be a way to switch off this feature of CMake, especially >> when variables are used uninitialized. >> > > Currently, there is no way to turn this off. Are the warnings valid? It > means you are giving -D options on the command line, and those variables are > never touched in the project. Seems like you would not want to use them > anymore. The idea was to catch misspelled words. > > -DMYVARR=1 , but you wanted MYVAR. > > -Bill On Feb 2, 2011, at 9:08 AM, Brad King wrote: > > cmake --help: > > --warn-uninitialized= Warn about uninitialized values. > --warn-unused-vars = Warn about unused variables. > --no-warn-unused-cli= Don't warn about command line options. > > -Brad So does the -warn-uninitialized ENABLE or DISABLE the new warnings? What Bill and Brad are saying, in my opinion, are opposite. Maybe just some more clarification on this would be great. Thanks Mike Jackson ___ 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] New warnings in CMake 2.8.4-rc2
On 2/2/2011 6:10 AM, Micha Renner wrote: Am Mittwoch, den 02.02.2011, 12:00 +0100 schrieb Emmanuel Blot: Hello, How to disable the new warnings CMake 2.8.4-rc2 emits, such as the following ones? I support this question too. There should be a way to switch off this feature of CMake, especially when variables are used uninitialized. Currently, there is no way to turn this off. Are the warnings valid? It means you are giving -D options on the command line, and those variables are never touched in the project. Seems like you would not want to use them anymore. The idea was to catch misspelled words. -DMYVARR=1 , but you wanted MYVAR. -Bill ___ 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] New warnings in CMake 2.8.4-rc2
On 2/2/2011 6:10 AM, Micha Renner wrote: > Am Mittwoch, den 02.02.2011, 12:00 +0100 schrieb Emmanuel Blot: >> Hello, >> >> How to disable the new warnings CMake 2.8.4-rc2 emits, such as the >> following ones? > > I support this question too. > > There should be a way to switch off this feature of CMake, especially > when variables are used uninitialized. cmake --help: --warn-uninitialized= Warn about uninitialized values. --warn-unused-vars = Warn about unused variables. --no-warn-unused-cli= Don't warn about command line options. -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] New warnings in CMake 2.8.4-rc2
Am Mittwoch, den 02.02.2011, 12:00 +0100 schrieb Emmanuel Blot: > Hello, > > How to disable the new warnings CMake 2.8.4-rc2 emits, such as the > following ones? I support this question too. There should be a way to switch off this feature of CMake, especially when variables are used uninitialized. Micha ___ 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] New warnings in CMake 2.8.4-rc2
Hello, How to disable the new warnings CMake 2.8.4-rc2 emits, such as the following ones? CMake Warning: The variable, 'NAMEFUNC', specified manually, was not used during the generation. CMake Warning: The variable, 'SAJOBS', specified manually, was not used during the generation. CMake Warning: The variable, 'TAG_RELEASE', specified manually, was not used during the generation. CMake Warning: The variable, 'USER_COMPONENTS_PATH', specified manually, was not used during the generation. CMake Warning: The variable, 'XCC_VER', specified manually, was not used during the generation. Is there a POLICY switch to enable/disable this new feature? Thanks, Manu ___ 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