diff --git a/cmake/modules/FindSourceHighlight.cmake b/cmake/modules/FindSourceHighlight.cmake index f9df81b..90e6423 100644 --- a/cmake/modules/FindSourceHighlight.cmake +++ b/cmake/modules/FindSourceHighlight.cmake @@ -34,6 +34,16 @@ else(SourceHighlight_INCLUDE_DIR AND SourceHighlight_LIBRARIES AND Ncurses_LIBRA mark_as_advanced(SourceHighlight_INCLUDE_DIR SourceHighlight_LIBRARIES) endif(SourceHighlight_INCLUDE_DIR AND SourceHighlight_LIBRARIES AND Ncurses_LIBRARY) +if (SourceHighlight_FOUND AND NOT TARGET SourceHighlight::SourceHighlight) + add_library(SourceHighlight::SourceHighlight INTERFACE IMPORTED) + set_property(TARGET SourceHighlight::SourceHighlight + PROPERTY INTERFACE_LINK_LIBRARIES "${SourceHighlight_LIBRARIES}" + ) + set_property(TARGET SourceHighlight::SourceHighlight + PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SourceHighlight_INCLUDE_DIR}" + ) +endif() + mark_as_advanced( SourceHighlight_INCLUDE_DIR SourceHighlight_LIBRARIES diff --git a/src/kamokan_impl/CMakeLists.txt b/src/kamokan_impl/CMakeLists.txt index 54f3ead..d6e3698 100644 --- a/src/kamokan_impl/CMakeLists.txt +++ b/src/kamokan_impl/CMakeLists.txt @@ -37,7 +37,6 @@ target_include_directories(${PROJECT_NAME} target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} PUBLIC ${TAWASHI_SOURCE_ROOT}/lib/better-enums - PRIVATE ${SourceHighlight_INCLUDE_DIR} PRIVATE ${TAWASHI_SOURCE_ROOT}/lib/utf8_v2_3_4/source PUBLIC ${TAWASHI_SOURCE_ROOT}/lib/spdlog/include PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include @@ -45,7 +44,7 @@ target_include_directories(${PROJECT_NAME} SYSTEM target_link_libraries(${PROJECT_NAME} PRIVATE ${Boost_LIBRARIES} PRIVATE incredis - PRIVATE ${SourceHighlight_LIBRARIES} + PRIVATE SourceHighlight::SourceHighlight PUBLIC mstch PRIVATE Threads::Threads PUBLIC tawashi