[Cmake] Configuring a subdirectory with CMake

Miller, James V (Research) millerjv at crd.ge.com
Wed Jul 28 09:47:28 EDT 2004


Andy, 

That was one of the options I listed in the posting. While I agree that this
will work, it adds 3 lines to every CMakeLists.txt file.  Do you
think a feature "should" be added to CMake to make this cleaner?

What if in a subdirectory CMakeLists.txt file we put a command 
(don't get hung up on the name)

PARENT(InsightApplications)  

When CMake sees this command, it checks to see if it was already seen
the parent project InsightApplications.  If it hasn't, then it issues
a warning.

PARENT is probably not the right name.


Jim

-----Original Message-----
From: Andy Cedilnik [mailto:andy.cedilnik at kitware.com]
Sent: Wednesday, July 28, 2004 9:42 AM
To: Miller, James V (Research)
Cc: 'Luis Ibanez'; CMake developers (E-mail); Insight-developers
(E-mail)
Subject: Re: [Cmake] Configuring a subdirectory with CMake


Hi Jim,

Put in root CMakeLists.txt:

SET(ROOT_IS_SET 1)

and then in subdirectories:

IF(NOT ROOT_IS_SET)
  MESSAGE(FATAL_ERROR "CMake has to be called in the root directory:
${CMAKE_CURRENT_SOURCE_DIR}/..!")
ENDIF(NOT ROOT_IS_SET)

		Andy

On Wed, 2004-07-28 at 09:30, Miller, James V (Research) wrote:
> Is there a way in CMake, that we can place something in a subdirectories
> CMakeLists.txt file such that if cmake is run on that CMakeLists.txt 
> file without running from the root directory, that we can warn the 
> user.



More information about the Cmake mailing list