-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy path0001-mingw-cmake.patch
More file actions
57 lines (50 loc) · 1.72 KB
/
0001-mingw-cmake.patch
File metadata and controls
57 lines (50 loc) · 1.72 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- netcdf-4.6.0/CMakeLists.txt.orig 2018-01-25 18:32:02.000000000 +0100
+++ netcdf-4.6.0/CMakeLists.txt 2018-03-16 18:07:25.976347300 +0100
@@ -169,7 +169,7 @@
# Set Memory test program for non-MSVC based builds.
# Assume valgrind for now.
-IF(NOT MSVC)
+IF((NOT MSVC) AND (NOT MINGW))
SET(CTEST_MEMORYCHECK_COMMAND valgrind CACHE STRING "")
ENDIF()
@@ -249,10 +249,14 @@
ADD_DEFINITIONS()
+# Add specific flags for environments that use the windows runtime (MSVC and MINGW)
# Suppress CRT Warnings.
-# Only necessary for Windows
-IF(MSVC)
+# specify tempfile
+# specify exceptions in sscanf
+IF(MSVC OR MINGW)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+ SET (HAVE_WIN_TEMP ON)
+ SET (HAVE_WIN_SSCANF ON)
ENDIF()
#####
@@ -273,7 +277,7 @@
# Configuration for post-install RPath
# Adapted from http://www.cmake.org/Wiki/CMake_RPATH_handling
##
-IF(NOT MSVC AND BUILD_SHARED_LIBS)
+IF(NOT WIN32 AND BUILD_SHARED_LIBS)
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
@@ -891,7 +895,7 @@
SET(NC_CTEST_DROP_LOC_PREFIX "" CACHE STRING "Prefix for Dashboard location on remote server when using CTest-based testing.")
FIND_PROGRAM(HOSTNAME_CMD NAMES hostname)
- IF(NOT MSVC)
+ IF(NOT WIN32)
SET(HOSTNAME_ARG "-s")
ENDIF()
IF(HOSTNAME_CMD)
@@ -1379,7 +1383,9 @@
CHECK_FUNCTION_EXISTS(strndup HAVE_STRNDUP)
CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)
CHECK_FUNCTION_EXISTS(strtoull HAVE_STRTOULL)
-CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
+IF (NOT MINGW)
+ CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
+ENDIF(NOT MINGW)
CHECK_FUNCTION_EXISTS(mktemp HAVE_MKTEMP)
CHECK_FUNCTION_EXISTS(random HAVE_RANDOM)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)