Don't build kimgiotest unless BUILD_TESTING=ON

Summary:
In >=KF-5.38 target kimgiotest is only built if BUILD_TESTING=ON,
so subsequent target_compile_definitions will fail if OFF.

Reviewers: #okular

Subscribers: kfunk

Tags: #okular

Differential Revision: https://phabricator.kde.org/D7212
parent 56849e70
...@@ -9,10 +9,12 @@ include_directories( ...@@ -9,10 +9,12 @@ include_directories(
okular_add_generator(okularGenerator_kimgio generator_kimgio.cpp) okular_add_generator(okularGenerator_kimgio generator_kimgio.cpp)
target_link_libraries(okularGenerator_kimgio okularcore KF5::KExiv2 KF5::I18n) target_link_libraries(okularGenerator_kimgio okularcore KF5::KExiv2 KF5::I18n)
add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" ) if(BUILD_TESTING)
set( kimgiotest_SRCS tests/kimgiotest.cpp ${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp ${CMAKE_SOURCE_DIR}/ui/debug_ui.cpp ) add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
ecm_add_test(${kimgiotest_SRCS} TEST_NAME "kimgiotest" LINK_LIBRARIES okularcore okularpart Qt5::Svg Qt5::Test) set( kimgiotest_SRCS tests/kimgiotest.cpp ${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp ${CMAKE_SOURCE_DIR}/ui/debug_ui.cpp )
target_compile_definitions(kimgiotest PRIVATE -DGENERATOR_PATH="$<TARGET_FILE:okularGenerator_kimgio>") ecm_add_test(${kimgiotest_SRCS} TEST_NAME "kimgiotest" LINK_LIBRARIES okularcore okularpart Qt5::Svg Qt5::Test)
target_compile_definitions(kimgiotest PRIVATE -DGENERATOR_PATH="$<TARGET_FILE:okularGenerator_kimgio>")
endif()
########### install files ############### ########### install files ###############
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment