Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ endif()

project(QtADS LANGUAGES CXX VERSION ${VERSION_SHORT})

if(CMAKE_VERSION VERSION_LESS 3.21.0)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(QtADS_IS_TOP_LEVEL true)
endif()
endif()

option(BUILD_STATIC "Build the static library" OFF)
option(BUILD_EXAMPLES "Build the examples" ON)

Expand All @@ -52,6 +58,12 @@ else()
set(ads_PlatformDir "${ADS_PLATFORM_DIR}")
endif()

if(QtADS_IS_TOP_LEVEL)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.26.0)
cmake_policy(SET CMP0143 NEW)
endif()
endif()

add_subdirectory(src)

if(BUILD_EXAMPLES)
Expand Down
4 changes: 4 additions & 0 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.16)
project(ads_demo VERSION ${VERSION_SHORT})

if(QtADS_IS_TOP_LEVEL)
set(CMAKE_FOLDER "Demo")
endif()

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets Quick QuickWidgets REQUIRED)
if(WIN32 AND QT_VERSION_MAJOR LESS 6)
Expand Down
5 changes: 5 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.16)
project(QtADSExamples LANGUAGES CXX VERSION ${VERSION_SHORT})

if(QtADS_IS_TOP_LEVEL)
set(CMAKE_FOLDER "Examples")
endif()

add_subdirectory(simple)
add_subdirectory(hideshow)
add_subdirectory(sidebar)
Expand Down