Changeset View
Changeset View
Standalone View
Standalone View
src/indexer/CMakeLists.txt
1 | # when cross compiling, use either the executable offered or try to cross-compile it in place | ||||
---|---|---|---|---|---|
2 | | ||||
1 | if(CMAKE_CROSSCOMPILING AND KATEHIGHLIGHTINGINDEXER_EXECUTABLE) | 3 | if(CMAKE_CROSSCOMPILING AND KATEHIGHLIGHTINGINDEXER_EXECUTABLE) | ||
2 | # cross build, we need the indexer supplied externally | | |||
3 | add_executable(katehighlightingindexer IMPORTED GLOBAL) | 4 | add_executable(katehighlightingindexer IMPORTED GLOBAL) | ||
4 | set_target_properties(katehighlightingindexer PROPERTIES IMPORTED_LOCATION ${KATEHIGHLIGHTINGINDEXER_EXECUTABLE}) | 5 | set_target_properties(katehighlightingindexer PROPERTIES IMPORTED_LOCATION ${KATEHIGHLIGHTINGINDEXER_EXECUTABLE}) | ||
6 | elseif(CMAKE_CROSSCOMPILING) | ||||
7 | if (NOT KF5_HOST_TOOLING) | ||||
8 | message(FATAL_ERROR "Please provide a prefix with a native Qt build and pass -DKF5_HOST_TOOLING=path") | ||||
9 | endif() | ||||
10 | | ||||
11 | # search native tooling prefix | ||||
12 | string(FIND ${KF5_HOST_TOOLING} /lib idx) | ||||
13 | string(SUBSTRING ${KF5_HOST_TOOLING} 0 ${idx} NATIVE_PREFIX) | ||||
14 | message(STATUS "Building katehighlightingindexer against ${NATIVE_PREFIX}") | ||||
15 | | ||||
16 | include(ExternalProject) | ||||
17 | ExternalProject_Add(native_katehighlightingindexer | ||||
18 | SOURCE_DIR ${CMAKE_SOURCE_DIR} | ||||
19 | CMAKE_ARGS -DKSYNTAXHIGHLIGHTING_USE_GUI=OFF | ||||
20 | -DECM_DIR=${ECM_DIR} -DCMAKE_PREFIX_PATH=${NATIVE_PREFIX} | ||||
21 | -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} | ||||
22 | INSTALL_COMMAND "" | ||||
23 | ) | ||||
24 | add_executable(katehighlightingindexer IMPORTED GLOBAL) | ||||
25 | add_dependencies(katehighlightingindexer native_katehighlightingindexer) | ||||
26 | set_target_properties(katehighlightingindexer PROPERTIES IMPORTED_LOCATION | ||||
27 | ${CMAKE_CURRENT_BINARY_DIR}/native_katehighlightingindexer-prefix/src/native_katehighlightingindexer-build/bin/katehighlightingindexer) | ||||
5 | else() | 28 | else() | ||
6 | # host build | 29 | # host build | ||
7 | add_executable(katehighlightingindexer katehighlightingindexer.cpp) | 30 | add_executable(katehighlightingindexer katehighlightingindexer.cpp) | ||
8 | if(Qt5XmlPatterns_FOUND) | 31 | if(Qt5XmlPatterns_FOUND) | ||
9 | target_link_libraries(katehighlightingindexer Qt5::XmlPatterns) | 32 | target_link_libraries(katehighlightingindexer Qt5::XmlPatterns) | ||
10 | else() | 33 | else() | ||
11 | target_link_libraries(katehighlightingindexer Qt5::Core) | 34 | target_link_libraries(katehighlightingindexer Qt5::Core) | ||
12 | endif() | 35 | endif() | ||
13 | endif() | 36 | endif() |