cmake: fix pkg-config in static mode

Change-Id: Ic2397eee6ea67fc5d0b76ce77bbd8e000f90177c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bddd5b6..a2272fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,7 +37,7 @@
     set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
     list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_PATH})
     find_package (PkgConfig REQUIRED)
-    if(BUILD_STATIC)
+    if(NOT BUILD_SHARED_LIBS)
         list(APPEND PKG_CONFIG_EXECUTABLE "--static")
     endif()