[CMake] canonical way to distinguish CMake builds?

Brad King brad.king at kitware.com
Wed Jul 5 10:38:07 EDT 2006


Brandon J. Van Every wrote:
> I have put ADD_DEFINITIONS(-DCMAKE_BUILD) in CMakeLists.txt and 
> statements such as #if !defined(CMAKE_BUILD) in my .h files.  Is there a 
> canonical definition for this?  I didn't see any canonical flag being 
> passed to the C compiler, so I'm guessing there isn't one, but I have a 
> vague memory of reading about such a thing in the archives.  Couldn't 
> find any reference to it though.

No.  Adding the definition yourself is the right way.

-Brad


More information about the CMake mailing list