Skip to content

Commit

Permalink
Changed find_package for QWT on windows only.
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin5300 committed Aug 22, 2021
1 parent cae8289 commit 1f94441
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ if(WIN32)
set(QWT_DIR "C:/Qwt-6.1.4")
set(OPENSSL_DIR "C:/Qt/Tools/OpenSSL/Win_x64")
set(CRYPTOPP_DIR "C:/cryptopp")
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.1/msvc2019_64/lib/cmake/Qt5QuickCompiler")
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.1/msvc2019_64/lib/cmake/Qt5")
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.2/mingw81_64")
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.2/mingw81_64/lib/cmake/Qt5QuickCompiler")
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.2/mingw81_64/lib/cmake/Qt5")

if (MSVC)
if("${MSVC_RUNTIME}" STREQUAL "")
Expand Down
15 changes: 9 additions & 6 deletions source/cmake/gui.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,15 @@ if(APPLE)
link_libraries(${QWT})
message("QWT found: ${QWT}")
endif()

elseif(WIN32)
find_library(QWT
NAMES qwt
HINTS ${QWT_DIR}/lib
REQUIRED)
if(QWT)
message("QWT found: ${QWT}")
endif()
else()

find_library(QWT_QT5 qwt-qt5 REQUIRED)

endif()
Expand Down Expand Up @@ -159,14 +165,11 @@ target_include_directories(muondetector-gui PUBLIC
${Qt5QuickWidgets_INCLUDE_DIRS}
${Qt5Qml_INCLUDE_DIRS}
)
target_link_directories(muondetector-gui PUBLIC
"${QWT_DIR}/lib/"
)

target_link_libraries(muondetector-gui
Qt5::Network Qt5::Svg Qt5::Widgets Qt5::Gui Qt5::Quick Qt5::QuickWidgets Qt5::Qml
muondetector-shared
qwt.lib
${QWT}
)

elseif(APPLE)
Expand Down

0 comments on commit 1f94441

Please sign in to comment.