Browse Source

CMakeLists: fix Qt4 build

Only the src subdirectory needs Qt.
Otherwise it activates Qt4 also for the dolphin plugin which always need Qt5
Olivier Goffart 9 years ago
parent
commit
f8dc263338
2 changed files with 15 additions and 21 deletions
  1. 1 21
      CMakeLists.txt
  2. 14 0
      src/CMakeLists.txt

+ 1 - 21
CMakeLists.txt

@@ -30,7 +30,7 @@ endif()
 include(Warnings)
 
 include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/")
+include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
 # disable the crashreporter if libcrashreporter-qt is not available or we're building for ARM
 if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/libcrashreporter-qt/CMakeLists.txt")
@@ -51,9 +51,7 @@ endif()
 
 include(GNUInstallDirs)
 include(DefineInstallationPaths)
-include(QtVersionAbstraction)
 
-setup_qt()
 
 include(GetGitRevisionDescription)
 
@@ -126,24 +124,6 @@ if(APPLE)
   set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
 endif()
 
-#### find libs
-#find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest QtWebkit REQUIRED )
-#if( UNIX AND NOT APPLE ) # Fdo notifications
-#    find_package(Qt4 4.7.0 COMPONENTS QtDBus REQUIRED )
-#endif()
-
-
-if(HAVE_QT5)
-  if (${Qt5Core_VERSION_MAJOR} EQUAL "5")
-    if (${Qt5Core_VERSION_MINOR} EQUAL "4" OR ${Qt5Core_VERSION_MINOR} GREATER 4)
-    else()
-      message(STATUS "If possible compile me with Qt 5.4 or higher.")
-    endif()
-  endif()
-else()
-  message(STATUS "If possible compile me with Qt 5.4 or higher.")
-endif()
-
 find_package(OpenSSL 1.0.0 REQUIRED)
 
 if(NOT TOKEN_AUTH_ONLY)

+ 14 - 0
src/CMakeLists.txt

@@ -5,6 +5,20 @@ set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
 
 set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
 
+include(QtVersionAbstraction)
+setup_qt()
+if(HAVE_QT5 AND NOT BUILD_WITH_QT4)
+  if (${Qt5Core_VERSION_MAJOR} EQUAL "5")
+    if (${Qt5Core_VERSION_MINOR} EQUAL "4" OR ${Qt5Core_VERSION_MINOR} GREATER 4)
+    else()
+      message(STATUS "If possible compile me with Qt 5.4 or higher.")
+    endif()
+  endif()
+else()
+  message(STATUS "If possible compile me with Qt 5.4 or higher.")
+endif()
+
+
 if (APPLE)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
 endif()