Quote:
Originally Posted by olilarkin
Could you elaborate? Not sure I agree such a bad thing. There is a constant conflict where I want to try and minimise set up for beginners as well as making it flexible for people who know what they're doing . /mt /md matching amongst different libraries was a constant source of problems for me when I was starting out. It's also really annoying if you give someone a plug-in and they don't have the visual studio runtime for your vs version
|
Silently replacing the user's setting (in CMAKE_*_FLAGS_*) by something different will break other projects that want to build your library as a subproject. Even if used as a library, the user will be forced to use the same settings, or edit the CMakeLists.txt of your library. This is absolutely a bad thing.
At the same time, I do agree that having "sane" defaults for beginners/ease of use does make sense. The best way I have found so far, is to set the CMAKE_*_FLAGS_*_INIT variables in a CMAKE_USER_MAKE_RULES_OVERRIDE script. This allows the user to set the flags without them being overwritten, and won't break use as a subdirectory.
I just added this to my fork.