I have a library my project depends on, I check out this submodule
with git --recursive
and then include it in my CMakeLists.txt file:
add_subdirectory(dependencies/library)
add_executable(myExe ...)
add_dependencies(myExe library)
target_link_libraries(myExe library)
The problem:
library is a pretty big library and recompiling it takes an awful lot of time.
I practically NEVER change it so it should be built once, but CMake is recompiling it every time I add a single line to the CMakeLists.txt file and refresh the Visual Studio solution entirely.
How to avoid this horrible behavior and tell CMake NOT to recompile library if nothing changed into it?