问题
I'm trying to set up CLion (windows 8.1, 64-bit, using cygwin and not mingw), and I'm trying to compile+run a project, but I don't know what to do here:
It says I need a Target and a Configuration, but there're none in the dropdown. Is there a configuration step I missed?
回答1:
At the end of your CMakeLists.txt you should have a line that reads:
add_executable(MyTarget ${SOURCE_FILES})
This line specifies the name of your target (the executable is generated with this name).
If you don't have this line, add it and click on the "Reload changes" link at the top. This line should have been created when CLion created your project.
回答2:
Check in CMakeLists.txt that the line set(SOURCE_FILES main.cpp ... does not reference files that does not exist. It solved it for me.
回答3:
I believe, the problem is, your Compiler/Cmake environment is not set. Check File/Settings/Build, Execution, Deployment/Toolchain setup before editing the configuration.
来源:https://stackoverflow.com/questions/27801836/setting-build-target-in-clion