set (CMAKE_AUTOMOC ON)

aux_source_directory(. SOURCECODE)

find_package(Qt6Core)
include_directories(${Qt6Core_INCLUDE_DIRS})
add_library(kyfilewatcher SHARED ${SOURCECODE})
set_target_properties(kyfilewatcher PROPERTIES VERSION 3.0.0 SOVERSION 3)
add_executable(kyfilewatcher-test test/kyfilewatcher-test.cpp)
target_link_libraries(kyfilewatcher kylog kyconf systemd pthread ${Qt6Core_LIBRARIES})
target_link_libraries(kyfilewatcher-test kyfilewatcher)
target_link_options(kyfilewatcher PRIVATE "-Wl,-z,now")

# 包含 GNU 安装目录设置  
include(GNUInstallDirs)

# 安装库文件  
install(TARGETS kyfilewatcher 
        DESTINATION ${CMAKE_INSTALL_LIBDIR})

# install(TARGETS kyfilewatcher
#         DESTINATION lib/kysdk/kysdk-system)

install(FILES libkyfilewatcher.hpp
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkyfilewatcher_global.hpp
        DESTINATION include/kysdk/kysdk-system)
