diff --git a/src/indexer/CMakeLists.txt b/src/indexer/CMakeLists.txt --- a/src/indexer/CMakeLists.txt +++ b/src/indexer/CMakeLists.txt @@ -1,7 +1,13 @@ -add_executable(katehighlightingindexer katehighlightingindexer.cpp) - -if(Qt5XmlPatterns_FOUND) - target_link_libraries(katehighlightingindexer Qt5::XmlPatterns) +if(CMAKE_CROSSCOMPILING AND KATEHIGHLIGHTINGINDEXER_EXECUTABLE) + # cross build, we need the indexer supplied externally + add_executable(katehighlightingindexer IMPORTED GLOBAL) + set_target_properties(katehighlightingindexer PROPERTIES IMPORTED_LOCATION ${KATEHIGHLIGHTINGINDEXER_EXECUTABLE}) else() - target_link_libraries(katehighlightingindexer Qt5::Core) + # host build + add_executable(katehighlightingindexer katehighlightingindexer.cpp) + if(Qt5XmlPatterns_FOUND) + target_link_libraries(katehighlightingindexer Qt5::XmlPatterns) + else() + target_link_libraries(katehighlightingindexer Qt5::Core) + endif() endif()