Ver código fonte

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 anos atrás
pai
commit
c2ac558c0f
1 arquivos alterados com 9 adições e 2 exclusões
  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()