diff --git a/CMakeLists.txt b/CMakeLists.txt index 223b53f..325f763 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,8 +63,12 @@ set (DIR_SHARE_LOCALE ${DIR_SHARE}/locale) ######## Configuration -option(BUILD_STATIC "Build static library" +option(BUILD_SHARED_LIBS "Build shared library and link executable against it" ON) +if (BUILD_SHARED_LIBS) + option(BUILD_STATIC "Build static library" + ON) +endif (BUILD_SHARED_LIBS) configure_file( uchardet.pc.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 39f460c..32e62c2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,7 +54,6 @@ add_definitions( add_library( ${UCHARDET_TARGET} - SHARED ${UCHARDET_SOURCES} ) diff --git a/uchardet.pc.in b/uchardet.pc.in index 660a401..8f646fd 100644 --- a/uchardet.pc.in +++ b/uchardet.pc.in @@ -8,4 +8,5 @@ Description: An encoding detector library ported from Mozilla Version: @UCHARDET_VERSION@ Requires: Libs: -L${libdir} -luchardet +Libs.private: -lstdc++ Cflags: -I${includedir}/uchardet