Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reference to WinMain on Qt6 #454

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading