Discussion:
[CMake] ALL_BUILD and ZERO_CHECK
Robert Dailey
2008-11-22 05:44:49 UTC
Permalink
Hi,

Is there a purpose for these 2 projects? They are generated when I run:

cmake -G "Visual Studio 9 2008"

Is there a way to prevent CMake from generating these 2 projects? I really
don't need them.
Armin Berres
2008-11-22 13:12:41 UTC
Permalink
Post by Robert Dailey
Hi,
cmake -G "Visual Studio 9 2008"
ZERO_CHECK will rerun cmake. You can/should execute this after changing
something on your CMake files.
ALL_BUILD is simply a target which builds all and everything project in
the active solution, I guess one can compare it to "make all".
Post by Robert Dailey
Is there a way to prevent CMake from generating these 2 projects? I really
don't need them.
No idea,
sorry.

HTH
Armin

PS:
What I'd reallylike to know is if it is possible to prevent the creation
of the Source/Header folders. With source groups it is just possible to put
files in a subdirectory, but I want some files directly in the project
root.
Philip Lowman
2008-11-22 17:47:08 UTC
Permalink
Post by Armin Berres
What I'd reallylike to know is if it is possible to prevent the creation
of the Source/Header folders. With source groups it is just possible to put
files in a subdirectory, but I want some files directly in the project
root.
For this, simply set the folder name to ""
--
Philip Lowman
Armin Berres
2008-11-24 12:39:57 UTC
Permalink
Post by Philip Lowman
Post by Armin Berres
What I'd reallylike to know is if it is possible to prevent the creation
of the Source/Header folders. With source groups it is just possible to put
files in a subdirectory, but I want some files directly in the project
root.
For this, simply set the folder name to ""
That't the behaviour I would expect, but sadly it doesn't work. I just
checked with CMake 2.6.2 and "" leads to created Source and Header
folders.

Greetings,
Armin
Philip Lowman
2008-11-24 13:38:43 UTC
Permalink
Post by Armin Berres
Post by Philip Lowman
Post by Armin Berres
What I'd reallylike to know is if it is possible to prevent the
creation
Post by Philip Lowman
Post by Armin Berres
of the Source/Header folders. With source groups it is just possible to
put
Post by Philip Lowman
Post by Armin Berres
files in a subdirectory, but I want some files directly in the project
root.
For this, simply set the folder name to ""
That't the behaviour I would expect, but sadly it doesn't work. I just
checked with CMake 2.6.2 and "" leads to created Source and Header
folders.
Works for me. Puts files in the root of the "bar" project:

PROJECT(foo)
SOURCE_GROUP("" FILES bar.h bar.cc)
ADD_EXECUTABLE(bar bar.h bar.cc)
--
Philip Lowman
Armin Berres
2008-11-24 14:44:39 UTC
Permalink
Post by Philip Lowman
PROJECT(foo)
SOURCE_GROUP("" FILES bar.h bar.cc)
ADD_EXECUTABLE(bar bar.h bar.cc)
Ah, ok. What I am trying is more or less the following:

PROJECT(foo)
source_group("" REGULAR_EXPRESSION "src/[^/]+$")
ADD_EXECUTABLE(bar src/bar.h src/bar.cc)

The above places bar.h and bar.cc in a folder called "Header Files",
source_group("." REGULAR_EXPRESSION "src/[^/]+$") works as expected and
places the two files in a "." folder.
Seems as if the combination of REGULAR_EXPRESSION+"" is not working.

/Armin
Robert Dailey
2008-11-24 15:13:01 UTC
Permalink
Post by Philip Lowman
Post by Philip Lowman
PROJECT(foo)
SOURCE_GROUP("" FILES bar.h bar.cc)
ADD_EXECUTABLE(bar bar.h bar.cc)
PROJECT(foo)
source_group("" REGULAR_EXPRESSION "src/[^/]+$")
ADD_EXECUTABLE(bar src/bar.h src/bar.cc)
The above places bar.h and bar.cc in a folder called "Header Files",
source_group("." REGULAR_EXPRESSION "src/[^/]+$") works as expected and
places the two files in a "." folder.
Seems as if the combination of REGULAR_EXPRESSION+"" is not working.
You guys have managed to steal my thread and get completely off topic.

