diff --git a/cmake_android.bat b/cmake_android.bat index 0199073..21cee85 100644 --- a/cmake_android.bat +++ b/cmake_android.bat @@ -38,11 +38,12 @@ if %~2==x86_64 ( set AARCH=x86_64 if /i %_PLATFORM_% LSS 21 set _PLATFORM_=21 ) -set Qt5_ROOT=%ANDROID_QT5_DIR%\android_%QARCH%\lib\cmake -set Qt5_DIR=%Qt5_ROOT%\Qt5 +rem set Qt5_ROOT=%ANDROID_QT5_DIR%\android_%QARCH%\lib\cmake +set Qt5_ROOT=%ANDROID_QT5_DIR%\lib\cmake +rem set Qt5_DIR=%Qt5_ROOT%\Qt5 if NOT [%QARCH%]==[] ( @echo on - cmake_mgw -Wno-dev -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%\build\cmake\android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_PLATFORM=android-%_PLATFORM_% -DANDROID_ABI=%AARCH% -DICU=0 -DQt4=0 -DQt5=1 -DQGLVIEW=0 -DQt5_DIR=%Qt5_ROOT%\Qt5 -DQt5LinguistTools_DIR=%Qt5_ROOT%\Qt5LinguistTools -DQt5UiPlugin_DIR=%Qt5_ROOT%\Qt5UiPlugin -DQt5Widgets_DIR=%Qt5_ROOT%\Qt5Widgets -DQt5Core_DIR=%Qt5_ROOT%\Qt5Core -DQt5Gui_DIR=%Qt5_ROOT%\Qt5Gui -DQt5Sql_DIR=%Qt5_ROOT%\Qt5Sql -DQt5OpenGL_DIR=%Qt5_ROOT%\Qt5OpenGL -DQt5PrintSupport_DIR=%Qt5_ROOT%\Qt5PrintSupport -DQt5Script_DIR=%Qt5_ROOT%\Qt5Script -DQt5Positioning_DIR=%Qt5_ROOT%\Qt5Positioning -DQt5Network_DIR=%Qt5_ROOT%\Qt5Network -DQt5Qml_DIR=%Qt5_ROOT%\Qt5Qml -DQt5Quick_DIR=%Qt5_ROOT%\Qt5Quick -DQt5QuickWidgets_DIR=%Qt5_ROOT%\Qt5QuickWidgets %~3 %~4 %~5 %~6 + cmake_mgw -Wno-dev -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%\build\cmake\android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_PLATFORM=android-%_PLATFORM_% -DANDROID_ABI=%AARCH% -DICU=0 -DQt4=0 -DQt5=1 -DQGLVIEW=0 -DQGLENGINE=0 -DQt5_DIR=%Qt5_ROOT%\Qt5 -DQt5LinguistTools_DIR=%Qt5_ROOT%\Qt5LinguistTools -DQt5UiPlugin_DIR=%Qt5_ROOT%\Qt5UiPlugin -DQt5UiTools_DIR=%Qt5_ROOT%\Qt5UiTools -DQt5Widgets_DIR=%Qt5_ROOT%\Qt5Widgets -DQt5Core_DIR=%Qt5_ROOT%\Qt5Core -DQt5Gui_DIR=%Qt5_ROOT%\Qt5Gui -DQt5Sql_DIR=%Qt5_ROOT%\Qt5Sql -DQt5OpenGL_DIR=%Qt5_ROOT%\Qt5OpenGL -DQt5PrintSupport_DIR=%Qt5_ROOT%\Qt5PrintSupport -DQt5Script_DIR=%Qt5_ROOT%\Qt5Script -DQt5Positioning_DIR=%Qt5_ROOT%\Qt5Positioning -DQt5Network_DIR=%Qt5_ROOT%\Qt5Network -DQt5Qml_DIR=%Qt5_ROOT%\Qt5Qml -DQt5Quick_DIR=%Qt5_ROOT%\Qt5Quick -DQt5QuickWidgets_DIR=%Qt5_ROOT%\Qt5QuickWidgets %~3 %~4 %~5 %~6 ) else ( @echo on cmake_mgw -Wno-dev -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%\build\cmake\android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_PLATFORM=android-%_PLATFORM_% -DANDROID_ABI=%AARCH% -DICU=0 -DQt4=0 -DQt5=0 -DQGLVIEW=0 %~3 %~4 %~5 %~6 diff --git a/qad/cmake/QtWraps.cmake b/qad/cmake/QtWraps.cmake index a05de36..88fe741 100644 --- a/qad/cmake/QtWraps.cmake +++ b/qad/cmake/QtWraps.cmake @@ -1,105 +1,107 @@ -# find_qt([ ...] [Qt4] [Qt5]) -# -# Find Qt4 or/and Qt5 packages -# If Qt4/5 found, set -# * Qt<4/5>_ROOT var to Qt root dir -# * Qt<4/5>_BIN var to Qt binary dir -# * Qt<4/5>_PLUGINS_DIR var to Qt plugins dir -# * Qt<4/5>_LANG_DIR var to Qt translations dir -# -# -# -# -# qt_sources( [NO_DEFAULT] [DIR ] [ ...]) -# -# Collect all sources, optionally in directory and -# Additional filters . By default filter files with regexps -# "*.h", "*.hpp", "*.c", "*.cpp", "*.ui", "*.qrc", "*.rc", "*.ts" and "lang/*.ts". -# Default filters disabled with option NO_DEFAULT -# -# -# -# -# qt_wrap( ... [HDRS ] [CPPS ] [QMS ]) -# -# Prepare sources for compile -# Store headers to , all wrapped Qt4 files to _Qt4 and Qt5 files to _Qt5 -# version are automatic detected after find_qt() call -# -# -# -# -# qt_add_executable( [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] source1 [source2 ...]) -# -# Add executables for founded Qt versions, target names is -# All needed Qt includes automatic added to corresponding targets -# cant be CPPS variable passed to qt_wrap() or some list or filename -# -# -# -# -# qt_add_library( [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] source1 [source2 ...]) -# -# Add library for founded Qt versions, target names is -# All needed Qt includes automatic added to corresponding targets -# cant be CPPS variable passed to qt_wrap() or some list or filename -# -# -# -# -# qt_target_link_libraries( ... ...) -# -# Link targets for founded Qt versions, target names is -# All needed Qt libraries automatic added to corresponding targets -# if QT_MULTILIB_LIST contains some linking library, to it name automatic -# add or individual libname<_SUFFIX_Qt?> -# -# -# -# -# qt_target_compile_definitions( ...) -# -# Syntax similar to original "target_compile_definitions()" -# Specify compile definitions to use when compiling a given -# -# -# -# -# qt_target_include_directories( ...) -# -# Syntax similar to original "target_include_directories()" -# Add include directories to a target -# -# -# -# -# qt_install(...) -# -# Syntax similar to original "install()" -# Install targets for founded Qt versions -# -# if DESTINATION set to "QtBin" files will be installed -# to corresponding Qt binary directory -# if DESTINATION set to "QtLang" files will be installed -# to corresponding Qt translation directory -# if DESTINATION starts with "QtPlugins" files will be installed -# to corresponding Qt plugins directory -# -# Add LANG type for first argument - in this case you should -# specify variable name, not variable value! -# e.g. "qt_install(LANG my_QM DESTINATION QtLang)" -# -# -# -# -# qt_install_lang( DESTINATION ) -# -# Search Qt translations for all dependencies -# in Qt_LANG_DIR for _LANG languages -# and install them to . You can you "set_lang()" macro -# before this action -# -# +#[[ + +find_qt([ ...] [Qt4] [Qt5]) + +Find Qt4 or/and Qt5 packages +If Qt4/5 found, set +* Qt<4/5>_ROOT var to Qt root dir +* Qt<4/5>_BIN var to Qt binary dir +* Qt<4/5>_PLUGINS_DIR var to Qt plugins dir +* Qt<4/5>_LANG_DIR var to Qt translations dir + + + + +qt_sources( [NO_DEFAULT] [DIR ] [ ...]) + +Collect all sources, optionally in directory and +Additional filters . By default filter files with regexps +"*.h", "*.hpp", "*.c", "*.cpp", "*.ui", "*.qrc", "*.rc", "*.ts" and "lang/*.ts". +Default filters disabled with option NO_DEFAULT + + + + +qt_wrap( ... [HDRS ] [CPPS ] [QMS ]) + +Prepare sources for compile +Store headers to , all wrapped Qt4 files to _Qt4 and Qt5 files to _Qt5 +version are automatic detected after find_qt() call + + + + +qt_add_executable( [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] source1 [source2 ...]) + +Add executables for founded Qt versions, target names is +All needed Qt includes automatic added to corresponding targets + cant be CPPS variable passed to qt_wrap() or some list or filename + + + + +qt_add_library( [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] source1 [source2 ...]) + +Add library for founded Qt versions, target names is +All needed Qt includes automatic added to corresponding targets + cant be CPPS variable passed to qt_wrap() or some list or filename + + + + +qt_target_link_libraries( ... ...) + +Link targets for founded Qt versions, target names is +All needed Qt libraries automatic added to corresponding targets +if QT_MULTILIB_LIST contains some linking library, to it name automatic +add or individual libname<_SUFFIX_Qt?> + + + + +qt_target_compile_definitions( ...) + +Syntax similar to original "target_compile_definitions()" +Specify compile definitions to use when compiling a given + + + + +qt_target_include_directories( ...) + +Syntax similar to original "target_include_directories()" +Add include directories to a target + + + + +qt_install(...) + +Syntax similar to original "install()" +Install targets for founded Qt versions + +if DESTINATION set to "QtBin" files will be installed +to corresponding Qt binary directory +if DESTINATION set to "QtLang" files will be installed +to corresponding Qt translation directory +if DESTINATION starts with "QtPlugins" files will be installed +to corresponding Qt plugins directory + +Add LANG type for first argument - in this case you should +specify variable name, not variable value! +e.g. "qt_install(LANG my_QM DESTINATION QtLang)" + + + + +qt_install_lang( DESTINATION ) + +Search Qt translations for all dependencies +in Qt_LANG_DIR for _LANG languages +and install them to . You can you "set_lang()" macro +before this action + +]] cmake_policy(SET CMP0011 NEW) # don`t affect includer policies