Set CMake policy for visibility
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 1 Mar 2016 18:55:53 +0000 (19:55 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 1 Mar 2016 19:01:53 +0000 (20:01 +0100)
CMake 3.3+ changed behavior for handling visibility for target types
other than dynamic libraries. This commit adds a cmake_policy call
to allow the new behavior, removing a dev warning in the process.

CMakeLists.txt

index 7268dac..aa0b492 100644 (file)
@@ -131,6 +131,11 @@ if (CMAKE_MAJOR_VERSION GREATER 2)
     cmake_policy(SET CMP0043 OLD)
 endif()
 
+# Honor visibility settings for all target types
+if (CMAKE_VERSION VERSION_GREATER 3.3)
+    cmake_policy(SET CMP0063 NEW)
+endif()
+
 
 # Simplify later checks
 #####################################################################
@@ -231,7 +236,7 @@ if (USE_QT5)
                 PURPOSE     "Enable support for the snorenotify framework"
             )
         endif()
-        
+
 
         if (WITH_WEBKIT)
             find_package(Qt5WebKit QUIET)