# Session project file, builds the shared library and the application using it.
#
# Configure and build, one build directory per configuration:
#
#   cmake -S . -B build/Desktop-Debug -DCMAKE_BUILD_TYPE=Debug
#   cmake --build build/Desktop-Debug --parallel

cmake_minimum_required(VERSION 3.16)

project(SharedLibraryBuildSystemConfigs LANGUAGES CXX)

# mirror the qmake default: without an explicitly requested configuration a
# release build is generated
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE Release CACHE STRING "Build configuration (Debug or Release)" FORCE)
endif()

# Qt is looked up once here, the individual targets only link against the
# imported targets (this is the counterpart of 'QT += widgets' in the .pro files)
find_package(Qt6 REQUIRED COMPONENTS Widgets)

# the application links against the library, so the library is added first;
# the actual build order is enforced by target_link_libraries() in TestApp
add_subdirectory(libs/TestLib)
add_subdirectory(TestApp)
