set cmake options

已回答

I could not find this in CLion. What we are doing here is to use some options for testing. This is how it looks like in CMake:

option( BUILD_TESTING "Build testing targets" OFF )

Running CMake GUI I am able to check this on their user interface and that will update solution to include test projects. I could not find such a thing in CLion. There is screen under Preferences->Build, Execution, Deployment->CMake, but putting options there did not work. Please not that changing variable in CMake file itself is No No since I can forget to turn in back (and we have pretty big team).

This is what so far preventing me to use CLion as main development tool.

 

Thanks!

Simon

0

Please try using -DBUILD_TESTING=ON command in Preferences->Build, Execution, Deployment->CMake. Does that help?

1

Yes, that works.

 

Thanks!

0
Avatar
Permanently deleted user

Dear all,

I am interested in using CLion for C++ teaching in a class. Previous exercises were all based on CMake, so that is ok I believe. However there is something I cannot do which is related to this post.

In a CMake way, you would use ccmake, and toggle ON/OFF the options that you want, or to select the compiler, etc....

When you edit the CMakeCache manually (which is not super convenient since you see everything and get polluted with uninteresting information for the new comer's eye) it is overwritten if you reload the project (which is super annoying).

Is there a graphical way to set the cmake options making this task easy. For large project with hundreds of options and detected paths needing manual operations this is obviously a must be.

 

summary: ccmake inside of CLion and/or keeping values in CMakeCache.txt when reloading the project.

 

Thanks for your help 

 

2

请先登录再写评论。