How to include current directory using CMake
It is often helpful to include the current directory for C++ projects. When using GCC directly, this can be done using -I.
, whereas for CMake you need to use the following statement:
CMakeLists.txt
target_include_directories(myexe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Remember to replace myexe
by the name of your executable target.
Check out similar posts by category:
CMake
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow