[Cmake] Configuring a subdirectory with CMake

Andy Cedilnik andy.cedilnik at kitware.com
Wed Jul 28 09:42:01 EDT 2004


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