Methods and exports needed for Webview support (#217)

* Adds basic qurl support

* allows building with custom qt installation using the env variable

* cleans up

* cleanup
This commit is contained in:
Atul R
2019-11-24 23:05:53 +01:00
committed by GitHub
parent 15c2f1aca6
commit 22c7acd74e
11 changed files with 185 additions and 18 deletions
+10 -15
View File
@@ -12,10 +12,17 @@ function(AddQtSupport addonName)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE QT_HOME_DIR
)
if(DEFINED ENV{QT_INSTALL_DIR})
# Allows to use custom Qt installation via QT_INSTALL_DIR env variable
message(STATUS "Using Custom QT installation for ${addonName} QT_INSTALL_DIR:$ENV{QT_INSTALL_DIR}")
set(QT_HOME_DIR "$ENV{QT_INSTALL_DIR}")
endif()
string(REPLACE "\n" "" QT_HOME_DIR "${QT_HOME_DIR}")
string(REPLACE "\"" "" QT_HOME_DIR "${QT_HOME_DIR}")
if (APPLE)
# createQtMacSymlinks()
if(APPLE)
set(CUSTOM_QT_MOC_PATH "${QT_HOME_DIR}/bin/moc")
target_include_directories(${addonName} PRIVATE
@@ -65,20 +72,8 @@ function(AddQtSupport addonName)
"${QT_HOME_DIR}/lib/libQt5Widgets.so"
)
endif()
# set custom moc executable location
set_target_properties(Qt5::moc PROPERTIES IMPORTED_LOCATION "${CUSTOM_QT_MOC_PATH}")
endfunction(AddQtSupport addonName)
# function(createQtMacSymlinks)
# message("Creating qt symlinks")
# execute_process(
# COMMAND 'mkdir -p ${QT_HOME_DIR}/include'
# COMMAND 'ln -sfn ${QT_HOME_DIR}/lib/QtCore.framework/Versions/5/Headers ${QT_HOME_DIR}/include/QtCore'
# COMMAND 'ln -sfn ${QT_HOME_DIR}/lib/QtGui.framework/Versions/5/Headers ${QT_HOME_DIR}/include/QtGui'
# COMMAND 'ln -sfn ${QT_HOME_DIR}/lib/QtWidgets.framework/Versions/5/Headers ${QT_HOME_DIR}/include/QtWidgets'
# WORKING_DIRECTORY ${QT_HOME_DIR}
# )
# endfunction()