From e961ba419c49fa7f505a8b9f48a0cf471202165d Mon Sep 17 00:00:00 2001
From: EndrII <endriimail@gmail.com>
Date: Sun, 29 Mar 2020 14:22:44 +0300
Subject: [PATCH] added base support CMake

---
 .gitmodules          |  3 +++
 CMake                |  1 +
 CMakeLists.txt       | 18 ++++++++++++++++++
 src/CMakeLists.txt   | 32 ++++++++++++++++++++++++++++++++
 tests/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++
 5 files changed, 84 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 CMake
 create mode 100755 CMakeLists.txt
 create mode 100755 src/CMakeLists.txt
 create mode 100755 tests/CMakeLists.txt

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..d892894
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "CMake"]
+	path = CMake
+	url = https://github.com/QuasarApp/CMake.git
diff --git a/CMake b/CMake
new file mode 160000
index 0000000..bd794b7
--- /dev/null
+++ b/CMake
@@ -0,0 +1 @@
+Subproject commit bd794b7bdedd54c19f714e60cd9d882c9ec11308
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755
index 0000000..db8bd01
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2018-2020 QuasarApp.
+# Distributed under the lgplv3 software license, see the accompanying
+# Everyone is permitted to copy and distribute verbatim copies
+# of this license document, but changing it is not allowed.
+#
+
+cmake_minimum_required(VERSION 3.1)
+project(MainQtBigint)
+
+include(CMake/ccache.cmake)
+include(CMake/QuasarAppCITargets.cmake)
+
+initAll()
+
+# Add sub directories
+add_subdirectory(src)
+add_subdirectory(tests)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100755
index 0000000..2a16689
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2018-2020 QuasarApp.
+# Distributed under the lgplv3 software license, see the accompanying
+# Everyone is permitted to copy and distribute verbatim copies
+# of this license document, but changing it is not allowed.
+#
+
+cmake_minimum_required(VERSION 3.1)
+include(../CMake/crossplatform/crossplatform.cmake)
+
+project(QtBigint LANGUAGES CXX)
+
+include(../CMake/ProjectOut.cmake)
+include(../CMake/Version.cmake)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+find_package(Qt5 COMPONENTS Core REQUIRED)
+
+file(GLOB SOURCE_CPP
+    "*.cpp"
+)
+
+add_library(${PROJECT_NAME} SHARED ${SOURCE_CPP})
+target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core)
+target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+setVersion(6 1 2)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100755
index 0000000..a4121b9
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2018-2020 QuasarApp.
+# Distributed under the lgplv3 software license, see the accompanying
+# Everyone is permitted to copy and distribute verbatim copies
+# of this license document, but changing it is not allowed.
+#
+
+cmake_minimum_required(VERSION 3.1)
+
+project(TestQtBigint LANGUAGES CXX)
+
+include(../CMake/ProjectOut.cmake)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+find_package(Qt5 COMPONENTS Core REQUIRED)
+find_package(Qt5 COMPONENTS Test REQUIRED)
+
+file(GLOB SOURCE_CPP
+    "*.cpp"
+)
+
+add_library(${PROJECT_NAME} SHARED ${SOURCE_CPP})
+target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Test QtBigint)
+target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+