[cmake-developers] Knowing if a C project is being built

Brad King brad.king at kitware.com
Wed Feb 22 11:38:34 EST 2012


On Wed, Feb 22, 2012 at 11:32 AM, Rolf Eike Beer <eike at sf-mail.de> wrote:
>> Use CMAKE_<LANG>_COMPILER_LOADED to determine which
>> languages are enabled.
>
> In the last modification in FindOpenMP I used  the ENABLED_LANGUAGES property.
> Which of both ways is the preferred one?

I have no preference.

Both are documented and should work.  If the goal is to loop over all the
enabled languages use the property.  Otherwise the variable can be tested
for a specific language.  Of course the property is read-only so projects
cannot mess with it like they can by setting the variable ;)

-Brad



More information about the cmake-developers mailing list