diff options
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ee25365..0a56ff6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -110,9 +110,14 @@ set(ZLIB_SRCS | |||
110 | trees.c | 110 | trees.c |
111 | uncompr.c | 111 | uncompr.c |
112 | zutil.c | 112 | zutil.c |
113 | win32/zlib1.rc | ||
114 | ) | 113 | ) |
115 | 114 | ||
115 | if(NOT MINGW) | ||
116 | set(ZLIB_SRCS ${ZLIB_SRCS} | ||
117 | win32/zlib1.rc # If present will override custom build rule below. | ||
118 | ) | ||
119 | endif() | ||
120 | |||
116 | # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION | 121 | # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION |
117 | file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) | 122 | file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) |
118 | string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([0-9A-Za-z.]+)\".*" | 123 | string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([0-9A-Za-z.]+)\".*" |
@@ -120,6 +125,10 @@ string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([0-9A-Za-z.]+)\".*" | |||
120 | 125 | ||
121 | if(MINGW) | 126 | if(MINGW) |
122 | # This gets us DLL resource information when compiling on MinGW. | 127 | # This gets us DLL resource information when compiling on MinGW. |
128 | if(NOT CMAKE_RC_COMPILER) | ||
129 | SET(CMAKE_RC_COMPILER windres.exe) | ||
130 | endif() | ||
131 | |||
123 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj | 132 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj |
124 | COMMAND ${CMAKE_RC_COMPILER} | 133 | COMMAND ${CMAKE_RC_COMPILER} |
125 | -D GCC_WINDRES | 134 | -D GCC_WINDRES |