X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=test%2FCMakeLists.txt;h=22612b91d05e59378fd96df74238f4759194a24a;hp=7c454c027a1f89a2bb9e8b155025e6850b755308;hb=226a15274c4b0f3374bed48c0c4684484762ccf5;hpb=c17403e8725f31216eb665f4da7018c580346eaa diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7c454c0..22612b9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,32 +18,6 @@ ## along with this program. If not, see . ## -option(ENABLE_DECODE "Build with libsigrokdecode" FALSE) - -list(APPEND PKGDEPS libsigrok>=0.3.0) - -if(ENABLE_DECODE) - list(APPEND PKGDEPS libsigrokdecode>=0.3.0) -endif() - -find_package(PkgConfig) -pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS}) - -if(WIN32) - # On Windows/MinGW we need to use 'thread_win32' instead of 'thread'. - # The library is named libboost_thread_win32* (not libboost_thread*). - find_package(Boost 1.42 COMPONENTS filesystem system thread_win32 unit_test_framework REQUIRED) -else() - find_package(Boost 1.42 COMPONENTS filesystem system thread unit_test_framework REQUIRED) -endif() - -# Find the platform's thread library (needed for C++11 threads). -# This will set ${CMAKE_THREAD_LIBS_INIT} to the correct, OS-specific value. -find_package(Threads REQUIRED) - -find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 qmake-mac) -find_package(Qt4 REQUIRED) - set(pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/devicemanager.cpp ${PROJECT_SOURCE_DIR}/pv/sigsession.cpp @@ -134,10 +108,11 @@ if(ENABLE_DECODE) ) endif() -qt4_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS}) - -if(ENABLE_DECODE) - add_definitions(-DENABLE_DECODE) +if(Qt5Core_FOUND) + qt5_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS}) +else() + qt4_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS}) + include(${QT_USE_FILE}) endif() # On MinGW we need to use static linking. @@ -145,25 +120,6 @@ if(NOT WIN32) add_definitions(-DBOOST_TEST_DYN_LINK) endif() -add_definitions(${QT_DEFINITIONS}) - -include_directories( - ${Boost_INCLUDE_DIRS} - ${PKGDEPS_INCLUDE_DIRS} -) - -set(PULSEVIEW_LINK_LIBS - ${Boost_LIBRARIES} - ${PKGDEPS_LIBRARIES} - ${QT_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} -) - -if(WIN32) - # Workaround for a MinGW linking issue. - list(APPEND PULSEVIEW_LINK_LIBS "-llzma -llcms2") -endif() - add_executable(pulseview-test ${pulseview_TEST_SOURCES} ${pulseview_TEST_HEADERS_MOC}