X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=CMakeLists.txt;h=3b41bff7980c1d1dcd7ba28870d846e42a556d1e;hp=d1f122c416fb52116864329cfe97f218e5677259;hb=f4270878df362f5797c8d73591c67882cdd52b4c;hpb=5a13850ba586de3ca619f2e7aaea2305c00a38a8 diff --git a/CMakeLists.txt b/CMakeLists.txt index d1f122c4..3b41bff7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,11 +28,11 @@ project(pulseview) #------------------------------------------------------------------------------- option(ENABLE_TESTS "Enable unit tests" FALSE) -option(STATIC_PKGDEPS_LIBS "Statically link to sigrok libraries" FALSE) +option(STATIC_PKGDEPS_LIBS "Statically link to (pkgconfig) libraries" FALSE) if(WIN32) - # On Windows/MinGW we need to statically link to libraries - # This option is user configurable, but enable it by default on win32 + # On Windows/MinGW we need to statically link to libraries. + # This option is user configurable, but enable it by default on win32. set(STATIC_PKGDEPS_LIBS TRUE) endif() @@ -49,16 +49,22 @@ pkg_check_modules(PKGDEPS REQUIRED # On Windows/MinGW we explicitly point cmake to the Boost directory. if(WIN32) set(BOOST_ROOT /usr/local) -endif(WIN32) +endif() find_package(Qt4 REQUIRED) + +if(ENABLE_TESTS) find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED) +else() +find_package(Boost 1.46) +endif() #=============================================================================== #= Config Header #------------------------------------------------------------------------------- set(PV_TITLE PulseView) +set(PV_DESCRIPTION "A GUI for sigrok") set(PV_VERSION_MAJOR 0) set(PV_VERSION_MINOR 1) @@ -113,13 +119,6 @@ set(pulseview_RESOURCES pulseview.qrc ) -set(pulseview_TEST_SOURCES - pv/datasnapshot.cpp - pv/logicdatasnapshot.cpp - test/logicdatasnapshot.cpp - test/test.cpp -) - qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}) qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS}) qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES}) @@ -187,18 +186,7 @@ install(PROGRAMS ${PROJECT_NAME} DESTINATION bin/) #------------------------------------------------------------------------------- if(ENABLE_TESTS) - - add_definitions(pulseview-tests - -DBOOST_TEST_DYN_LINK - ) - - add_executable(pulseview-test - ${pulseview_TEST_SOURCES} - ) - - target_link_libraries(pulseview-test ${PULSEVIEW_LINK_LIBS}) - + add_subdirectory(test) enable_testing() - add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test) - + add_test(test ${CMAKE_CURRENT_BINARY_DIR}/test/pulseview-test) endif(ENABLE_TESTS)