I am running C++ code on macOS using Visual Studio Code and terminal. I am using CMAKE for compiling.
But my problem is that CMAKE does not seem to take the PATH from my MACOS environment. It only has /usr/bin:/bin:/usr/sbin:/sbin in it. I have added more paths to my normal path variable (echo $PATH) but CMAKE is not using those. Where is CMAKE sourcing its path from, and how it can be expanded? It can't find GoogleTest, Boost and any other libraries I am using. To keep it cross-platform I would like to not have to use include_directories() in CMakeLists.txt.
I have set the additional path manually in the macOS CMAKE GUI and this works, now it can find my libraries and compile, but whenever I reboot it is reset back to those basic paths. Also it only works for the CMAKE GUI, the terminal CMAKE or the one I am using in Visual Studio Code still don't work. Can anyone let me know where CMAKE is sourcing those paths from and how I can expand it?