summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt77
-rw-r--r--kelakon.pro69
2 files changed, 77 insertions, 69 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..566638d
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,77 @@
+cmake_minimum_required(VERSION 3.5)
+
+project(kelakon)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+
+find_package(Qt5 COMPONENTS Core Quick REQUIRED)
+
+if (ANDROID)
+ set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
+ add_library(${PROJECT_NAME} SHARED
+ controller.hxx
+ controller.cxx
+ main.cxx
+ kelakon.qrc
+ larva.qrc
+ larva/material-design-icons.qrc
+ )
+ target_link_directories(${PROJECT_NAME} PRIVATE /opt/Qt5.14.1/5.14.1/android/lib)
+ if (ANDROID_ABI STREQUAL "arm64-v8a")
+ target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/aarch64-linux-android/sysroot/usr/lib)
+ target_link_libraries(${PROJECT_NAME} qrtclient_arm64-v8a)
+ set(ANDROID_EXTRA_LIBS
+ /usr/local/aarch64-linux-android/sysroot/usr/lib/libcrypto.so
+ /usr/local/aarch64-linux-android/sysroot/usr/lib/libssl.so
+ /usr/local/aarch64-linux-android/sysroot/usr/lib/libcurl.so
+ /usr/local/aarch64-linux-android/sysroot/usr/lib/librtclient.so
+ /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient_arm64-v8a.so)
+ elseif (ANDROID_ABI STREQUAL "armeabi-v7a")
+ target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/arm-linux-androideabi/sysroot/usr/lib)
+ target_link_libraries(${PROJECT_NAME} qrtclient_armeabi-v7a)
+ set(ANDROID_EXTRA_LIBS
+ /usr/local/arm-linux-androideabi/sysroot/usr/lib/libcrypto.so
+ /usr/local/arm-linux-androideabi/sysroot/usr/lib/libssl.so
+ /usr/local/arm-linux-androideabi/sysroot/usr/lib/libcurl.so
+ /usr/local/arm-linux-androideabi/sysroot/usr/lib/librtclient.so
+ /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient_armeabi-v7a.so)
+ elseif (ANDROID_ABI STREQUAL "x86")
+ target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/i686-linux-android/sysroot/usr/lib)
+ target_link_libraries(${PROJECT_NAME} qrtclient_x86)
+ set(ANDROID_EXTRA_LIBS
+ /usr/local/i686-linux-android/sysroot/usr/lib/libcrypto.so
+ /usr/local/i686-linux-android/sysroot/usr/lib/libssl.so
+ /usr/local/i686-linux-android/sysroot/usr/lib/libcurl.so
+ /usr/local/i686-linux-android/sysroot/usr/lib/librtclient.so
+ /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient_x86.so)
+ elseif (ANDROID_ABI STREQUAL "x86_64")
+ target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/x86_64-linux-android/sysroot/usr/lib64)
+ target_link_libraries(${PROJECT_NAME} qrtclient_x86_64)
+ set(ANDROID_EXTRA_LIBS
+ /usr/local/x86_64-linux-android/sysroot/usr/lib64/libcrypto.so
+ /usr/local/x86_64-linux-android/sysroot/usr/lib64/libssl.so
+ /usr/local/x86_64-linux-android/sysroot/usr/lib64/libcurl.so
+ /usr/local/x86_64-linux-android/sysroot/usr/lib64/librtclient.so
+ /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient_x86_64.so)
+ endif()
+else()
+ add_executable(${PROJECT_NAME}
+ controller.cxx
+ main.cxx
+ kelakon.qrc
+ larva.qrc
+ larva/material-design-icons.qrc
+ )
+ target_link_libraries(${PROJECT_NAME} qrtclient)
+endif()
+
+target_compile_definitions(${PROJECT_NAME}
+ PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
+
+target_link_libraries(${PROJECT_NAME}
+ curl
+ Qt5::Core
+ Qt5::Quick
+ rtclient
+ )
diff --git a/kelakon.pro b/kelakon.pro
deleted file mode 100644
index 437e784..0000000
--- a/kelakon.pro
+++ /dev/null
@@ -1,69 +0,0 @@
-QT += quick
-
-HEADERS += controller.hxx
-
-SOURCES += \
- controller.cxx \
- main.cxx
-
-RESOURCES += \
- kelakon.qrc \
- larva.qrc \
- larva/material-design-icons.qrc
-
-LIBS += \
- -lcurl \
- -lrtclient \
- -lqrtclient
-
-contains(ANDROID_TARGET_ARCH,arm64-v8a) {
- LIBS += -L/usr/local/aarch64-linux-android/sysroot/usr/lib
- ANDROID_EXTRA_LIBS += \
- /usr/local/aarch64-linux-android/sysroot/usr/lib/libcrypto.so \
- /usr/local/aarch64-linux-android/sysroot/usr/lib/libssl.so \
- /usr/local/aarch64-linux-android/sysroot/usr/lib/libcurl.so \
- /usr/local/aarch64-linux-android/sysroot/usr/lib/librtclient.so \
- /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient-arm64-v8a.so
-}
-
-contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
- LIBS += -L/usr/local/arm-linux-androideabi/sysroot/usr/lib
- ANDROID_EXTRA_LIBS += \
- /usr/local/arm-linux-androideabi/sysroot/usr/lib/libcrypto.so \
- /usr/local/arm-linux-androideabi/sysroot/usr/lib/libssl.so \
- /usr/local/arm-linux-androideabi/sysroot/usr/lib/libcurl.so \
- /usr/local/arm-linux-androideabi/sysroot/usr/lib/librtclient.so \
- /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient_armeabi-v7a.so
-}
-
-contains(ANDROID_TARGET_ARCH,x86) {
- LIBS += -L/usr/local/i686-linux-android/sysroot/usr/lib
- ANDROID_EXTRA_LIBS += \
- /usr/local/i686-linux-android/sysroot/usr/lib/libcrypto.so \
- /usr/local/i686-linux-android/sysroot/usr/lib/libssl.so \
- /usr/local/i686-linux-android/sysroot/usr/lib/libcurl.so \
- /usr/local/i686-linux-android/sysroot/usr/lib/librtclient.so \
- /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient_x86.so
-}
-
-contains(ANDROID_TARGET_ARCH,x86_64) {
- LIBS += -L/usr/local/x86_64-linux-android/sysroot/usr/lib64
- ANDROID_EXTRA_LIBS += \
- /usr/local/x86_64-linux-android/sysroot/usr/lib64/libcrypto.so \
- /usr/local/x86_64-linux-android/sysroot/usr/lib64/libssl.so \
- /usr/local/x86_64-linux-android/sysroot/usr/lib64/libcurl.so \
- /usr/local/x86_64-linux-android/sysroot/usr/lib64/librtclient.so \
- /opt/Qt5.14.1/5.14.1/android/lib/libqrtclient_x86_64.so
-}
-
-android {
- INCLUDEPATH += /opt/android-ndk/sources/cxx-stl/llvm-libc++/include
- QT += svg
- DISTFILES += android/AndroidManifest.xml
- ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
- certs.path = /assets/certs
- certs.files = /etc/ssl/certs/ca-certificates.crt
- INSTALLS += certs
-}
-
-debug: DEFINES += DEBUG