summaryrefslogtreecommitdiff
path: root/src/bookmarks/CMakeLists.txt
blob: 0e9fef9e1314e762d70c826ba1122bbe660234a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
add_library(bookmarks STATIC
    # Bookmarks Model
    bookmarkstreeitem.cpp bookmarkstreeitem.hpp
    bookmarkstreemodel.cpp bookmarkstreemodel.hpp
    bookmarkstreeformats.hpp
    bookmarkstreeformat_xbel_read.cpp bookmarkstreeformat_xbel_write.cpp
)
target_include_directories(bookmarks PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(bookmarks PUBLIC Qt6::Core Qt6::Widgets)

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    add_executable(test_bookmarkstreemodel test/test_bookmarkstreemodel.cpp)
    target_link_libraries(test_bookmarkstreemodel GTest::gtest GTest::gtest_main bookmarks)
    gtest_discover_tests(test_bookmarkstreemodel WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)

    add_executable(xbel test/xbel.cpp)
    target_link_libraries(xbel GTest::gtest GTest::gtest_main bookmarks)
    gtest_discover_tests(xbel WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)

    add_test(NAME bookmarks.validate_xml
        COMMAND ${PROJECT_SOURCE_DIR}/scripts/validate_xml.py --dtd=${CMAKE_CURRENT_SOURCE_DIR}/test/xbel-1.0.dtd
            ${CMAKE_CURRENT_SOURCE_DIR}/test/bookmarks.xbel
    )
endif()