Bläddra i källkod

Change the qmake executable lookup way

- Use non-system paths for search first
- In no luck in non-system paths lookup everywhere

Fixes: #151
Alexey Edelev 4 år sedan
förälder
incheckning
c2ac558c0f
1 ändrade filer med 9 tillägg och 2 borttagningar
  1. 9 2
      src/protobuf/CMakeLists.txt

+ 9 - 2
src/protobuf/CMakeLists.txt

@@ -77,9 +77,16 @@ if(NOT BUILD_SHARED_LIBS)
 endif()
 
 if(NOT DEFINED QT_QMAKE_EXECUTABLE)
-    find_program(QT_QMAKE_EXECUTABLE "qmake")
+    find_program(QT_QMAKE_EXECUTABLE "qmake" NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
     if(QT_QMAKE_EXECUTABLE STREQUAL QT_QMAKE_EXECUTABLE-NOTFOUND)
-        message(FATAL_ERROR "Could not find qmake executable")
+        find_program(QT_QMAKE_EXECUTABLE "qmake")
+        if(QT_QMAKE_EXECUTABLE STREQUAL QT_QMAKE_EXECUTABLE-NOTFOUND)
+            message(FATAL_ERROR "Could not find qmake executable")
+        else()
+            message(STATUS "Use qmake ${QT_QMAKE_EXECUTABLE}")
+        endif()
+    else()
+        message(STATUS "Use qmake ${QT_QMAKE_EXECUTABLE}")
     endif()
 endif()