54 lines
1.5 KiB
CMake
54 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.15...4.3)
|
|
project(
|
|
EmbeddedLinuxSandbox
|
|
VERSION 0.1
|
|
DESCRIPTION "LR-EnviroCommand"
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
# Only do these if this is the main project, and not if it is included through add_subdirectory
|
|
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
|
|
|
# Optionally set things like CMAKE_CXX_STANDARD, CMAKE_POSITION_INDEPENDENT_CODE here
|
|
|
|
# Let's ensure -std=c++xx instead of -std=g++xx
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
# Let's nicely support folders in IDEs
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
# Testing only available if this is the main app
|
|
# Note this needs to be done in the main CMakeLists
|
|
# since it calls enable_testing, which must be in the
|
|
# main CMakeLists.
|
|
include(CTest)
|
|
|
|
# Docs only available if this is the main app
|
|
find_package(Doxygen)
|
|
if (Doxygen_FOUND)
|
|
add_subdirectory(doc)
|
|
else ()
|
|
message(STATUS "Doxygen not found, not building docs")
|
|
endif ()
|
|
endif ()
|
|
|
|
# Packages
|
|
|
|
|
|
# Setup Qt QML
|
|
find_package(Qt6 6.10 COMPONENTS Network Quick REQUIRED)
|
|
qt_standard_project_setup(REQUIRES 6.10)
|
|
|
|
# FetchContent added in CMake 3.11, downloads during the configure step
|
|
# FetchContent_MakeAvailable was added in CMake 3.14; simpler usage
|
|
include(FetchContent)
|
|
|
|
# Add subdirectories for project
|
|
add_subdirectory(src)
|
|
add_subdirectory(app)
|
|
|
|
# Testing only available if this is the main app
|
|
if ((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
|
AND BUILD_TESTING)
|
|
add_subdirectory(test)
|
|
endif () |