libkscreen: require QJSON only for test builds

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-01-23 15:01:52 +02:00
parent e5161301bf
commit 3408e6ff74
3 changed files with 9 additions and 8 deletions

View file

@ -16,7 +16,6 @@ if(POLICY CMP0017)
endif()
enable_testing()
find_package(QJSON 0.8 REQUIRED)
add_definitions(${KDE4_DEFINITIONS})
include(CheckCXXCompilerFlag)
@ -34,8 +33,10 @@ set_package_properties(X11_XCB PROPERTIES DESCRIPTION "XCB extension to work wit
PURPOSE "Needed to build XRandR 1.1 backend"
)
# Required to build on Gentoo
link_directories(${QJSON_LIBRARY_DIRS})
if(ENABLE_TESTING)
find_package(QJSON 0.8 REQUIRED)
link_directories(${QJSON_LIBRARY_DIRS})
endif()
check_cxx_compiler_flag(-fvisibility=hidden _HAVE_VISIBILITY)
if (_HAVE_VISIBILITY AND NOT WIN32)

View file

@ -1,5 +1,7 @@
add_subdirectory(fake)
if(ENABLE_TESTING)
add_subdirectory(fake)
endif()
add_subdirectory(xrandr)
if (XCB_FOUND AND X11_XCB_FOUND)
add_subdirectory(xrandr1.1)
endif(XCB_FOUND AND X11_XCB_FOUND)
endif()

View file

@ -10,11 +10,9 @@ set(libkscreen_SRCS
mode.cpp
)
qt4_automoc(${libkscreen_SRCS})
add_library(kscreen SHARED ${libkscreen_SRCS})
target_link_libraries(kscreen ${QT_QTCORE_LIBRARY} ${KDE4_KDECORE_LIBS} ${QJSON_LIBRARIES})
target_link_libraries(kscreen ${QT_QTCORE_LIBRARY} ${KDE4_KDECORE_LIBS})
set_target_properties(kscreen PROPERTIES
VERSION ${libkscreen_VERSION}