Good practice in a C++ library is to use target_compile_feature() to set minimum C++ standard, in order to not constrain a specific maximum standard like CXX_STANDARD does.
I've also removed PIC.
In CMake, PIC comes for free in shared lib. For static lib, it's a user decision, so it's better to keep default behavior (principle of least surprise).
Good practice in a C++ library is to use
target_compile_feature()
to set minimum C++ standard, in order to not constrain a specific maximum standard likeCXX_STANDARD
does.I've also removed PIC. In CMake, PIC comes for free in shared lib. For static lib, it's a user decision, so it's better to keep default behavior (principle of least surprise).