diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index f69bee3d..a6d0ea5e 100755 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -70,6 +70,8 @@ set(PROJECT_INCLUDE_DIR ${PROJECT_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/third_party/lz4 ${PROJECT_SOURCE_DIR}/third_party/lzokay + ${PROJECT_SOURCE_DIR}/third_party/zlib-1.2.13 + ${PROJECT_BINARY_DIR}/third_party/zlib-1.2.13 ) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index 847f41d8..ecacad70 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -32,14 +32,12 @@ add_subdirectory(reader) add_subdirectory(utils) add_subdirectory(writer) -set(SNAPPY_LIB_NAME "snappy") -set(LZ4_LIB_NAME "LZ4") -set(LZO_LIB_NAME "lzokay") +set(COMPRESSION_LIBS snappy LZ4 lzokay zlibstatic) target_link_libraries(parser_obj antlr4_static) -target_link_libraries(compress_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic ) -target_link_libraries(common_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic ) -target_link_libraries(read_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic ) -target_link_libraries(write_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic ) +target_link_libraries(compress_obj ${COMPRESSION_LIBS}) +target_link_libraries(common_obj ${COMPRESSION_LIBS}) +target_link_libraries(read_obj ${COMPRESSION_LIBS}) +target_link_libraries(write_obj ${COMPRESSION_LIBS}) add_library(tsfile SHARED) if (${COV_ENABLED}) diff --git a/cpp/third_party/zlib-1.2.13/CMakeLists.txt b/cpp/third_party/zlib-1.2.13/CMakeLists.txt index 23813dd4..51631c8e 100644 --- a/cpp/third_party/zlib-1.2.13/CMakeLists.txt +++ b/cpp/third_party/zlib-1.2.13/CMakeLists.txt @@ -80,8 +80,8 @@ set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein - ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) -include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/third_party/zlib-1.2.13) #============================================================================ @@ -189,26 +189,4 @@ if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") -endif() - -#============================================================================ -# Example binaries -#============================================================================ - -add_executable(example test/example.c) -target_link_libraries(example zlib) -add_test(example example) - -add_executable(minigzip test/minigzip.c) -target_link_libraries(minigzip zlib) - -if(HAVE_OFF64_T) - add_executable(example64 test/example.c) - target_link_libraries(example64 zlib) - set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") - add_test(example64 example64) - - add_executable(minigzip64 test/minigzip.c) - target_link_libraries(minigzip64 zlib) - set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") -endif() +endif() \ No newline at end of file