remove magic from cmake. USE_QT5 should be the only trigger
authorAlf Gaida <agaida@siduction.org>
Sat, 21 Jun 2014 10:18:04 +0000 (12:18 +0200)
committerAlf Gaida <agaida@siduction.org>
Sat, 21 Jun 2014 10:18:04 +0000 (12:18 +0200)
CMakeLists.txt
cmake/lxqt-config.cmake.in

index b4ff523..ac5c9cc 100644 (file)
@@ -120,22 +120,7 @@ file(GLOB TS_FILES
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 
 
-option(USE_QT5 "Force use the Qt5." $ENV{USE_QT5})
-option(USE_QT4 "Force use the Qt4." $ENV{USE_QT4})
-
-if((USE_QT4 AND USE_QT5) OR
-   (NOT USE_QT4 AND NOT USE_QT5))
-
-    # Autodetect Qt version
-    find_package(Qt4 QUIET)
-    if (QT4_FOUND)
-        set(USE_QT4 ON)
-        set(USE_QT5 OFF)
-    else()
-        set(USE_QT4 OFF)
-        set(USE_QT5 ON)
-    endif()
-endif()
+option(USE_QT5 "Build with Qt5." $ENV{USE_QT5})
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -221,7 +206,7 @@ message(STATUS "")
 foreach(h ${PUB_HDRS})
     get_filename_component(bh ${h} NAME)
     configure_file(${h} ${LXQT_INTREE_INCLUDE_DIR}/LXQt/${bh} COPYONLY)
-    if (USE_QT4)
+    if (NOT USE_QT5)
         configure_file(${h} ${LXQT_INTREE_INCLUDE_DIR}/lxqt/${bh} COPYONLY)
     endif()
 endforeach()
@@ -347,7 +332,7 @@ export(TARGETS ${LXQT_LIBRARY_NAME} ${QTXDG_TARGET} FILE ${LXQT_INTREE_TARGETS_F
 
 install(FILES ${PUB_HDRS}                DESTINATION ${LXQT_INSTALL_INCLUDE_DIR}/LXQt)
 
-if (USE_QT4)
+if (NOT USE_QT5)
     install(FILES ${PUB_HDRS}   DESTINATION ${LXQT_INSTALL_INCLUDE_DIR})
 endif()
 
index c3942b9..22cb637 100644 (file)
 #   add_executable(myexe main.cpp)
 #   target_link_libraries(myexe $LXQT_LIBRARIES})
 
-option(USE_QT5 "Force use the Qt5." $ENV{USE_QT5})
-option(USE_QT4 "Force use the Qt4." $ENV{USE_QT4})
-
-if((USE_QT4 AND USE_QT5) OR
-   (NOT USE_QT4 AND NOT USE_QT5))
-    # Autodetect Qt version
-    find_package(LxQt4 QUIET)
-    if (LXQT4_FOUND)
-        set(USE_QT4 ON)
-        set(USE_QT5 OFF)
-    else()
-        set(USE_QT4 OFF)
-        set(USE_QT5 ON)
-    endif()
-endif()
-
+option(USE_QT5 "Build with Qt5." $ENV{USE_QT5})
 
 if(LXQT_FIND_REQUIRED)
   set(REQUIRED_OPT "REQUIRED")