From: Thomas Roß Date: Wed, 6 Jun 2012 23:23:32 +0000 (+0200) Subject: Fix CMake compilation of static lib for MSVC2010 x64. X-Git-Tag: v1.2.7.1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=486ef7b4b40c20df72a34820aabc2f235c986a41;p=thirdparty%2Fzlib-ng.git Fix CMake compilation of static lib for MSVC2010 x64. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ee3bc41b..cbb3d4c57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,7 @@ set(ZLIB_SRCS ) if(NOT MINGW) - set(ZLIB_SRCS ${ZLIB_SRCS} + set(ZLIB_DLL_SRCS win32/zlib1.rc # If present will override custom build rule below. ) endif() @@ -134,7 +134,7 @@ 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) + set(CMAKE_RC_COMPILER windres.exe) endif() add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj @@ -144,10 +144,10 @@ if(MINGW) -I ${CMAKE_CURRENT_BINARY_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) - set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) endif(MINGW) -add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) set_target_properties(zlib PROPERTIES SOVERSION 1)