[Cmake] PROJECT command
Ken Martin
ken.martin at kitware.com
Fri Aug 9 09:29:43 EDT 2002
As an added note since we nest projects frequently. The PROJECT command
will change PROJECT_NAME as it encounters each project. It also changes
PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR each time. But... it also defines
args[0]_SOURCE_DIR and args[0]_BINARY_DIR which you can use for nested
projects. (e.g. VTK_SOURCE_DIR ...) Which you use depends on what you are
trying to do.
Ken
-----Original Message-----
From: cmake-admin at public.kitware.com
[mailto:cmake-admin at public.kitware.com]On Behalf Of Bill Hoffman
Sent: Friday, August 09, 2002 9:21 AM
To: Miller, James V (Research); CMake developers (E-mail)
Subject: Re: [Cmake] PROJECT command
This is not a change to CMake. The PROJECT command has always changed
the PROJECT_NAME from that point down. My question is why does the
sub project care if it is part of a larger project or not? For example,
the jpeg library in VTK is a PROJECT(VTKJPEG), and can be compiled by
itself, but
also can be part of VTK.
If you want the sub project to know it is part of a larger project, then
set
a variable in the cmakelist file above the sub project, PART_OF_PROJECT
xxx,
then check for that in your sub project.
-Bill
At 09:01 AM 8/9/2002 -0400, Miller, James V (Research) wrote:
What is CMake's desired behavior if it finds two "PROJECT" commands
within a directory tree?
For instance, the toplevel CMakeLists.txt file has a PROJECT command and
a subdirectory
also has a PROJECT command. The motivation here is that I would like to
have a subdirectory
that can be built as part of the toplevel project, or it can be itself.
I thought in previous versions of CMake, if it found subsequent PROJECT
commands they were
ignored. In CMake 1.4.3, it appears as though the second PROJECT
command overrides the
${PROJECT_NAME} (at least for the subdirectory and its descendents).
I suspect the answer is going to be "it hurts when you do that". So let
me ask the question a
different way:
What is the currently suggested mechanism for setting up a subdirectory
so that it can be
built as part of a project or as a standalone project. I want to be able
to detect whether the
directory is part of a bigger project or not. My attempt at the
CMakeLists.txt for the subdirectory
was something like
PROJECT(subproject)
IF (${PROJECT_NAME} MATCHES "subproject")
# this subdirectory is being built as a standalone project
ELSE ()
# this subdirectory is being built as part of a bigger project
ENDIF ()
<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" />
Jim Miller
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301
millerjv at research.ge.com
james.miller at research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005,
Cell: (518) 505-7065, Fax: (518) 387-6981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20020809/4d3d175f/attachment.html>
More information about the CMake
mailing list