From 99fc3de45571daeb59525cd0c113d75d5db81594 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Wed, 3 Jan 2024 17:04:57 -0500 Subject: [PATCH] Fix reference to WinMain on Qt6 Signed-off-by: Geoff Hutchison --- avogadro/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/avogadro/CMakeLists.txt b/avogadro/CMakeLists.txt index 88f93531..23e97f14 100644 --- a/avogadro/CMakeLists.txt +++ b/avogadro/CMakeLists.txt @@ -87,7 +87,11 @@ if(Avogadro_ENABLE_RPC) endif() if(ENABLE_TESTING) +if(QT_VERSION EQUAL 6) + find_package(Qt6 COMPONENTS Test REQUIRED) +elseif(QT_VERSION EQUAL 5) find_package(Qt5 COMPONENTS Test REQUIRED) +endif() find_package(QtTesting REQUIRED NO_MODULE) include_directories(${QtTesting_INCLUDE_DIRS}) link_directories(${QtTesting_LIBRARY_DIR}) @@ -179,8 +183,10 @@ add_executable(avogadro WIN32 MACOSX_BUNDLE target_link_libraries(avogadro Qt::Widgets Qt::Network Qt::Concurrent) if(WIN32) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD") +if(QT_VERSION EQUAL 5) target_link_libraries(avogadro Qt::WinMain) endif() +endif() set_target_properties(avogadro PROPERTIES AUTOMOC TRUE) target_link_libraries(avogadro Avogadro::QtOpenGL Avogadro::QtGui Avogadro::QtPlugins) if(Avogadro_ENABLE_RPC)