Snake/CMakeLists.txt

81 lines
1.8 KiB
CMake
Raw Normal View History

#
# Copyright (C) 2020-2021 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.14)
project(SnakeProject)
if(TARGET ${PROJECT_NAME})
message("The ${PROJECT_NAME} arledy included in main Project")
return()
endif()
2021-06-04 16:46:22 +03:00
include(submodules/QuasarAppLib/CMake/QuasarApp.cmake)
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
initAll()
return()
endif()
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
2021-05-28 12:20:13 +03:00
set(BUILD_SHARED_LIBS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2021-06-05 14:19:08 +03:00
set(QT_VERSION_MAJOR 5)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Test REQUIRED)
2021-05-25 16:15:57 +03:00
if (NOT DEFINED SNAKEPROJECT_TESTS)
set(SNAKEPROJECT_TESTS ON)
2021-06-04 13:47:27 +03:00
message(1)
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
2021-05-25 16:15:57 +03:00
set(SNAKEPROJECT_TESTS OFF)
endif()
endif()
if (ANDROID)
2021-05-25 16:15:57 +03:00
set(SNAKEPROJECT_TESTS OFF)
endif()
if (NOT QT_VERSION_MAJOR)
2021-05-25 16:15:57 +03:00
set(SNAKEPROJECT_TESTS OFF)
2021-06-04 13:47:27 +03:00
message(2)
endif()
endif()
2021-05-25 16:15:57 +03:00
# Add sub directories
2021-05-28 09:59:44 +03:00
if (ANDROID)
set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/Client/android")
endif()
2021-05-27 10:52:30 +03:00
add_subdirectory(submodules/QuasarAppLib)
add_subdirectory(submodules/SimpleQmlNotify)
2021-06-06 15:53:49 +03:00
add_subdirectory(src/Core)
2021-06-08 00:43:02 +03:00
add_subdirectory(src/Empty)
2021-05-25 16:15:57 +03:00
add_subdirectory(src/Client)
2021-05-27 17:39:08 +03:00
2021-05-25 16:15:57 +03:00
if (SNAKEPROJECT_TESTS)
add_subdirectory(tests)
else()
message("The ${PROJECT_NAME} tests is disabled.")
endif()
2021-05-25 16:15:57 +03:00
initAll()
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)