Commit 0dcf60a2 authored by Vyacheslav Koscheev's avatar Vyacheslav Koscheev

[cmake] CMakeLists created

parent 04210133
cmake_minimum_required(VERSION 3.10)
project(qtandroidextensions)
add_subdirectory(QJniHelpers)
add_subdirectory(QtAndroidAssets)
add_subdirectory(QtAndroidCompass)
add_subdirectory(QtAndroidHelpers)
add_subdirectory(QtAndroidLocation)
add_subdirectory(QtOffscreenViews)
#add_subdirectory(Sample)
set(MODULE_NAME QtJniHelpers)
set(SRC_LIST
IJniObjectLinker.h
QAndroidQPAPluginGap.cpp
QAndroidQPAPluginGap.h
QJniHelpers.cpp
QJniHelpers.h
QJniHelpers.pri
QJniHelpers.pro
QJniLangUtils.cpp
QJniLangUtils.h
TJniObjectLinker.h
)
if (ANDROID)
add_library(${MODULE_NAME} STATIC ${SRC_LIST})
add_library(${PROJECT_NAME}::${MODULE_NAME} ALIAS ${MODULE_NAME})
target_link_libraries(${MODULE_NAME}
PUBLIC
Qt5::Core
)
target_include_directories(${MODULE_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}
)
endif(ANDROID)
set(MODULE_NAME QtAndroidAssets)
set(SRC_LIST
AndroidAssetsFileEngineHandler_p.cpp
AndroidAssetsFileEngineHandler_p.h
QAndroidAssetHandler.cpp
QAndroidAssetHandler.h
)
if (ANDROID)
find_library(ANDROID_LOG_LIB log REQIRED)
find_library(ANDROID_LIB android REQIRED)
add_library(${MODULE_NAME} STATIC ${SRC_LIST})
add_library(${PROJECT_NAME}::${MODULE_NAME} ALIAS ${MODULE_NAME})
target_link_libraries(${MODULE_NAME}
PUBLIC
Qt5::Core
Qt5::Network
Qt5::AndroidExtras
qtandroidextensions::QtJniHelpers
${ANDROID_LOG_LIB}
${ANDROID_LIB}
)
target_include_directories(${MODULE_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}
)
# Это нужно для инклуда приватного хедера qabstractfileengine_p.h
foreach(inc_dir ${Qt5Core_INCLUDE_DIRS})
target_include_directories(${MODULE_NAME}
PRIVATE
${inc_dir}/${Qt5Core_VERSION}
)
endforeach(inc_dir)
target_compile_definitions(${MODULE_NAME}
PUBLIC
-DQTANDROIDASSETS_STATIC=1
)
endif(ANDROID)
set(MODULE_NAME QtAndroidCompass)
set(SRC_LIST
QAndroidCompass.cpp
QAndroidCompass.h
)
if (ANDROID)
add_library(${MODULE_NAME} STATIC ${SRC_LIST})
add_library(${PROJECT_NAME}::${MODULE_NAME} ALIAS ${MODULE_NAME})
target_link_libraries(${MODULE_NAME}
PUBLIC
Qt5::Core
qtandroidextensions::QtJniHelpers
)
target_include_directories(${MODULE_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}
)
endif(ANDROID)
set(MODULE_NAME QtAndroidHelpers)
set(SRC_LIST
QAndroidAction.cpp
QAndroidAction.h
QAndroidConfiguration.cpp
QAndroidConfiguration.h
QAndroidDesktopUtils.cpp
QAndroidDesktopUtils.h
QAndroidDialog.cpp
QAndroidDialog.h
QAndroidDisplayMetrics.cpp
QAndroidDisplayMetrics.h
QAndroidFilePaths.cpp
QAndroidFilePaths.h
QAndroidPartialWakeLocker.cpp
QAndroidPartialWakeLocker.h
QAndroidScreenLayoutHandler.cpp
QAndroidScreenLayoutHandler.h
QAndroidScreenLocker.cpp
QAndroidScreenLocker.h
QAndroidScreenOrientation.cpp
QAndroidScreenOrientation.h
QAndroidSharedPreferences.cpp
QAndroidSharedPreferences.h
QAndroidSpeechRecognizer.cpp
QAndroidSpeechRecognizer.h
QAndroidStorages.cpp
QAndroidStorages.h
QAndroidStorages_p.h
QAndroidToast.cpp
QAndroidToast.h
QAndroidWiFiLocker.cpp
QAndroidWiFiLocker.h
Mobility/CellData.cpp
Mobility/CellData.h
Mobility/QAndroidBatteryDataProvider.cpp
Mobility/QAndroidBatteryDataProvider.h
Mobility/QAndroidCellDataProvider.cpp
Mobility/QAndroidCellDataProvider.h
Mobility/QAndroidWifiDataProvider.cpp
Mobility/QAndroidWifiDataProvider.h
Mobility/WifiData.cpp
Mobility/WifiData.h
QLocks/QLockBase.h
QLocks/QLock.cpp
QLocks/QLockedObjectBase_p.h
QLocks/QLockedObject.cpp
QLocks/QLockedObject.h
QLocks/QLockHandler.cpp
QLocks/QLockHandler_p.h
QLocks/QLock_p.h
)
if (ANDROID)
add_library(${MODULE_NAME} STATIC ${SRC_LIST})
add_library(${PROJECT_NAME}::${MODULE_NAME} ALIAS ${MODULE_NAME})
target_link_libraries(${MODULE_NAME}
PUBLIC
qtandroidextensions::QtJniHelpers
)
target_include_directories(${MODULE_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}
)
endif(ANDROID)
set(MODULE_NAME QtAndroidLocation)
set(SRC_LIST
PositionInfoConvertor.cpp
PositionInfoConvertor.h
QAndroidGmsLocationProvider.cpp
QAndroidGmsLocationProvider.h
QAndroidPassiveGeoPosition.cpp
QAndroidPassiveGeoPosition.h
QGeoPositionInfoSourceAndroidGms.cpp
QGeoPositionInfoSourceAndroidGms.h
QGeoPositionInfoSourceAndroidPassive.cpp
QGeoPositionInfoSourceAndroidPassive.h
QLocationManagerProvidersListener.cpp
QLocationManagerProvidersListener.h
QNmeaListener.cpp
QNmeaListener.h
)
if (ANDROID)
add_library(${MODULE_NAME} STATIC ${SRC_LIST})
add_library(${PROJECT_NAME}::${MODULE_NAME} ALIAS ${MODULE_NAME})
target_link_libraries(${MODULE_NAME}
PUBLIC
Qt5::Positioning
qtandroidextensions::QtJniHelpers
)
target_include_directories(${MODULE_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}
)
endif(ANDROID)
set(MODULE_NAME QtOffscreenViews)
set(SRC_LIST
QAndroidJniImagePair.cpp
QAndroidJniImagePair.h
QAndroidOffscreenEditText.cpp
QAndroidOffscreenEditText.h
QAndroidOffscreenView.cpp
QAndroidOffscreenView.h
QAndroidOffscreenWebView.cpp
QAndroidOffscreenWebView.h
QApplicationActivityObserver.cpp
QApplicationActivityObserver.h
QOpenGLTextureHolder.cpp
QOpenGLTextureHolder.h
# QGraphicsWidgets/QAndroidOffscreenViewGraphicsWidget.cpp
# QGraphicsWidgets/QAndroidOffscreenViewGraphicsWidget.h
# QGraphicsWidgets/QOffscreenEditTextGraphicsWidget.cpp
# QGraphicsWidgets/QOffscreenEditTextGraphicsWidget.h
# QGraphicsWidgets/QOffscreenWebViewGraphicsWidget.cpp
# QGraphicsWidgets/QOffscreenWebViewGraphicsWidget.h
QQuickViews/QQuickAndroidOffscreenView.cpp
QQuickViews/QQuickAndroidOffscreenView.h
QQuickViews/QQuickOffscreenEditText.cpp
QQuickViews/QQuickOffscreenEditText.h
QQuickViews/QQuickOffscreenWebView.cpp
QQuickViews/QQuickOffscreenWebView.h
)
if (ANDROID)
find_library(ANDROID_JNIGRAPHICS jnigraphics REQIRED)
add_library(${MODULE_NAME} STATIC ${SRC_LIST})
add_library(${PROJECT_NAME}::${MODULE_NAME} ALIAS ${MODULE_NAME})
target_link_libraries(${MODULE_NAME}
PUBLIC
Qt5::Gui
Qt5::OpenGL
# Qt5::PlatformSupport
Qt5::Qml
Qt5::Quick
qtandroidextensions::QtJniHelpers
${ANDROID_JNIGRAPHICS}
)
target_include_directories(${MODULE_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}
)
endif(ANDROID)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment