# common settings, defines the output directories
include( ${CMAKE_CURRENT_LIST_DIR}/../build.cmake )

file( GLOB SRCS src/*.cpp )
file( GLOB MOC_HDRS src/*.h )

add_library(TestLib SHARED
	${SRCS}
	${MOC_HDRS}
	resources/TestLib.qrc
)

# same versioning scheme that qmake applies by default -> libTestLib.so.1.0.0
set_target_properties(TestLib PROPERTIES
	VERSION 1.0.0
	SOVERSION 1
)

# Set define to build the library (only in the library's own project file).
# PRIVATE is essential here: targets linking against the library must not see
# this define, so that they get the import instead of the export declaration.
target_compile_definitions(TestLib PRIVATE TESTLIB_LIBRARY)

# public headers of the library, propagated to everything linking against it
target_include_directories(TestLib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src)

# the library exposes Qt types in its public headers, hence PUBLIC
target_link_libraries(TestLib PUBLIC Qt6::Widgets)
