I have a library on which my project depends, I check this submoduleone git --recursiveand then include it in the CMakeLists.txt file:
add_subdirectory(dependencies/library)
add_executable(myExe ...)
add_dependencies(myExe library)
target_link_libraries(myExe library)
Problem:
the library is a fairly large library and recompiling takes a very long time.
I practically NEVER change it, so it should be created once, but CMake will recompile it every time I add one line to the CMakeLists.txt file and completely update the Visual Studio solution.
How to avoid this terrible behavior and tell CMake to NOT recompile the library if nothing has changed in it?
source
share