project(odf_validate_test C)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations")

aux_source_directory(./ TEST_SRC)
aux_source_directory(./test_interface/public TEST_SRC)
aux_source_directory(./test_interface/server TEST_SRC)
list(SORT TEST_SRC)
add_executable(${PROJECT_NAME} ${TEST_SRC})

pkg_check_modules(LB_BASE REQUIRED lb_base)
pkg_check_modules(GIO REQUIRED gio-2.0)

target_include_directories(${PROJECT_NAME} PUBLIC
    ${GLIB2_INCLUDE_DIRS}
    ${LB_BASE_INCLUDE_DIRS}
    ${CONN_PUB_INCLUDE_DIRS}
    ./test_interface
)
target_link_directories(${PROJECT_NAME} PUBLIC
    ${GLIB2_LIBRARIES}
    ${CONN_PUB_LIBRARY_DIRS}
    )
target_link_libraries(${PROJECT_NAME} PUBLIC
    ${GLIB2_LIBRARIES}
    ${GIO_LIBRARIES}
    ${CONN_PUB_LIBRARIES}
)

install(FILES test_interface/public/com.litebmc.OdfTest.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/interfaces)
install(FILES test_interface/server/schema/OdfTest.json DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/litebmc/schema/)
install(TARGETS ${PROJECT_NAME} DESTINATION opt/litebmc/apps/odf_validate_test)
