CMake flags project directory variable?
已回答
I'm trying to set CMAKE_TOOLCHAIN_PATH and the toolchain is stored in my project directory, but it seems cmake is not run inside the project directory so it requires an absolute path. Is there a variable for the path to the project directory I can use?
请先登录再写评论。
Hi! Are you setting CMAKE_TOOLCHAIN_PATH in the CMakeLists.txt? You can try using the PROJECT_SOURCE_DIR CMake variable.
Also there is a feature request about an ability to use CLion project root in CMake options and environment variables: https://youtrack.jetbrains.com/issue/CPP-9915. Feel free to comment or upvote.
I thought I had left a comment with an update but apparently not! I realised relative paths do work. I also upvoted that request though! Thanks