<html>
This is not a change to CMake.   The PROJECT command has always
changed<br>
the PROJECT_NAME from that point down.   My question is why
does the<br>
sub project care if it is part of a larger project or not?  
For example,<br>
the jpeg library in VTK is a PROJECT(VTKJPEG), and can be compiled by
itself, but<br>
also can be part of VTK.   <br>
<br>
If you want the sub project to know it is part of a larger project, then
set <br>
a variable in the cmakelist file above the sub project, 
PART_OF_PROJECT xxx,<br>
then check for that in your sub project.   <br>
<br>
-Bill<br>
<br>
<br>
<br>
At 09:01 AM 8/9/2002 -0400, Miller, James V (Research) wrote:<br>
<blockquote type=cite class=cite cite><font size=2>What is CMake's
desired behavior if it finds two "PROJECT" commands within a
directory tree?</font><br>
 <br>
<font size=2>For instance, the toplevel CMakeLists.txt file has a PROJECT
command and a subdirectory</font><br>
<font size=2>also has a PROJECT command. The motivation here is that I
would like to have a subdirectory</font><br>
<font size=2>that can be built as part of the toplevel project, or it can
be itself.</font><br>
 <br>
<font size=2>I thought in previous versions of CMake, if it found
subsequent PROJECT commands they were</font><br>
<font size=2>ignored.  In CMake 1.4.3, it appears as though the
second PROJECT command overrides the</font><br>
<font size=2>${PROJECT_NAME} (at least for the subdirectory and its
descendents).</font><br>
 <br>
<font size=2>I suspect the answer is going to be "it hurts when you
do that".  So let me ask the question a </font><br>
<font size=2>different way:</font><br>
 <br>
<font size=2>What is the currently suggested mechanism for setting up a
subdirectory so that it can be</font><br>
<font size=2>built as part of a project or as a standalone project. I
want to be able to detect whether the</font><br>
<font size=2>directory is part of a bigger project or not.  My
attempt at the CMakeLists.txt for the subdirectory</font><br>
<font size=2>was something like</font><br>
 <br>
<font size=2>PROJECT(subproject)</font><br>
 <br>
<font size=2>IF (${PROJECT_NAME} MATCHES
"subproject")</font><br>
<font size=2># this subdirectory is being built as a standalone
project</font><br>
<font size=2>ELSE ()</font><br>
<font size=2># this subdirectory is being built as part of a bigger
project</font><br>
<font size=2>ENDIF ()</font><br>
 <br>
 <br>
<br>
 <?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><br>
<br>
<b>Jim Miller</b> <br>
<b><i>_____________________________________</i></b><br>
<i>Visualization & Computer Vision<br>
GE Research</i><br>
<i>Bldg. KW, Room C218B</i><br>
<i>P.O. Box 8, Schenectady NY 12301</i><br>
<br>
<i><u><a href="mailto:millerjv@research.ge.com">millerjv@research.ge.com</a><br>
</u></i><br>
<i><u>james.miller@research.ge.com</u></i><br>
<i>(518) 387-4005, Dial Comm: 8*833-4005, </i><br>
<i>Cell: (518) 505-7065, Fax: (518) 387-6981</i> <br>
<br>
 <br>
 <br>
</blockquote></html>