summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 12 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b129ef2..7eefa49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,17 +66,19 @@ if(MSVC)
66endif() 66endif()
67 67
68if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) 68if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
69 # If we're doing an out of source build and the user has a zconf.h 69 # If we're doing an out of source build and the user has a zconf.h
70 # in their source tree... 70 # in their source tree...
71 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h) 71 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
72 message(FATAL_ERROR "You must remove zconf.h from the source tree. This f 72 message(FATAL_ERROR
73ile is generated by the ./configure script shipped with zlib. CMake generates t 73 "You must remove ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h "
74his file for you automatically in the build directory") 74 "from the source tree. This file is included with zlib "
75 "but CMake generates this file for you automatically "
76 "in the build directory.")
75 endif() 77 endif()
76endif() 78endif()
77 79
78configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.in 80configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
79 ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h @ONLY) 81 ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
80include_directories(${CMAKE_CURRENT_BINARY_DIR}) 82include_directories(${CMAKE_CURRENT_BINARY_DIR})
81 83
82 84
@@ -85,7 +87,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
85#============================================================================ 87#============================================================================
86 88
87set(ZLIB_PUBLIC_HDRS 89set(ZLIB_PUBLIC_HDRS
88 zconf.h 90 ${CMAKE_CURRENT_BINARY_DIR}/zconf.h
89 zlib.h 91 zlib.h
90) 92)
91set(ZLIB_PRIVATE_HDRS 93set(ZLIB_PRIVATE_HDRS
@@ -129,6 +131,7 @@ if(MINGW)
129 COMMAND windres.exe 131 COMMAND windres.exe
130 -D GCC_WINDRES 132 -D GCC_WINDRES
131 -I ${CMAKE_CURRENT_SOURCE_DIR} 133 -I ${CMAKE_CURRENT_SOURCE_DIR}
134 -I ${CMAKE_CURRENT_BINARY_DIR}
132 -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj 135 -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
133 -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) 136 -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
134 set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) 137 set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)