How to change include dirs, library dirs and libraries with CLion

半世苍凉 提交于 2019-12-04 17:07:32

问题


In CLion, how can I specify the include directories where the C++ compiler will look for header files? Also, how do I setup the libraries to link against, and their library directories?

Currently I'm doing those tasks modifying directly the file CMakeLists.txt:

include_directories(/opt/netcdf/include)
link_directories(/opt/netcdf/lib)
link_libraries(netcdf)

But I wonder if it is possible to accomplish the same thing using the GUI.

Thanks


回答1:


In CLion, the CMakeLists.txt file(s) for your project are the system of record for your build system and settings. What's shown in the GUI is derived from the build script. This is similar to the way IntelliJ uses a Maven pom.xml file as the system of record for a Java build and shows things in the IDE based on the file. Based on my past experience with IntelliJ, I expect that JetBrains will make this a more bidirectional experience (updating the GUI will edit the CMakeLists.txt) over time.



来源:https://stackoverflow.com/questions/27852944/how-to-change-include-dirs-library-dirs-and-libraries-with-clion

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!