Eyescale/CMake — pull request #163 by halfflat (2014-06-26 17:57:26+00:00)
Title: Allow building both shared and static libs in one make.

One can now set ${NAME}_LIBRARY_TYPE to a list containing both SHARED
and STATIC for common_library(), which will then build both. The first
entry corresponds to the library that will be associated with the
target ${NAME}; the second entry will be associated with the
target ${NAME}_.

Examples:

1. Original behaviour:

set(FOO_LIBRARY_TYPE SHARED)
common_library(foo)

Builds shared library libfoo.so only; target_link_libraries(target foo)
will link target with libfoo.so.

2. New behaviour:

set(FOO_LIBRARY_TYPE SHARED STATIC)
common_library(foo)

Builds both libfoo.so and libfoo.a; target_link_libraries(target foo)
will link against libfoo.so since 'SHARED' is first in the list. To link
explicitly against the static lib, use target_link_libraries(target foo_STATIC).