X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=CMakeLists.txt;h=03ac969ef5bc8013ca940ded687a72cb766b654b;hb=4bd24192f86fa97c62ff1ef11505913574664919;hp=7c2389f6b05c9b3fba20444a4420fa21655462a3;hpb=bbe4e00c72ef57febad268b6937d950c01969a54;p=quassel.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c2389f6..03ac969e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,12 +127,12 @@ endif() # Setting COMPILE_DEFINITIONS_ is deprecated since CMake 3.0 in favor of generator expressions. # These have existed since CMake 2.8.10; until we depend on that, we have to explicitly enable the old policy. -if (CMAKE_MAJOR_VERSION GREATER 2) +if (POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() # Honor visibility settings for all target types -if (CMAKE_VERSION VERSION_GREATER 3.3) +if (POLICY CMP0063) cmake_policy(SET CMP0063 NEW) endif() @@ -433,6 +433,11 @@ endif() cmake_push_check_state(RESET) set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") + +if (USE_QT5 AND Qt5_POSITION_INDEPENDENT_CODE) + set(CMAKE_REQUIRED_FLAGS "-fPIC -DQT_NO_VERSION_TAGGING") +endif() + check_cxx_source_compiles(" #include \"qglobal.h\" #if defined QT_NO_SSL