[CMake] Proper process for static & shared variants of config packages?

Robert Dailey rcdailey.lists at gmail.com
Fri Sep 1 11:39:31 EDT 2017


Suppose I have a library target and I setup a config package for it
and install target exports for it. What is the process for supporting
installation of the shared library and static library variants (maybe
the same answer applies to debug and release variants too)?

Should you create 1 target and rely on BUILD_SHARED_LIBS, which means
generating two binary directories, building and installing once in
each? Will this overwrite existing target.cmake and config.cmake files
in a negative way?

Or should there be 2 library targets (something like foo_shared and
foo_static) and build & install once?


More information about the CMake mailing list