diff --git a/CMakeLists.txt b/CMakeLists.txt index c5eb028..1214a0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,6 +340,20 @@ endif() #set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +# zlib +if(GMIO_USE_BUNDLED_ZLIB) + message(STATUS "Bundled version of zlib") + set(ZLIB_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/zlib + ${CMAKE_CURRENT_BINARY_DIR}/src/3rdparty/zlib) + set(ZLIB_LIBRARIES zlibstatic) +else() + find_package(ZLIB) + if (NOT(ZLIB_VERSION_MAJOR EQUAL 1) AND NOT(ZLIB_VERSION_MINOR EQUAL 2)) + message(FATAL_ERROR "Incompatible zlib version ${ZLIB_VERSION_STRING} (gmio expects v1.2.x)") + endif() +endif() + # Sub-directories add_subdirectory(src) add_subdirectory(tests) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a32af31..4b249d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -100,20 +100,10 @@ endif() # zlib if(GMIO_USE_BUNDLED_ZLIB) - message(STATUS "Building bundled verison of zlib") add_subdirectory(3rdparty/zlib) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zlib - ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/zlib) - target_link_libraries(gmio zlibstatic) -else() - find_package(ZLIB) - if (NOT(ZLIB_VERSION_MAJOR EQUAL 1) AND NOT(ZLIB_VERSION_MINOR EQUAL 2)) - message(FATAL_ERROR "Incompatible zlib version ${ZLIB_VERSION_STRING} (gmio expects v1.2.x)") - endif() - include_directories(${ZLIB_INCLUDE_DIRS}) - target_link_libraries(gmio ${ZLIB_LIBRARIES}) endif() +include_directories(${ZLIB_INCLUDE_DIRS}) +target_link_libraries(gmio ${ZLIB_LIBRARIES}) # Installs for target install(TARGETS gmio diff --git a/src/gmio_core/error.h b/src/gmio_core/error.h index 51383cb..f9ca6f5 100644 --- a/src/gmio_core/error.h +++ b/src/gmio_core/error.h @@ -76,7 +76,7 @@ enum gmio_error /* zlib */ /*! See \c Z_ERRNO (file operation error) */ - GMIO_ERROR_ZLIB_FILE_OPERATION = GMIO_ZLIB_ERROR_TAG + 0x01, + GMIO_ERROR_ZLIB_ERRNO = GMIO_ZLIB_ERROR_TAG + 0x01, /*! See \c Z_STREAM_ERROR */ GMIO_ERROR_ZLIB_STREAM,