diff --git a/CMakeLists.txt b/CMakeLists.txt index 78708afea..67476213b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,6 +225,7 @@ if (SLS_USE_RECEIVER) endif (SLS_USE_RECEIVER) if (SLS_USE_GUI) + add_subdirectory(libs/qwt) add_subdirectory(slsDetectorGui) endif (SLS_USE_GUI) diff --git a/cmake/FindQwt.cmake b/cmake/FindQwt.cmake index 5bf381204..cbe5e6b03 100644 --- a/cmake/FindQwt.cmake +++ b/cmake/FindQwt.cmake @@ -42,11 +42,13 @@ # either expressed or implied, of the FreeBSD Project. #============================================================================= +#TODO! add notice that we modified the file + find_path ( QWT_INCLUDE_DIR NAMES qwt_plot.h HINTS ${QT_INCLUDE_DIR} - PATH_SUFFIXES qwt qwt-qt3 qwt-qt4 qwt-qt5 + PATH_SUFFIXES qwt-qt5 qwt ) set ( QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR} ) diff --git a/libs/qwt/CMakeLists.txt b/libs/qwt/CMakeLists.txt new file mode 100644 index 000000000..f33ed5797 --- /dev/null +++ b/libs/qwt/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.12) +project(qwt) +set(PROJECT_VERSION 6.1.5) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +#Extract qwt sources from the supplied source file +set(INTERNALQWTDIR "qwt-source/") +set(QWTBASE ${CMAKE_CURRENT_BINARY_DIR}/${INTERNALQWTDIR}) +file(MAKE_DIRECTORY ${QWTBASE}) +execute_process( + COMMAND tar -xf ${CMAKE_CURRENT_SOURCE_DIR}/qwt-6.1.5.tar.bz2 -C ${QWTBASE} --strip-components=1 + COMMAND_ERROR_IS_FATAL ANY +) + + +# # Without this define moc files are not included and linking of examples fails. +add_definitions(-DQWT_MOC_INCLUDE) + +find_package(Qt5 REQUIRED + COMPONENTS + Core + Gui + Widgets + OpenGL + Concurrent + PrintSupport + Svg +) + +file(GLOB QWT_SOURCES ${QWTBASE}src/*.cpp) +file(GLOB QWT_HEADERS ${QWTBASE}src/*.h) + + +add_library(qwt STATIC ${QWT_SOURCES} ${QWT_HEADERS} ) +target_include_directories(qwt PUBLIC + $ +) + +target_link_libraries(qwt PUBLIC + Qt5::Core + Qt5::Gui + Qt5::Widgets + Qt5::OpenGL + Qt5::Concurrent + Qt5::PrintSupport + Qt5::Svg +) + +target_compile_options(qwt PRIVATE -w) \ No newline at end of file diff --git a/libs/qwt/qwt-6.1.5.tar.bz2 b/libs/qwt/qwt-6.1.5.tar.bz2 new file mode 100644 index 000000000..9317162a9 Binary files /dev/null and b/libs/qwt/qwt-6.1.5.tar.bz2 differ diff --git a/slsDetectorGui/CMakeLists.txt b/slsDetectorGui/CMakeLists.txt index cd007a4db..8915f29a9 100755 --- a/slsDetectorGui/CMakeLists.txt +++ b/slsDetectorGui/CMakeLists.txt @@ -10,7 +10,9 @@ find_package(Qt5 5.9 COMPONENTS Widgets Core Gui REQUIRED) find_package(PNG REQUIRED) find_package(ZLIB REQUIRED) -find_package(Qwt 6.1 REQUIRED) +# find_package(Qwt 6.1 REQUIRED) + +# add_subdirectory(${PROJECT_SOURCE_DIR}/libs/qwt) set(SOURCES slsDetectorPlotting/src/SlsQt1DPlot.cpp @@ -89,7 +91,7 @@ add_executable(slsDetectorGui target_include_directories(slsDetectorGui PUBLIC "$" - "$" + # "$" "$" "$" "$" @@ -100,7 +102,7 @@ target_include_directories(slsDetectorGui PUBLIC target_link_libraries(slsDetectorGui PUBLIC slsProjectOptions slsDetectorStatic - ${QWT_LIBRARIES} + # ${QWT_LIBRARIES} PNG::PNG ZLIB::ZLIB Qt5::Widgets @@ -110,6 +112,7 @@ target_link_libraries(slsDetectorGui PUBLIC PRIVATE slsProjectWarnings + qwt ) set_target_properties(slsDetectorGui PROPERTIES