[Cmake] Supressing errors for missing subdirectories

Miller, James V (CRD) millerjv at crd.ge.com
Tue Jul 10 08:22:48 EDT 2001


Why doesn't the toplevel vxl CMakeLists.txt file use an OPTION() for each directory that a user can
turn off.  Then it is a simple matter of editting the cache to select which directories to build.

Here is a snippet from the Insight CMakeLists.txt file

# Add an option to build or not build the Examples
OPTION(BUILD_EXAMPLES "Build the examples directory")
IF(BUILD_EXAMPLES)
SUBDIRS(Examples)
ENDIF(BUILD_EXAMPLES)

You pass an additional argument to the option command for the default value if you want all the
directories to be "On" by default.

-----Original Message-----
From: Amitha Perera [mailto:perera at cs.rpi.edu]
Sent: Monday, July 09, 2001 11:47 PM
To: cmake at public.kitware.com
Subject: [Cmake] Supressing errors for missing subdirectories


I'd like to implement a feature where error messages for missing
subdirectories can be toggled on and off. This would allow me, in the
vxl context, to remove libraries in which I'm not interested and not
have to modify parent CMakeLists.txt files.

The easiest way to do this is to have a cached (or otherwise) boolean
variable. Two questions:
- Does anyone object to this, or have a better way of doing it?
- How should such a variable be documented? That is, should be be a
  "permanent" variable, or should it be created by a project's
  CMakeLists.txt?

Amitha.

_______________________________________________
Cmake mailing list
Cmake at public.kitware.com
http://public.kitware.com/mailman/listinfo/cmake




More information about the CMake mailing list