aboutsummaryrefslogtreecommitdiff
path: root/ports/tiff/cmakelists.patch
blob: 597c980c5571f4e54c4afb93ba93bdaaf6918910 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 845ddf0..9ccb9b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -181,9 +181,7 @@ foreach(flag ${test_flags})
   endif (${test_c_flag})
 endforeach(flag ${test_flags})
 
-if(MSVC)
-    set(CMAKE_DEBUG_POSTFIX "d")
-endif()
+set(CMAKE_DEBUG_POSTFIX "d")
 
 option(ld-version-script "Enable linker version script" ON)
 # Check if LD supports linker scripts.
@@ -601,12 +599,15 @@ check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
 check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
 
 # Win32 IO
-set(win32_io FALSE)
-if(WIN32)
-  set(win32_io TRUE)
+set(USE_WIN32_FILEIO FALSE CACHE BOOL "")
+if(MSVC)
+  if (NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")  #on UWP we use the unix I/O api
+    set(USE_WIN32_FILEIO TRUE CACHE BOOL "" FORCE)
+    add_definitions(-DUSE_WIN32_FILEIO)
+  endif()
+  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS /wd4996)
 endif()
 
-set(USE_WIN32_FILEIO ${win32_io})
 
 # Orthogonal features
 
@@ -708,16 +709,28 @@ endif()
 
 #report_values(TIFF_INCLUDES TIFF_LIBRARY_DEPS)
 
+option(BUILD_TOOLS "Build tool executables" ON)
+option(BUILD_DOCS "Build docs" ON)
+option(BUILD_CONTRIB "Build contributed executables" ON)
+option(BUILD_TESTS "Build tests" ON)
+
 # Process subdirectories
 add_subdirectory(port)
 add_subdirectory(libtiff)
-add_subdirectory(tools)
-add_subdirectory(test)
-add_subdirectory(contrib)
-add_subdirectory(build)
-add_subdirectory(man)
-add_subdirectory(html)
-
+if(BUILD_TOOLS)
+  add_subdirectory(tools)
+endif()
+if(BUILD_TESTS)
+  add_subdirectory(test)
+endif()
+if(BUILD_CONTRIB)
+  add_subdirectory(contrib)
+endif()
+if(BUILD_DOCS)
+  add_subdirectory(build)
+  add_subdirectory(man)
+  add_subdirectory(html)
+endif()
 #message(STATUS "EXTRA_DIST: ${EXTRA_DIST}")
 
 message(STATUS "")
diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt
index 1cf1b75..4ee29f6 100644
--- a/libtiff/CMakeLists.txt
+++ b/libtiff/CMakeLists.txt
@@ -104,11 +104,11 @@ set(tiffxx_HEADERS
 set(tiffxx_SOURCES
   tif_stream.cxx)
 
-if(WIN32_IO)
-  extra_dist(tif_unix.c)
+if(USE_WIN32_FILEIO)
+  extra_dist(tif_win32.c)
   list(APPEND tiff_SOURCES tif_win32.c)
 else()
-  extra_dist(tif_win32.c)
+  extra_dist(tif_unix.c)
   list(APPEND tiff_SOURCES tif_unix.c)
 endif()
 
@@ -143,7 +143,7 @@ install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS}
         DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
 
 if(CXX_SUPPORT)
-  add_library(tiffxx ${tiffxx_SOURCES} ${tiffxx_HEADERS})
+	add_library(tiffxx STATIC ${tiffxx_SOURCES} ${tiffxx_HEADERS})
   target_link_libraries(tiffxx tiff)
   set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})
   if(NOT CYGWIN)