diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-01-16 17:39:54 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-01-16 18:51:23 -0800 |
commit | 509c1d2860c82ceeae8a3e3a32ef21edc3afa447 (patch) | |
tree | 414f391800c19010fb27993bf42c3740a37c8428 | |
parent | 2d55657c0341238eb9d6fd8d545bcd7efade5ed8 (diff) | |
download | zlib-509c1d2860c82ceeae8a3e3a32ef21edc3afa447.tar.gz |
Fix CMakeLists.txt for cross compilation [McClure].
-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 trees.c uncompr.c zutil.c - win32/zlib1.rc ) +if(NOT MINGW) + set(ZLIB_SRCS ${ZLIB_SRCS} + win32/zlib1.rc # If present will override custom build rule below. + ) +endif() + # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) 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.]+)\".*" if(MINGW) # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + SET(CMAKE_RC_COMPILER windres.exe) + endif() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj COMMAND ${CMAKE_RC_COMPILER} -D GCC_WINDRES |