Detect clion in cmake

Completed

I'd like to run a execute a command in cmake ONLY if it is clion that has triggered the cmake configuration. Is there any variable I can query to determine this?

I do know that it would be possible to pass `-DCLION_BUILD` to the cmake arguments, but I would like to find a more automated way. 

Thanks all

0
2 comments
Avatar
Permanently deleted user

You can also do something among the lines of:

 

if ($ENV{JETBRAINS_IDE})
set(JETBRAINS_CLION_IDE True CACHE BOOL "Build under CLion")
endif ($ENV{JETBRAINS_IDE})

1
Avatar
Permanently deleted user

Great idea. Thanks!

0

Please sign in to leave a comment.