ButterflyEngine/CMakeLists.txt

62 lines
1.8 KiB
CMake
Raw Normal View History

2023-07-27 11:04:32 +00:00
#
# Copyright (C) 2020-2023 QuasarApp.
# Distributed under the GPLv3 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.19)
2023-07-31 22:33:52 +02:00
project(Butterfly LANGUAGES CXX)
2023-07-27 11:04:32 +00:00
if(TARGET ${PROJECT_NAME})
message("The ${PROJECT_NAME} arledy included in main Project")
return()
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 20)
2023-07-27 11:04:32 +00:00
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (ANDROID OR IOS)
set(BUILD_SHARED_LIBS ON)
endif()
2023-07-31 22:33:52 +02:00
find_package(Qt6 COMPONENTS Core REQUIRED)
find_package(Qt6 COMPONENTS Test QUIET)
2023-07-27 11:04:32 +00:00
2023-08-06 12:26:43 +02:00
include(submodules/QuasarAppLib/CMake/QuasarApp.cmake)
2023-07-27 11:04:32 +00:00
updateGitVars()
set(BUTTERFLY_ENGINE_VERSION "0.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}")
2023-07-27 11:04:32 +00:00
option(BUTTERFLY_ENGINE_TESTS "This option disables or enables tests of the ${PROJECT_NAME} project" ON)
option(BUTTERFLY_ENGINE_EXAMPLE "This option disables or enables example app of the ${PROJECT_NAME} project" ON)
2023-07-27 11:04:32 +00:00
2023-08-06 12:26:43 +02:00
if (ANDROID OR IOS OR QA_WASM32)
set(BUTTERFLY_ENGINE_TESTS OFF CACHE BOOL "This option force disbled for ANDROID IOS QA_WASM32 and Not Qt projects" FORCE)
2023-07-27 11:04:32 +00:00
endif()
make_directory(Distro)
initAll()
2023-08-06 12:26:43 +02:00
add_subdirectory(submodules/QuasarAppLib)
2023-07-31 22:33:52 +02:00
add_subdirectory(src/engine)
2023-07-27 11:04:32 +00:00
if (DEFINED BUTTERFLY_ENGINE_EXAMPLE)
2023-07-31 22:33:52 +02:00
add_subdirectory(src/example)
2023-07-27 11:04:32 +00:00
endif()
if (BUTTERFLY_ENGINE_TESTS)
2023-07-27 11:04:32 +00:00
add_subdirectory(tests)
else()
message("The ${PROJECT_NAME} tests is disabled.")
endif()
configure_file_in(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
2023-07-28 09:56:50 +02:00
addDeployFromCustomFile("ButterflyEngine" "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/ButterflyEngine.json")