Can anyone answer my original question please?
Bill Hoffman
2008-11-24 16:36:10 UTC
Permalink
Post by Robert Dailey
You guys have managed to steal my thread and get completely off topic.
Can anyone answer my original question please?
ZERO_CHECK is essential to the build working. ALL_BUILD is useful as
it creates the correct depend chain. There is no way to turn these off.



-Bill
Bill Hoffman
2008-11-24 18:01:41 UTC
Permalink
I'm pretty sure I can create a visual studio solution with a single
project that builds exactly what I'm having CMake build for me. When I
manually create this visual studio solution I never create a ZERO_CHECK
project or an ALL_BUILD project and everything works perfectly fine.
Having said that, I disagree with you in that it is essential for the
build to work. I would like to make a feature request that there be an
option in the future to disable the generation of the ZERO_CHECK and
ALL_BUILD projects.
There are bugs and issues that we workaround in VS studio from time to
time. It may not affect your project, but in general for depends and
custom commands to work correctly ZERO_CHECK is required. Are these
targets causing you trouble?


-Bill
Bill Hoffman
2008-11-24 18:05:27 UTC
Permalink
Post by Bill Hoffman
I'm pretty sure I can create a visual studio solution with a single
project that builds exactly what I'm having CMake build for me. When I
manually create this visual studio solution I never create a
ZERO_CHECK project or an ALL_BUILD project and everything works
perfectly fine.
Having said that, I disagree with you in that it is essential for the
build to work. I would like to make a feature request that there be an
option in the future to disable the generation of the ZERO_CHECK and
ALL_BUILD projects.
There are bugs and issues that we workaround in VS studio from time to
time. It may not affect your project, but in general for depends and
custom commands to work correctly ZERO_CHECK is required. Are these
targets causing you trouble?
Oh yeah, one more thing. CTest uses ALL_BUILD to figure out how to
build a project. So, CTest would potentially be broken if that were
disabled.

-Bill
Robert Dailey
2008-11-24 18:21:03 UTC
Permalink
Post by Bill Hoffman
I'm pretty sure I can create a visual studio solution with a single
project that builds exactly what I'm having CMake build for me. When I
manually create this visual studio solution I never create a ZERO_CHECK
project or an ALL_BUILD project and everything works perfectly fine.
Having said that, I disagree with you in that it is essential for the
build to work. I would like to make a feature request that there be an
option in the future to disable the generation of the ZERO_CHECK and
ALL_BUILD projects.
There are bugs and issues that we workaround in VS studio from time to
time. It may not affect your project, but in general for depends and custom
commands to work correctly ZERO_CHECK is required. Are these targets
causing you trouble?
Oh yeah, one more thing. CTest uses ALL_BUILD to figure out how to build a
project. So, CTest would potentially be broken if that were disabled.
The only trouble these projects are causing me is clutter. There is no
functional purpose for them as far as I know, which is another reason why I
do not like them.

I'm not familiar with CTest. All I can say on that topic is that I've used
Visual Studio for over 6 years and I've never had to use anything called
CTest to get projects working.
Bill Hoffman
2008-11-24 18:28:52 UTC
Permalink
Post by Robert Dailey
The only trouble these projects are causing me is clutter. There is no
functional purpose for them as far as I know, which is another reason
why I do not like them.
You could try this:

set(CMAKE_SUPPRESS_REGENERATION TRUE)

I think that will get rid of ZERO_CHECK, but I am not sure. Again, this
will potentially break your builds, and make them less reliable.
ZERO_CHECK is used to make sure that the project files are up-to-date
relative to the CMakeLists.txt files. It is also used to check some
depend information that VS does not do.
Post by Robert Dailey
I'm not familiar with CTest. All I can say on that topic is that I've
used Visual Studio for over 6 years and I've never had to use anything
called CTest to get projects working.
CTest is the built in regression testing system of CMake. You can use
it to create continuous testing integration for a project (see
www.cdash.org).

