1*84af0c9bSNicolas Bonnefoncmake_minimum_required(VERSION 3.0.0) 2*84af0c9bSNicolas Bonnefonproject(glogg_tests) 3*84af0c9bSNicolas Bonnefon 4*84af0c9bSNicolas Bonnefonfind_program(QT_QMAKE_EXECUTABLE NAMES qmake PATHS $ENV{QT_DIR}/bin) 5*84af0c9bSNicolas Bonnefonfind_package(Qt5Widgets REQUIRED) 6*84af0c9bSNicolas Bonnefon 7*84af0c9bSNicolas Bonnefonset(CMAKE_AUTOMOC ON) 8*84af0c9bSNicolas Bonnefonset(CMAKE_AUTOUIC ON) 9*84af0c9bSNicolas Bonnefonset(CMAKE_INCLUDE_CURRENT_DIR ON) 10*84af0c9bSNicolas Bonnefon 11*84af0c9bSNicolas Bonnefon# Setup testing 12*84af0c9bSNicolas Bonnefonenable_testing() 13*84af0c9bSNicolas Bonnefoninclude_directories( 14*84af0c9bSNicolas Bonnefon $ENV{GMOCK_HOME}/include 15*84af0c9bSNicolas Bonnefon $ENV{GMOCK_HOME}/gtest/include 16*84af0c9bSNicolas Bonnefon $ENV{BOOST_ROOT}/ 17*84af0c9bSNicolas Bonnefon ../src/ ) 18*84af0c9bSNicolas Bonnefonlink_directories($ENV{GMOCK_HOME}/mybuild $ENV{GMOCK_HOME}/mybuild/gtest) 19*84af0c9bSNicolas Bonnefon 20*84af0c9bSNicolas Bonnefon# Sources 21*84af0c9bSNicolas Bonnefonset(glogg_SOURCES 22*84af0c9bSNicolas Bonnefon ../src/session.cpp 23*84af0c9bSNicolas Bonnefon ../src/data/abstractlogdata.cpp 24*84af0c9bSNicolas Bonnefon ../src/data/logdata.cpp 25*84af0c9bSNicolas Bonnefon ../src/data/logfiltereddata.cpp 26*84af0c9bSNicolas Bonnefon ../src/data/logfiltereddataworkerthread.cpp 27*84af0c9bSNicolas Bonnefon ../src/data/logdataworkerthread.cpp 28*84af0c9bSNicolas Bonnefon ../src/mainwindow.cpp 29*84af0c9bSNicolas Bonnefon ../src/crawlerwidget.cpp 30*84af0c9bSNicolas Bonnefon ../src/abstractlogview.cpp 31*84af0c9bSNicolas Bonnefon ../src/logmainview.cpp 32*84af0c9bSNicolas Bonnefon ../src/filteredview.cpp 33*84af0c9bSNicolas Bonnefon ../src/optionsdialog.cpp 34*84af0c9bSNicolas Bonnefon ../src/persistentinfo.cpp 35*84af0c9bSNicolas Bonnefon ../src/configuration.cpp 36*84af0c9bSNicolas Bonnefon ../src/filtersdialog.cpp 37*84af0c9bSNicolas Bonnefon ../src/filterset.cpp 38*84af0c9bSNicolas Bonnefon ../src/savedsearches.cpp 39*84af0c9bSNicolas Bonnefon ../src/infoline.cpp 40*84af0c9bSNicolas Bonnefon ../src/menuactiontooltipbehavior.cpp 41*84af0c9bSNicolas Bonnefon ../src/selection.cpp 42*84af0c9bSNicolas Bonnefon ../src/quickfind.cpp 43*84af0c9bSNicolas Bonnefon ../src/quickfindpattern.cpp 44*84af0c9bSNicolas Bonnefon ../src/quickfindwidget.cpp 45*84af0c9bSNicolas Bonnefon ../src/sessioninfo.cpp 46*84af0c9bSNicolas Bonnefon ../src/recentfiles.cpp 47*84af0c9bSNicolas Bonnefon ../src/overview.cpp 48*84af0c9bSNicolas Bonnefon ../src/overviewwidget.cpp 49*84af0c9bSNicolas Bonnefon ../src/marks.cpp 50*84af0c9bSNicolas Bonnefon ../src/quickfindmux.cpp 51*84af0c9bSNicolas Bonnefon ../src/signalmux.cpp 52*84af0c9bSNicolas Bonnefon ../src/qtfilewatcher.cpp 53*84af0c9bSNicolas Bonnefon ../src/tabbedcrawlerwidget.cpp 54*84af0c9bSNicolas Bonnefon ../src/filewatcher.cpp 55*84af0c9bSNicolas Bonnefon ../src/inotifywatchtower.cpp ) 56*84af0c9bSNicolas Bonnefon 57*84af0c9bSNicolas Bonnefonset(glogg_HEADERS 58*84af0c9bSNicolas Bonnefon ../src/mainwindow.h 59*84af0c9bSNicolas Bonnefon ../src/marks.h 60*84af0c9bSNicolas Bonnefon ../src/filewatcher.h) 61*84af0c9bSNicolas Bonnefon 62*84af0c9bSNicolas Bonnefonset(glogg_TESTS 63*84af0c9bSNicolas Bonnefon testtest.cpp 64*84af0c9bSNicolas Bonnefon filewatcherTest.cpp 65*84af0c9bSNicolas Bonnefon watchtowerTest.cpp 66*84af0c9bSNicolas Bonnefon) 67*84af0c9bSNicolas Bonnefon 68*84af0c9bSNicolas Bonnefon# Options 69*84af0c9bSNicolas Bonnefonif (WIN32) 70*84af0c9bSNicolas Bonnefon set(FileWatcherEngine_SOURCES ../src/winfilewatcher.cpp) 71*84af0c9bSNicolas Bonnefonendif (WIN32) 72*84af0c9bSNicolas Bonnefon 73*84af0c9bSNicolas Bonnefon# Qt 74*84af0c9bSNicolas Bonnefon# QT4_WRAP_CPP(glogg_HEADERS_MOC ${glogg_HEADERS}) 75*84af0c9bSNicolas Bonnefon# INCLUDE(${QT_USE_FILE}) 76*84af0c9bSNicolas Bonnefon# ADD_DEFINITIONS(${QT_DEFINITIONS}) 77*84af0c9bSNicolas Bonnefonset(CMAKE_CXX_FLAGS "-fPIC -std=c++11 -DGLOGG_VERSION=\\\"unit_tests\\\"") 78*84af0c9bSNicolas Bonnefon 79*84af0c9bSNicolas Bonnefon# Add test cpp file 80*84af0c9bSNicolas Bonnefonadd_executable(glogg_tests 81*84af0c9bSNicolas Bonnefon ${glogg_SOURCES} 82*84af0c9bSNicolas Bonnefon ${FileWatcherEngine_SOURCES} 83*84af0c9bSNicolas Bonnefon ${glogg_HEADERS_MOC} 84*84af0c9bSNicolas Bonnefon ${glogg_TESTS} 85*84af0c9bSNicolas Bonnefon) 86*84af0c9bSNicolas Bonnefon 87*84af0c9bSNicolas Bonnefon# Link test executable against gtest & gtest_main 88*84af0c9bSNicolas Bonnefontarget_link_libraries(glogg_tests gmock gtest gtest_main pthread Qt5::Widgets) 89*84af0c9bSNicolas Bonnefon 90*84af0c9bSNicolas Bonnefonadd_test( 91*84af0c9bSNicolas Bonnefon NAME glogg_tests 92*84af0c9bSNicolas Bonnefon COMMAND glogg_tests 93*84af0c9bSNicolas Bonnefon) 94*84af0c9bSNicolas Bonnefon 95