diff options
-rw-r--r-- | .gitignore | 12 | ||||
-rw-r--r-- | CMakeLists.txt | 40 | ||||
-rw-r--r-- | README.md | 32 | ||||
m--------- | librtclient | 0 |
4 files changed, 62 insertions, 22 deletions
@@ -1,10 +1,4 @@ -CMakeCache.txt -CMakeFiles -cmake_install.cmake -CMakeLists.txt.user -libqrtclient.a -Makefile -moc_* -*.o -qrtclient_autogen *.swp +CMakeLists.txt.user +build* +html diff --git a/CMakeLists.txt b/CMakeLists.txt index f4ff8be..26717b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,47 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.5) -project(qrtclient VERSION 0.1 LANGUAGES CXX) +project(qrtclient) set(CMAKE_AUTOMOC ON) find_package(Qt5Core) -add_library(${PROJECT_NAME} STATIC +add_library(${PROJECT_NAME} SHARED + ${PROJECT_NAME}/user.hxx + ${PROJECT_NAME}/ticket.hxx + ${PROJECT_NAME}/tickethistory.hxx + ${PROJECT_NAME}/client.hxx user.cxx ticket.cxx tickethistory.cxx client.cxx) -target_link_libraries(${PROJECT_NAME} Qt5::Core) +if (ANDROID) + if (ANDROID_ABI STREQUAL "arm64-v8a") + include_directories(/usr/local/aarch64-linux-android/sysroot/usr/include) + target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/aarch64-linux-android/sysroot/usr/lib) + elseif (ANDROID_ABI STREQUAL "armeabi-v7a") + include_directories(/usr/local/arm-linux-androideabi/sysroot/usr/include) + target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/arm-linux-androideabi/sysroot/usr/lib) + elseif (ANDROID_ABI STREQUAL "x86") + include_directories(/usr/local/i686-linux-android/sysroot/usr/include) + target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/i686-linux-android/sysroot/usr/lib) + elseif (ANDROID_ABI STREQUAL "x86_64") + include_directories(/usr/local/x86_64-linux-android/sysroot/usr/include) + target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/x86_64-linux-android/sysroot/usr/lib) + endif() +endif() -include_directories(librtclient) +target_link_libraries(${PROJECT_NAME} + Qt5::Core + rtclient + ) + +install(TARGETS ${PROJECT_NAME} DESTINATION lib) +install(FILES + ${PROJECT_NAME}/user.hxx + ${PROJECT_NAME}/ticket.hxx + ${PROJECT_NAME}/tickethistory.hxx + ${PROJECT_NAME}/client.hxx + DESTINATION include/${PROJECT_NAME} + ) @@ -12,31 +12,47 @@ $ cd qrtclient ## Configuring for various target hosts (with optional debugging) ```sh -$ qmake CONFIG+=debug -spec android-clang qrtclient.pro +$ mkdir build +$ cmake -DCMAKE_BUILD_TYPE=Debug .. ``` or ```sh -$ qmake CONFIG+=debug -spec linux-g++ qrtclient.pro +$ mkdir build-Android_arm64_v8a-Debug +$ cd build-Android_arm64_v8a-Debug +$ cmake -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DCMAKE_FIND_ROOT_PATH=/opt/Qt5.14.1/5.14.1/android -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_BUILD_ABI_arm64-v8a=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/Qt5.14.1/5.14.1/android -DANDROID_ABI=arm64-v8a -DCMAKE_CXX_STANDARD_LIBRARIES=/opt/android-ndk/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so .. ``` -or +and/or ```sh -$ qmake CONFIG+=debug -spec macx-clang qrtclient.pro +$ mkdir build-Android_armeabi_v7a-Debug +$ cd build-Android_armeabi_v7a-Debug +$ cmake -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DCMAKE_FIND_ROOT_PATH=/opt/Qt5.14.1/5.14.1/android -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_BUILD_ABI_armeabi_v7a=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/Qt5.14.1/5.14.1/android -DANDROID_ABI=armeabi-v7a -DCMAKE_CXX_STANDARD_LIBRARIES=/opt/android-ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so .. ``` -or +and/or + +```sh +$ mkdir build-Android_x86-Debug +$ cd build-Android_x86-Debug +$ cmake -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DCMAKE_FIND_ROOT_PATH=/opt/Qt5.14.1/5.14.1/android -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_BUILD_ABI_x86=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/Qt5.14.1/5.14.1/android -DANDROID_ABI=x86 -DCMAKE_CXX_STANDARD_LIBRARIES=/opt/android-ndk/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so .. +``` + +and/or ```sh -$ qmake CONFIG+=debug -spec macx-ios-clang qrtclient.pro +$ mkdir build-Android_x86_64-Debug +$ cd build-Android_x86_64-Debug +$ cmake -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DCMAKE_FIND_ROOT_PATH=/opt/Qt5.14.1/5.14.1/android -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_BUILD_ABI_x86_64=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/Qt5.14.1/5.14.1/android -DANDROID_ABI=x86_64 -DCMAKE_CXX_STANDARD_LIBRARIES=/opt/android-ndk/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so .. ``` -or so on. +and/or so on. -## Compiling and linking +## Compiling, linking, and installing ```sh $ make # -jN (with N an integer number of parallel tasks you allow your computer to run for compiling this) +$ sudo make install ``` diff --git a/librtclient b/librtclient -Subproject 9d57190f8aa7d62877dc24066d4f0027cc53a12 +Subproject 8b16f4c890cd60b059a423cde4c60d0f3b5218c |