-Bill
Robert Dailey
2008-11-24 19:57:45 UTC
Permalink
Post by Bill Hoffman
Post by Robert Dailey
The only trouble these projects are causing me is clutter. There is no
functional purpose for them as far as I know, which is another reason why I
do not like them.
set(CMAKE_SUPPRESS_REGENERATION TRUE)
I think that will get rid of ZERO_CHECK, but I am not sure. Again, this
will potentially break your builds, and make them less reliable. ZERO_CHECK
is used to make sure that the project files are up-to-date relative to the
CMakeLists.txt files. It is also used to check some depend information that
VS does not do.
Post by Robert Dailey
I'm not familiar with CTest. All I can say on that topic is that I've used
Visual Studio for over 6 years and I've never had to use anything called
CTest to get projects working.
CTest is the built in regression testing system of CMake. You can use it
to create continuous testing integration for a project (see www.cdash.org
).
Ah, okay. If it manages synchronization between the CMakeLists.txt files and
the vcproj files I can understand the need for them. I guess I should have
first asked what they are for instead of immediately trying to get rid of
them :)

Thanks for your help. I'll leave them be for now and just deal with the
clutter. Of course, it would be great to be able to stuff some of these
CMake files into a subdirectory of some sort so I don't have to see them
clutter the CMakeLists.txt parent directory.
Robert Dailey
2008-11-24 17:58:53 UTC
Permalink
Post by Robert Dailey
You guys have managed to steal my thread and get completely off topic.
Post by Robert Dailey
Can anyone answer my original question please?
ZERO_CHECK is essential to the build working. ALL_BUILD is useful as it
creates the correct depend chain. There is no way to turn these off.
I'm pretty sure I can create a visual studio solution with a single project
that builds exactly what I'm having CMake build for me. When I manually
create this visual studio solution I never create a ZERO_CHECK project or an
ALL_BUILD project and everything works perfectly fine.

Having said that, I disagree with you in that it is essential for the build
to work. I would like to make a feature request that there be an option in
the future to disable the generation of the ZERO_CHECK and ALL_BUILD
projects.
Hendrik Sattler
2008-11-24 20:14:38 UTC
Permalink
Post by Bill Hoffman
Post by Robert Dailey
You guys have managed to steal my thread and get completely off topic.
Can anyone answer my original question please?
ZERO_CHECK is essential to the build working. ALL_BUILD is useful as
it creates the correct depend chain. There is no way to turn these off.
Maybe they could be renamed to something more pleasant to the eye (means:
_not_ uppercase), e.g. "__cmake_target_all" and "__cmake_target_depcheck".

ALL UPPERCASE FOR SUCH THINGS IS NOT REALLY THE BEST CHOICE.

HS
Robert Dailey
2008-11-24 20:37:11 UTC
Permalink
Post by Hendrik Sattler
Post by Bill Hoffman
Post by Robert Dailey
You guys have managed to steal my thread and get completely off topic.
Can anyone answer my original question please?
ZERO_CHECK is essential to the build working. ALL_BUILD is useful as
it creates the correct depend chain. There is no way to turn these off.
_not_ uppercase), e.g. "__cmake_target_all" and "__cmake_target_depcheck".
ALL UPPERCASE FOR SUCH THINGS IS NOT REALLY THE BEST CHOICE.
That would definitely make it easier on the eyes, but I would really like to
see them placed in a subdirectory. Visual Studio also generates *.user files
and other temporary files that clutter the root directory. By putting the
vcproj files in a subdirectory we solve the problem elegantly.
Philip Lowman
2008-11-25 04:03:18 UTC
Permalink
Post by Philip Lowman
Post by Philip Lowman
PROJECT(foo)
SOURCE_GROUP("" FILES bar.h bar.cc)
ADD_EXECUTABLE(bar bar.h bar.cc)
PROJECT(foo)
source_group("" REGULAR_EXPRESSION "src/[^/]+$")
ADD_EXECUTABLE(bar src/bar.h src/bar.cc)
Post a bug report and for a workaround use the FILES argument I guess?

