-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy path001-fix-build-on-mingw.patch
39 lines (37 loc) · 1.38 KB
/
001-fix-build-on-mingw.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- a/avogadro/CMakeLists.txt
+++ b/avogadro/CMakeLists.txt
@@ -67,7 +67,7 @@
FILES_MATCHING PATTERN "*.qm"
)
-if(APPLE OR WIN32 OR INSTALL_BUNDLE_FILES)
+if(APPLE OR MSVC OR INSTALL_BUNDLE_FILES)
# copy the qt translation files
get_filename_component(_qttranslationdir "${Qt5_DIR}/../../../translations" ABSOLUTE)
message(STATUS "Install Qt translations ${_qttranslationdir}")
@@ -181,7 +181,7 @@
add_executable(avogadro WIN32 MACOSX_BUNDLE
${avogadro_srcs} ${ui_srcs} ${rcc_srcs})
target_link_libraries(avogadro Qt::Widgets Qt::Network Qt::Concurrent)
-if(WIN32)
+if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD")
if(QT_VERSION EQUAL 5)
target_link_libraries(avogadro Qt::WinMain)
--- a/avogadro/lastinstall/CMakeLists.txt
+++ b/avogadro/lastinstall/CMakeLists.txt
@@ -1,4 +1,4 @@
-if((APPLE OR WIN32) AND NOT ${CMAKE_VERSION} VERSION_LESS 2.8.8)
+if((APPLE OR MSVC) AND NOT ${CMAKE_VERSION} VERSION_LESS 2.8.8)
set(pfx "")
if(NOT APPLE)
set(pfx "bin/")
--- a/cmake/AvogadroCPack.cmake
+++ b/cmake/AvogadroCPack.cmake
@@ -36,7 +36,7 @@
# Should we add extra install rules to make a self-contained bundle, this is
# usually only required when attempting to create self-contained installers.
-if(APPLE OR WIN32)
+if(APPLE OR MSVC)
set(INSTALL_BUNDLE_FILES ON)
else()
option(INSTALL_BUNDLE_FILES "Add install rules to bundle files" OFF)