From 899af081d7f7b0ae2ca93bd1454a397bf77c940c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 17 May 2013 09:17:15 +0200 Subject: Make CMake not fail if EGL is not found. As EGL is not a 'public dependency' of Qt, it is ok for it not to be available where Qt is deployed. Change-Id: I02dcc5f72ca4437210cff10e8b557e216f3e0419 Reviewed-by: Johannes Lochmann Reviewed-by: Stephen Kelly --- src/gui/Qt5GuiConfigExtras.cmake.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 4dc5e623d2..f1bc441009 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -82,7 +82,11 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}") !!ENDIF if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY) - message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + if (\"${ARGN}\" STREQUAL \"OPTIONAL\") + break() + else() + message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + endif() endif() add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${IncDirs}) @@ -117,7 +121,7 @@ endmacro() !!IF !isEmpty(CMAKE_EGL_LIBS) -_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\") +_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\" OPTIONAL) !!ENDIF !!IF !isEmpty(CMAKE_OPENGL_LIBS) -- cgit v1.2.3