added base support CMake

This commit is contained in:
Andrei Yankovich 2020-03-29 14:22:44 +03:00
parent 8c19856500
commit e961ba419c
5 changed files with 84 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "CMake"]
path = CMake
url = https://github.com/QuasarApp/CMake.git

1
CMake Submodule

@ -0,0 +1 @@
Subproject commit bd794b7bdedd54c19f714e60cd9d882c9ec11308

18
CMakeLists.txt Executable file
View File

@ -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)

32
src/CMakeLists.txt Executable file
View File

@ -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)

30
tests/CMakeLists.txt Executable file
View File

@ -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})