Skip to content

Commit

Permalink
Merge pull request #454 from ghutchis/fix-qt6-win
Browse files Browse the repository at this point in the history
Fix reference to WinMain on Qt6
  • Loading branch information
ghutchis authored Jan 4, 2024
2 parents e990eaf + 99fc3de commit 3afc551
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions avogadro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3afc551

Please sign in to comment.