SET(bar_PUBLIC_HDRS src/bar.h)
SET(bar_SRCS src/bar.cc)

SET(bar_FILES ${bar_PUBLIC_HDRS} ${bar_SRCS})
source_group("" FILES ${bar_FILES})
add_executable(bar ${bar_FILES})
--
Philip Lowman
D***@L-3COM.COM
2008-11-24 23:29:36 UTC
Permalink
Post by Bill Hoffman
Post by Robert Dailey
The only trouble these projects are causing me is clutter. There is
no
Post by Bill Hoffman
Post by Robert Dailey
functional purpose for them as far as I know, which is another
reason
Post by Bill Hoffman
Post by Robert Dailey
why I do not like them.
set(CMAKE_SUPPRESS_REGENERATION TRUE)
I think that will get rid of ZERO_CHECK, but I am not sure. Again,
this
Post by Bill Hoffman
will potentially break your builds, and make them less reliable.
ZERO_CHECK is used to make sure that the project files are up-to-date
relative to the CMakeLists.txt files. It is also used to check some
depend information that VS does not do.
And what this supports is the ability to incrementally build the VS
project files themselves, not just the source files in the projects.

What I've noticed in Visual Studio 6 builds using CMake--which don't
have a ZERO_CHECK project--is that I edit one of my CMakeLists.txt
files, then click "Build", and sure enough CMake generates a new DSP
file for that project; but then it continues building that same project
without reloading, which of course doesn't do what I want, and I have to
click "Build" again in order to make my project compile the way it's
supposed to. And sometimes it still doesn't quite recover correctly.

In my current Visual Studio 2008 builds using CMake, this process
appears to work smoother--and I'm guessing it's because these builds
have a ZERO_CHECK project.

But if you were still thinking of the Visual Studio files as static
source files that you edit "by hand", then you wouldn't think of the
CMakeLists.txt files as source files on which you might want to detect
changes and trigger incremental builds, just as you trigger an
incremental build when you edit one of your C++ source files.

So yes, clearly you can make all your own vcproj and sln files directly
in Visual Studio and build software successfully. I just got sick of
continually cutting and pasting in and out of awkward windows and
clicking on all the numerous things I had to click to get each project's
settings correctly, and CMake offered a way to avoid all that nonsense
by defining all the repeated stuff once in a kind of "macro", and
furthermore an easy way to do out-of-source builds, which I could do
with "make" but could never see a practical way to do from within Visual
Studio's own project editor. Moreover, I found that CMake really could
produce both a Visual Studio workspace and a Linux makefile for a
substantial project, giving me both of these for less than it cost me
just to port a workspace to a makefile by hand.

In that substantial project, the handy thing about ALL_BUILD was that it
was in fact the one project you could build if you wanted everything in
the workspace to be built; several of the other projects were
executables, each of which had nothing except ALL_BUILD depending on it,
so without a project like ALL_BUILD we would have had either to build
every single one in succession or else to invent some other (much worse)
artificial dependency between projects. But even in a simple project
where there's already one project that depends on all others, I'd live
with the existence of ALL_BUILD in return for all the other stuff. At
least it doesn't actively _prevent_ me from doing something I need to
do.

But if you really love a carefully crafted Visual Studio "solution",
with every box in every project carefully and individually filled in or
checked off or left empty by a human hand with loving personal care,
then CMake is not for you.

David Karr
D***@L-3COM.COM
2008-11-24 23:33:29 UTC
Permalink
Post by Robert Dailey
Ah, okay. If it manages synchronization between the CMakeLists.txt
files and
Post by Robert Dailey
the vcproj files I can understand the need for them. I guess I should
have
Post by Robert Dailey
first asked what they are for instead of immediately trying to get rid
of
Post by Robert Dailey
them :)
Oh darn, my long-winded (and now evidently unnecessary) reply to an
earlier posting crossed this one in the mail. Sorry about that; I hope
it doesn't waste anyone's time but mine.

David Karr
Loading...