2013-04-11 20:45:14 +00:00
|
|
|
|
2013-04-16 11:38:19 +00:00
|
|
|
!!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
|
|
|
|
|
|
|
|
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
|
2013-06-05 11:24:23 +00:00
|
|
|
set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ELSE
|
2013-06-05 11:24:23 +00:00
|
|
|
set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ENDIF
|
|
|
|
|
2013-05-14 12:33:15 +00:00
|
|
|
_qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS})
|
|
|
|
|
2013-06-05 11:24:23 +00:00
|
|
|
list(APPEND Qt5Gui_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS})
|
|
|
|
set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS})
|
2013-04-16 11:38:19 +00:00
|
|
|
set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION)
|
|
|
|
set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
|
|
|
|
|
2013-06-12 12:57:11 +00:00
|
|
|
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
|
|
|
|
set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ELSE
|
2013-06-12 12:57:11 +00:00
|
|
|
set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ENDIF
|
2013-06-12 12:57:11 +00:00
|
|
|
|
2013-04-16 11:38:19 +00:00
|
|
|
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
|
2013-05-14 12:33:15 +00:00
|
|
|
set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ELSE
|
2013-05-14 12:33:15 +00:00
|
|
|
set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ENDIF
|
2013-05-14 12:33:15 +00:00
|
|
|
|
|
|
|
set_target_properties(Qt5::${TargetName} PROPERTIES
|
|
|
|
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
|
|
|
|
\"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
|
2013-04-16 11:38:19 +00:00
|
|
|
)
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
add_library(Qt5::Gui_EGL SHARED IMPORTED)
|
|
|
|
_populate_qt5gui_gl_target_properties(Gui_EGL RELEASE $${CMAKE_ANGLE_EGL_DLL_RELEASE} $${CMAKE_ANGLE_EGL_IMPLIB_RELEASE})
|
|
|
|
add_library(Qt5::Gui_GLESv2 SHARED IMPORTED)
|
|
|
|
_populate_qt5gui_gl_target_properties(Gui_GLESv2 RELEASE $${CMAKE_ANGLE_GLES2_DLL_RELEASE} $${CMAKE_ANGLE_GLES2_IMPLIB_RELEASE})
|
|
|
|
|
|
|
|
set_property(TARGET Qt5::Gui_EGL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS})
|
|
|
|
set_property(TARGET Qt5::Gui_GLESv2 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_OPENGL_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
|
|
|
|
_populate_qt5gui_gl_target_properties(Gui_EGL DEBUG $${CMAKE_ANGLE_EGL_DLL_DEBUG} $${CMAKE_ANGLE_EGL_IMPLIB_DEBUG})
|
|
|
|
_populate_qt5gui_gl_target_properties(Gui_GLESv2 DEBUG $${CMAKE_ANGLE_GLES2_DLL_DEBUG} $${CMAKE_ANGLE_GLES2_IMPLIB_DEBUG})
|
|
|
|
!!ENDIF
|
|
|
|
|
|
|
|
set(Qt5Gui_EGL_LIBRARIES Qt5::Gui_EGL)
|
|
|
|
set(Qt5Gui_OPENGL_LIBRARIES Qt5::Gui_GLESv2)
|
|
|
|
|
|
|
|
!!ELSE
|
2013-04-11 20:45:14 +00:00
|
|
|
|
|
|
|
!!IF !isEmpty(CMAKE_GL_INCDIRS)
|
|
|
|
|
2013-10-25 11:26:00 +00:00
|
|
|
set(_GL_INCDIRS $$CMAKE_GL_INCDIRS)
|
2013-04-11 20:45:14 +00:00
|
|
|
find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME
|
2013-10-25 11:26:00 +00:00
|
|
|
PATHS ${_GL_INCDIRS}
|
2013-10-29 21:04:19 +00:00
|
|
|
)
|
2013-04-11 20:45:14 +00:00
|
|
|
if (NOT _qt5gui_OPENGL_INCLUDE_DIR)
|
2013-10-25 11:26:00 +00:00
|
|
|
message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"${_GL_INCDIRS}\\\".\")
|
2013-04-11 20:45:14 +00:00
|
|
|
endif()
|
2013-10-25 11:26:00 +00:00
|
|
|
unset(_GL_INCDIRS)
|
2013-04-11 20:45:14 +00:00
|
|
|
|
2014-07-03 12:52:21 +00:00
|
|
|
# Don\'t check for existence of the "_qt5gui_OPENGL_INCLUDE_DIR" because it is
|
|
|
|
# optional.
|
2013-05-14 12:33:15 +00:00
|
|
|
|
2013-04-11 20:45:14 +00:00
|
|
|
list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR})
|
|
|
|
set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR})
|
|
|
|
|
|
|
|
unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE)
|
|
|
|
|
|
|
|
!!ENDIF
|
|
|
|
|
2013-04-16 11:38:19 +00:00
|
|
|
macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
|
|
|
|
set(Qt5Gui_${Name}_LIBRARIES)
|
2013-11-11 15:34:51 +00:00
|
|
|
!!IF !mac
|
2013-05-02 13:35:54 +00:00
|
|
|
set(Qt5Gui_${Name}_INCLUDE_DIRS ${IncDirs})
|
2013-11-11 15:34:51 +00:00
|
|
|
!!ELSE
|
|
|
|
foreach(_dir ${IncDirs})
|
|
|
|
if (EXISTS ${_dir})
|
|
|
|
list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_dir})
|
|
|
|
else()
|
|
|
|
find_path(_actual_dir ${_dir}) # Look in sdk directories
|
|
|
|
if (_actual_dir)
|
|
|
|
list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir})
|
|
|
|
endif()
|
|
|
|
unset(_actual_dir CACHE)
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
!!ENDIF
|
2013-04-16 11:38:19 +00:00
|
|
|
foreach(_lib ${Libs})
|
|
|
|
string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_lib})
|
2014-05-16 10:03:16 +00:00
|
|
|
if (NOT TARGET Qt5::Gui_${_cmake_lib_name} AND NOT _Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE)
|
2013-04-16 11:38:19 +00:00
|
|
|
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib}
|
|
|
|
!!IF !isEmpty(CROSS_COMPILE)
|
2013-10-29 21:04:19 +00:00
|
|
|
PATHS \"${LibDir}\"
|
|
|
|
!!IF !mac
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
!!ENDIF
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ENDIF
|
|
|
|
)
|
2013-04-22 19:42:52 +00:00
|
|
|
!!IF mac
|
|
|
|
set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}")
|
2014-07-03 12:52:21 +00:00
|
|
|
if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
|
|
|
|
set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
|
|
|
|
endif()
|
2013-04-22 19:42:52 +00:00
|
|
|
!!ENDIF
|
2014-07-03 12:52:21 +00:00
|
|
|
if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
|
2014-05-22 08:46:52 +00:00
|
|
|
# The above find_library call doesn\'t work for finding
|
2014-05-16 10:03:16 +00:00
|
|
|
# libraries in Windows SDK paths outside of the proper
|
2014-07-03 12:52:21 +00:00
|
|
|
# environment, even if the libraries are present. In other
|
|
|
|
# cases it is OK for the libraries to not be found
|
|
|
|
# because they are optional dependencies of Qt5Gui, needed
|
|
|
|
# only if the qopengl.h header is used.
|
|
|
|
# We try to find the libraries in the first place because Qt may be
|
2014-05-16 10:03:16 +00:00
|
|
|
# compiled with another set of GL libraries (such as coming
|
|
|
|
# from ANGLE). The point of these find calls is to try to
|
|
|
|
# find the same binaries as Qt is compiled with (as they are
|
|
|
|
# in the interface of QtGui), so an effort is made to do so
|
|
|
|
# above with paths known to qmake.
|
|
|
|
set(_Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE TRUE)
|
|
|
|
unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE)
|
|
|
|
else()
|
|
|
|
add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED)
|
|
|
|
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_${Name}_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
|
|
_qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\")
|
|
|
|
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\")
|
2013-05-14 12:33:15 +00:00
|
|
|
|
2013-04-16 11:38:19 +00:00
|
|
|
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
|
2014-05-16 10:03:16 +00:00
|
|
|
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ENDIF
|
2014-05-16 10:03:16 +00:00
|
|
|
unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE)
|
2013-04-16 11:38:19 +00:00
|
|
|
|
2014-05-16 10:03:16 +00:00
|
|
|
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d
|
|
|
|
PATHS \"${LibDir}\"
|
2013-10-29 21:04:19 +00:00
|
|
|
!!IF !mac
|
2014-05-16 10:03:16 +00:00
|
|
|
NO_DEFAULT_PATH
|
2013-10-29 21:04:19 +00:00
|
|
|
!!ENDIF
|
2014-05-16 10:03:16 +00:00
|
|
|
)
|
|
|
|
if (Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG)
|
|
|
|
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
|
|
|
_qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\")
|
|
|
|
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
|
2014-05-16 10:03:16 +00:00
|
|
|
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ENDIF
|
2014-05-16 10:03:16 +00:00
|
|
|
endif()
|
|
|
|
unset(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG CACHE)
|
|
|
|
list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name})
|
2013-04-16 11:38:19 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
|
|
|
|
!!IF !isEmpty(CMAKE_EGL_LIBS)
|
2014-05-16 10:03:16 +00:00
|
|
|
_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\")
|
2013-04-16 11:38:19 +00:00
|
|
|
!!ENDIF
|
|
|
|
|
|
|
|
!!IF !isEmpty(CMAKE_OPENGL_LIBS)
|
|
|
|
_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$CMAKE_OPENGL_INCDIRS\")
|
|
|
|
|
|
|
|
!!ENDIF
|
|
|
|
|
|
|
|
!!ENDIF
|
|
|
|
|
|
|
|
set(Qt5Gui_OPENGL_IMPLEMENTATION $$CMAKE_QT_OPENGL_IMPLEMENTATION)
|
|
|
|
|
|
|
|
get_target_property(_configs Qt5::Gui IMPORTED_CONFIGURATIONS)
|
|
|
|
foreach(_config ${_configs})
|
|
|
|
set_property(TARGET Qt5::Gui APPEND PROPERTY
|
|
|
|
IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config}
|
|
|
|
${Qt5Gui_EGL_LIBRARIES} ${Qt5Gui_OPENGL_LIBRARIES}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
unset(_configs)
|