rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ding...@apache.org
Subject [rocketmq-client-cpp] branch master updated: fix(format): format code style for cmakelist (#217)
Date Mon, 06 Jan 2020 15:17:06 GMT
This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 7fb9f0d  fix(format): format code style for cmakelist (#217)
7fb9f0d is described below

commit 7fb9f0d181110de15a83b03371465875c6c46008
Author: dinglei <libya_003@163.com>
AuthorDate: Mon Jan 6 23:16:55 2020 +0800

    fix(format): format code style for cmakelist (#217)
    
    fix(format): format code style for cmakelist
---
 .travis.yml                   |   2 +-
 CMakeLists.txt                | 264 ++++++++--------
 build.sh                      | 689 ++++++++++++++++++++----------------------
 libs/signature/CMakeLists.txt |   4 +-
 project/CMakeLists.txt        |  60 ++--
 test/CMakeLists.txt           |  58 ++--
 6 files changed, 521 insertions(+), 556 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 235cca4..237b2a4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,7 +26,7 @@ before_script:
   - ./bin/mqadmin updateSubGroup -b '127.0.0.1:10911' –n '127.0.0.1:9876' -g testGroup
   - cd ..
 
-script: 
+script:
   - ./build.sh test codecov noVerbose
 
 after_success:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 235feb3..c70b7e7 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ endif (APPLE)
 # CMake complains if we don't have this.
 if (COMMAND cmake_policy)
     cmake_policy(SET CMP0003 NEW)
-endif()
+endif ()
 
 # We're escaping quotes in the Windows version number, because
 # for some reason CMake won't do it at config version 2.4.7
@@ -30,13 +30,13 @@ endif()
 # args are not auto-escaped.
 if (COMMAND cmake_policy)
     cmake_policy(SET CMP0005 NEW)
-endif()
+endif ()
 
 # First, declare project (important for prerequisite checks).
 project(rocketmq-client-cpp)
-if(NOT CMAKE_BUILD_TYPE)
+if (NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE "Release")
-endif()
+endif ()
 set(CMAKE_CONFIGURATION_TYPES "Release")
 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
@@ -45,63 +45,63 @@ option(BUILD_ROCKETMQ_STATIC "build rocketmq-client static library" ON)
 option(BUILD_ROCKETMQ_SHARED "build rocketmq-client shared library" ON)
 
 #Find dependency 
-option(Boost_USE_STATIC_LIBS    "only find boost static libs"     ON) # only find static
libs
-set(Boost_USE_MULTITHREADED          ON)
-set(Boost_USE_STATIC_RUNTIME         ON)
-if(WIN32)
+option(Boost_USE_STATIC_LIBS "only find boost static libs" ON) # only find static libs
+set(Boost_USE_MULTITHREADED ON)
+set(Boost_USE_STATIC_RUNTIME ON)
+if (WIN32)
     find_package(Boost 1.56 REQUIRED COMPONENTS atomic thread system chrono date_time
-        log log_setup regex serialization filesystem locale iostreams zlib)
-    if(Boost_FOUND)
+            log log_setup regex serialization filesystem locale iostreams zlib)
+    if (Boost_FOUND)
         message(STATUS "** Boost Include dir: ${Boost_INCLUDE_DIR}")
         message(STATUS "** Boost Libraries dir: ${Boost_LIBRARY_DIRS}")
         message(STATUS "** Boost Libraries: ${Boost_LIBRARIES}")
         include_directories(${Boost_INCLUDE_DIRS})
-    endif()
-else()
+    endif ()
+else ()
     #find_package(Boost 1.56 REQUIRED COMPONENTS atomic thread system chrono date_time log
log_setup regex serialization filesystem locale iostreams) 
-    set(Boost_INCLUDE_DIR    ${PROJECT_SOURCE_DIR}/bin/include)
-    set(Boost_LIBRARY_DIRS    ${PROJECT_SOURCE_DIR}/bin/lib)
-    set(Boost_LIBRARIES      ${Boost_LIBRARY_DIRS}/libboost_atomic.a;${Boost_LIBRARY_DIRS}/libboost_thread.a;${Boost_LIBRARY_DIRS}/libboost_system.a;${Boost_LIBRARY_DIRS}/libboost_chrono.a;
-        ${Boost_LIBRARY_DIRS}/libboost_date_time.a;${Boost_LIBRARY_DIRS}/libboost_log.a;${Boost_LIBRARY_DIRS}/libboost_log_setup.a;
-        ${Boost_LIBRARY_DIRS}/libboost_regex.a;${Boost_LIBRARY_DIRS}/libboost_serialization.a;${Boost_LIBRARY_DIRS}/libboost_filesystem.a;
-        ${Boost_LIBRARY_DIRS}/libboost_locale.a;${Boost_LIBRARY_DIRS}/libboost_iostreams.a)
+    set(Boost_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/bin/include)
+    set(Boost_LIBRARY_DIRS ${PROJECT_SOURCE_DIR}/bin/lib)
+    set(Boost_LIBRARIES ${Boost_LIBRARY_DIRS}/libboost_atomic.a;${Boost_LIBRARY_DIRS}/libboost_thread.a;${Boost_LIBRARY_DIRS}/libboost_system.a;${Boost_LIBRARY_DIRS}/libboost_chrono.a;
+            ${Boost_LIBRARY_DIRS}/libboost_date_time.a;${Boost_LIBRARY_DIRS}/libboost_log.a;${Boost_LIBRARY_DIRS}/libboost_log_setup.a;
+            ${Boost_LIBRARY_DIRS}/libboost_regex.a;${Boost_LIBRARY_DIRS}/libboost_serialization.a;${Boost_LIBRARY_DIRS}/libboost_filesystem.a;
+            ${Boost_LIBRARY_DIRS}/libboost_locale.a;${Boost_LIBRARY_DIRS}/libboost_iostreams.a)
     include_directories(${Boost_INCLUDE_DIRS})
-endif()
+endif ()
 
 message(STATUS "** Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}")
 message(STATUS "** Boost_LIBRARIES: ${Boost_LIBRARIES}")
 
-option(Libevent_USE_STATIC_LIBS "only find libevent static libs"   ON) # only find static
libs
-if(WIN32)
+option(Libevent_USE_STATIC_LIBS "only find libevent static libs" ON) # only find static libs
+if (WIN32)
     find_package(Libevent 2.0.22 REQUIRED COMPONENTS)
-    if(LIBEVENT_FOUND)
+    if (LIBEVENT_FOUND)
         include_directories(${LIBEVENT_INCLUDE_DIRS})
         message(STATUS "** libevent Include dir: ${LIBEVENT_INCLUDE_DIR}")
         message(STATUS "** libevent Libraries: ${LIBEVENT_LIBRARIES}")
-    endif()
-else()
+    endif ()
+else ()
     #find_package(Libevent 2.0.22 REQUIRED COMPONENTS)
-    set(LIBEVENT_INCLUDE_DIRS  ${PROJECT_SOURCE_DIR}/bin/include)
+    set(LIBEVENT_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/bin/include)
     set(LIBEVENT_LIBRARIES_DIR ${PROJECT_SOURCE_DIR}/bin/lib)
-    set(LIBEVENT_LIBRARIES     ${LIBEVENT_LIBRARIES_DIR}/libevent.a;${LIBEVENT_LIBRARIES_DIR}/libevent_core.a;${LIBEVENT_LIBRARIES_DIR}/libevent_extra.a;${LIBEVENT_LIBRARIES_DIR}/libevent_pthreads.a)
+    set(LIBEVENT_LIBRARIES ${LIBEVENT_LIBRARIES_DIR}/libevent.a;${LIBEVENT_LIBRARIES_DIR}/libevent_core.a;${LIBEVENT_LIBRARIES_DIR}/libevent_extra.a;${LIBEVENT_LIBRARIES_DIR}/libevent_pthreads.a)
     include_directories(${LIBEVENT_INCLUDE_DIRS})
-endif()
+endif ()
 
 message(STATUS "** LIBEVENT_INCLUDE_DIR: ${LIBEVENT_INCLUDE_DIR}")
 message(STATUS "** LIBEVENT_LIBRARIES: ${LIBEVENT_LIBRARIES}")
 
-option(JSONCPP_USE_STATIC_LIBS  "only find jsoncpp static libs"  ON) # only find static libs
-if(WIN32)
+option(JSONCPP_USE_STATIC_LIBS "only find jsoncpp static libs" ON) # only find static libs
+if (WIN32)
     find_package(Jsoncpp 0.10.6)
-    if(JSONCPP_FOUND)
+    if (JSONCPP_FOUND)
         include_directories(${JSONCPP_INCLUDE_DIRS})
-    endif()
-else()
-    set(JSONCPP_INCLUDE_DIRS   ${PROJECT_SOURCE_DIR}/bin/include/jsoncpp)
-    set(JSONCPP_LIBRARIES_DIR  ${PROJECT_SOURCE_DIR}/bin/lib)
-    set(JSONCPP_LIBRARIES      ${JSONCPP_LIBRARIES_DIR}/libjsoncpp.a)
+    endif ()
+else ()
+    set(JSONCPP_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/bin/include/jsoncpp)
+    set(JSONCPP_LIBRARIES_DIR ${PROJECT_SOURCE_DIR}/bin/lib)
+    set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARIES_DIR}/libjsoncpp.a)
     include_directories(${JSONCPP_INCLUDE_DIRS})
-endif()
+endif ()
 
 message(STATUS "** JSONCPP_INCLUDE_DIRS: ${JSONCPP_INCLUDE_DIRS}")
 message(STATUS "** JSONCPP_LIBRARIES: ${JSONCPP_LIBRARIES}")
@@ -120,98 +120,98 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
 # endif()
 
 IF (WIN32)
-  add_definitions(-DWIN32 -DROCKETMQCLIENT_EXPORTS)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
-  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
-  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
-ELSE()
-set(C_FLAGS
-  #-g
-  -Wall
-  -Wno-deprecated
-  -fPIC
-  -fno-strict-aliasing 
-)
-set(CXX_FLAGS
- #-g
- -Wall
- -Wno-deprecated
- -fPIC
- -fno-strict-aliasing
- -std=c++11
- -Wno-unused-local-typedef
- -Wno-expansion-to-defined
- # -finline-limit=1000
- # -Wextra
- # -pedantic
- # -pedantic-errors
- # -D_FILE_OFFSET_BITS=64
- # -DVALGRIND
- # -DCHECK_PTHREAD_RETURN_VALUE
- # -Werror
- # -Wconversion
- # -Wno-unused-parameter
- # -Wunused-but-set-variable
- # -Wold-style-cast
- # -Woverloaded-virtual
- # -Wpointer-arith
- # -Wshadow
- # -Wwrite-strings
- # -Wdeprecated-declarations
- # -march=native
- # -MMD
- # -std=c++0x
- # -rdynamic
- )
-
-if(CMAKE_BUILD_BITS EQUAL 32)
-  list(APPEND CXX_FLAGS "-m32")
-else() #not-condition
-  list(APPEND CXX_FLAGS "-m64")
-endif()
-
-string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
-string(REPLACE ";" " " CMAKE_C_FLAGS "${C_FLAGS}")
-
-set(CMAKE_CXX_FLAGS_DEBUG   "-O0 -DDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
-
-
-# Declare deplibs, so we can use list in linker later. There's probably
-# a more elegant way of doing this; with SCons, when you check for the
-# lib, it is automatically passed to the linker.
-set(deplibs)
-
-# For some reason, the check_function_exists macro doesn't detect
-# the inet_aton on some pure Unix platforms (e.g. sunos5). So we
-# need to do a more detailed check and also include some extra deplibs.
-list(APPEND deplibs dl)
-list(APPEND deplibs pthread)
-if(NOT APPLE)
-  list(APPEND deplibs rt)
-endif()
-list(APPEND deplibs z)
-# Code Coverage Configuration
-add_library(coverage_config INTERFACE)
-
-option(CODE_COVERAGE "Enable coverage reporting" OFF)
-if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
-    # Add required flags (GCC & LLVM/Clang)
-    target_compile_options(coverage_config INTERFACE
-            -O0        # no optimization
-            -g         # generate debug info
-            --coverage # sets all required flags
+    add_definitions(-DWIN32 -DROCKETMQCLIENT_EXPORTS)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+ELSE ()
+    set(C_FLAGS
+            #-g
+            -Wall
+            -Wno-deprecated
+            -fPIC
+            -fno-strict-aliasing
             )
-    if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
-        target_link_options(coverage_config INTERFACE --coverage)
-    else()
-        target_link_libraries(coverage_config INTERFACE --coverage)
-    endif()
-    list(APPEND deplibs coverage_config)
-endif(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
-# add include dir for bsd (posix uses /usr/include/)
-set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
-ENDIF()
+    set(CXX_FLAGS
+            #-g
+            -Wall
+            -Wno-deprecated
+            -fPIC
+            -fno-strict-aliasing
+            -std=c++11
+            -Wno-unused-local-typedef
+            -Wno-expansion-to-defined
+            # -finline-limit=1000
+            # -Wextra
+            # -pedantic
+            # -pedantic-errors
+            # -D_FILE_OFFSET_BITS=64
+            # -DVALGRIND
+            # -DCHECK_PTHREAD_RETURN_VALUE
+            # -Werror
+            # -Wconversion
+            # -Wno-unused-parameter
+            # -Wunused-but-set-variable
+            # -Wold-style-cast
+            # -Woverloaded-virtual
+            # -Wpointer-arith
+            # -Wshadow
+            # -Wwrite-strings
+            # -Wdeprecated-declarations
+            # -march=native
+            # -MMD
+            # -std=c++0x
+            # -rdynamic
+            )
+
+    if (CMAKE_BUILD_BITS EQUAL 32)
+        list(APPEND CXX_FLAGS "-m32")
+    else () #not-condition
+        list(APPEND CXX_FLAGS "-m64")
+    endif ()
+
+    string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
+    string(REPLACE ";" " " CMAKE_C_FLAGS "${C_FLAGS}")
+
+    set(CMAKE_CXX_FLAGS_DEBUG "-O0 -DDEBUG")
+    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
+
+
+    # Declare deplibs, so we can use list in linker later. There's probably
+    # a more elegant way of doing this; with SCons, when you check for the
+    # lib, it is automatically passed to the linker.
+    set(deplibs)
+
+    # For some reason, the check_function_exists macro doesn't detect
+    # the inet_aton on some pure Unix platforms (e.g. sunos5). So we
+    # need to do a more detailed check and also include some extra deplibs.
+    list(APPEND deplibs dl)
+    list(APPEND deplibs pthread)
+    if (NOT APPLE)
+        list(APPEND deplibs rt)
+    endif ()
+    list(APPEND deplibs z)
+    # Code Coverage Configuration
+    add_library(coverage_config INTERFACE)
+
+    option(CODE_COVERAGE "Enable coverage reporting" OFF)
+    if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+        # Add required flags (GCC & LLVM/Clang)
+        target_compile_options(coverage_config INTERFACE
+                -O0        # no optimization
+                -g         # generate debug info
+                --coverage # sets all required flags
+                )
+        if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
+            target_link_options(coverage_config INTERFACE --coverage)
+        else ()
+            target_link_libraries(coverage_config INTERFACE --coverage)
+        endif ()
+        list(APPEND deplibs coverage_config)
+    endif (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+    # add include dir for bsd (posix uses /usr/include/)
+    set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
+ENDIF ()
 
 # For config.h, set some static values; it may be a good idea to make
 # these values dynamic for non-standard UNIX compilers.
@@ -241,9 +241,9 @@ add_subdirectory(example)
 
 option(RUN_UNIT_TEST "RUN_UNIT_TEST" OFF)
 
-if(RUN_UNIT_TEST)
-  message(STATUS "** RUN_UNIT_TEST: ${RUN_UNIT_TEST} Do execution testing")
-  enable_testing()
-  add_subdirectory(test)
-endif()
+if (RUN_UNIT_TEST)
+    message(STATUS "** RUN_UNIT_TEST: ${RUN_UNIT_TEST} Do execution testing")
+    enable_testing()
+    add_subdirectory(test)
+endif ()
 
diff --git a/build.sh b/build.sh
index 03e8f1c..ca1bc25 100755
--- a/build.sh
+++ b/build.sh
@@ -15,7 +15,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-basepath=$(cd `dirname $0`; pwd)
+basepath=$(
+  cd $(dirname $0)
+  pwd
+)
 down_dir="${basepath}/tmp_down_dir"
 build_dir="${basepath}/tmp_build_dir"
 packet_dir="${basepath}/tmp_packet_dir"
@@ -27,13 +30,12 @@ fname_libevent_down="release-2.0.22-stable.zip"
 fname_jsoncpp_down="0.10.6.zip"
 fname_boost_down="1.58.0/boost_1_58_0.tar.gz"
 
-PrintParams()
-{
-    echo "=========================================one key build help============================================"
-    echo "sh build.sh [no build libevent:noEvent] [no build json:noJson] [no build boost:noBoost]
[ execution test:test]"
-    echo "usage: sh build.sh noJson noEvent noBoost test"
-    echo "=========================================one key build help============================================"
-    echo ""
+PrintParams() {
+  echo "=========================================one key build help============================================"
+  echo "sh build.sh [no build libevent:noEvent] [no build json:noJson] [no build boost:noBoost]
[ execution test:test]"
+  echo "usage: sh build.sh noJson noEvent noBoost test"
+  echo "=========================================one key build help============================================"
+  echo ""
 }
 
 need_build_jsoncpp=1
@@ -44,381 +46,344 @@ verbose=1
 codecov=0
 cpu_num=4
 
-pasres_arguments(){
-    for var in "$@"
-    do
-        case "$var" in
-                noJson)
-                        need_build_jsoncpp=0
-                        ;;
-                noEvent)
-                        need_build_libevent=0
-                        ;;
-                noBoost)
-                        need_build_boost=0
-                        ;;
-                noVerbose)
-                        verbose=0
-                        ;;
-                codecov)
-                        codecov=1
-                        ;;
-                test)
-                       test=1
-        esac
-    done
+pasres_arguments() {
+  for var in "$@"; do
+    case "$var" in
+    noJson)
+      need_build_jsoncpp=0
+      ;;
+    noEvent)
+      need_build_libevent=0
+      ;;
+    noBoost)
+      need_build_boost=0
+      ;;
+    noVerbose)
+      verbose=0
+      ;;
+    codecov)
+      codecov=1
+      ;;
+    test)
+      test=1
+      ;;
+    esac
+  done
 
 }
 pasres_arguments $@
 
-PrintParams()
-{
-    echo "###########################################################################"
-    if [ $need_build_libevent -eq 0 ]
-    then
-        echo "no need build libevent lib"
-    else
-        echo "need build libevent lib"
-    fi
-
-    if [ $need_build_jsoncpp -eq 0 ]
-    then
-        echo "no need build jsoncpp lib"
-    else
-        echo "need build jsoncpp lib"
-    fi
-
-    if [ $need_build_boost -eq 0 ]
-    then
-        echo "no need build boost lib"
-    else
-        echo "need build boost lib"
-    fi
-    if [ $test -eq 1 ]
-    then
-        echo "build unit tests"
-    else
-        echo "without build unit tests"
-    fi
-    if [ $codecov -eq 1 ]
-    then
-        echo "run unit tests with code coverage"
-    fi
-    if [ $verbose -eq 0 ]
-    then
-        echo "no need print detail logs"
-    else
-        echo "need print detail logs"
-    fi
-
-    echo "###########################################################################"
-    echo ""
+PrintParams() {
+  echo "###########################################################################"
+  if [ $need_build_libevent -eq 0 ]; then
+    echo "no need build libevent lib"
+  else
+    echo "need build libevent lib"
+  fi
+
+  if [ $need_build_jsoncpp -eq 0 ]; then
+    echo "no need build jsoncpp lib"
+  else
+    echo "need build jsoncpp lib"
+  fi
+
+  if [ $need_build_boost -eq 0 ]; then
+    echo "no need build boost lib"
+  else
+    echo "need build boost lib"
+  fi
+  if [ $test -eq 1 ]; then
+    echo "build unit tests"
+  else
+    echo "without build unit tests"
+  fi
+  if [ $codecov -eq 1 ]; then
+    echo "run unit tests with code coverage"
+  fi
+  if [ $verbose -eq 0 ]; then
+    echo "no need print detail logs"
+  else
+    echo "need print detail logs"
+  fi
+
+  echo "###########################################################################"
+  echo ""
 }
 
-Prepare()
-{
-    if [ -e ${down_dir} ]
-    then
-        echo "${down_dir} is exist"
-        #cd ${down_dir}
-        #ls |grep -v ${fname_libevent} |grep -v ${fname_jsoncpp} | grep -v ${fname_boost}
|xargs rm -rf
-    else
-        mkdir -p ${down_dir}
-    fi
-
-    cd ${basepath}
-    if [ -e ${fname_libevent} ]
-    then
-        mv -f ${basepath}/${fname_libevent} ${down_dir}
-    fi
-
-    if [ -e ${fname_jsoncpp} ]
-    then
-        mv -f ${basepath}/${fname_jsoncpp} ${down_dir}
-    fi
-
-    if [ -e ${fname_boost} ]
-    then
-        mv -f ${basepath}/${fname_boost} ${down_dir}
-    fi
-
-    if [ -e ${build_dir} ]
-    then
-        echo "${build_dir} is exist"
-        #rm -rf ${build_dir}/*
-    else
-        mkdir -p ${build_dir}
-    fi
-
-    if [ -e ${packet_dir} ]
-    then
-        echo "${packet_dir} is exist"
-        #rm -rf ${packet_dir}/*
-    else
-        mkdir -p ${packet_dir}
-    fi
-
-    if [ -e ${install_lib_dir} ]
-    then
-        echo "${install_lib_dir} is exist"
-    else
-        mkdir -p ${install_lib_dir}
-    fi
+Prepare() {
+  if [ -e ${down_dir} ]; then
+    echo "${down_dir} is exist"
+    #cd ${down_dir}
+    #ls |grep -v ${fname_libevent} |grep -v ${fname_jsoncpp} | grep -v ${fname_boost} |xargs
rm -rf
+  else
+    mkdir -p ${down_dir}
+  fi
+
+  cd ${basepath}
+  if [ -e ${fname_libevent} ]; then
+    mv -f ${basepath}/${fname_libevent} ${down_dir}
+  fi
+
+  if [ -e ${fname_jsoncpp} ]; then
+    mv -f ${basepath}/${fname_jsoncpp} ${down_dir}
+  fi
+
+  if [ -e ${fname_boost} ]; then
+    mv -f ${basepath}/${fname_boost} ${down_dir}
+  fi
+
+  if [ -e ${build_dir} ]; then
+    echo "${build_dir} is exist"
+    #rm -rf ${build_dir}/*
+  else
+    mkdir -p ${build_dir}
+  fi
+
+  if [ -e ${packet_dir} ]; then
+    echo "${packet_dir} is exist"
+    #rm -rf ${packet_dir}/*
+  else
+    mkdir -p ${packet_dir}
+  fi
+
+  if [ -e ${install_lib_dir} ]; then
+    echo "${install_lib_dir} is exist"
+  else
+    mkdir -p ${install_lib_dir}
+  fi
 }
 
-BuildLibevent()
-{
-    if [ $need_build_libevent -eq 0 ]
-    then
-        echo "no need build libevent lib"
-        return 0
-    fi
-
-    cd ${down_dir}
-    if [ -e ${fname_libevent} ]
-    then
-        echo "${fname_libevent} is exist"
-    else
-        wget https://github.com/libevent/libevent/archive/${fname_libevent_down} -O libevent-${fname_libevent_down}
-    fi
-    unzip -o ${fname_libevent} > unziplibevent.txt 2>&1
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-
-    libevent_dir=`ls | grep libevent | grep .*[^zip]$`
-    cd ${libevent_dir}
-    if [ $? -ne 0 ];then
-        exit 1
-    fi    
-    ./autogen.sh
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    echo "build libevent static #####################"
-    if [ $verbose -eq 0 ];
-    then
-        ./configure --disable-openssl --enable-static=yes --enable-shared=no CFLAGS=-fPIC
CPPFLAGS=-fPIC --prefix=${install_lib_dir} > libeventconfig.txt 2>&1
-    else
-        ./configure --disable-openssl --enable-static=yes --enable-shared=no CFLAGS=-fPIC
CPPFLAGS=-fPIC --prefix=${install_lib_dir}
-    fi
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    if [ $verbose -eq 0 ];
-    then
-        echo "build libevent without detail log."
-        make -j $cpu_num > libeventbuild.txt 2>&1
-    else
-        make -j $cpu_num
-    fi
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    make install
-    echo "build linevent success."
+BuildLibevent() {
+  if [ $need_build_libevent -eq 0 ]; then
+    echo "no need build libevent lib"
+    return 0
+  fi
+
+  cd ${down_dir}
+  if [ -e ${fname_libevent} ]; then
+    echo "${fname_libevent} is exist"
+  else
+    wget https://github.com/libevent/libevent/archive/${fname_libevent_down} -O libevent-${fname_libevent_down}
+  fi
+  unzip -o ${fname_libevent} >unziplibevent.txt 2>&1
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+
+  libevent_dir=$(ls | grep libevent | grep .*[^zip]$)
+  cd ${libevent_dir}
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  ./autogen.sh
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  echo "build libevent static #####################"
+  if [ $verbose -eq 0 ]; then
+    ./configure --disable-openssl --enable-static=yes --enable-shared=no CFLAGS=-fPIC CPPFLAGS=-fPIC
--prefix=${install_lib_dir} >libeventconfig.txt 2>&1
+  else
+    ./configure --disable-openssl --enable-static=yes --enable-shared=no CFLAGS=-fPIC CPPFLAGS=-fPIC
--prefix=${install_lib_dir}
+  fi
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  if [ $verbose -eq 0 ]; then
+    echo "build libevent without detail log."
+    make -j $cpu_num >libeventbuild.txt 2>&1
+  else
+    make -j $cpu_num
+  fi
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  make install
+  echo "build linevent success."
 }
 
-
-BuildJsonCPP()
-{
-    if [ $need_build_jsoncpp -eq 0 ];then
-        echo "no need build jsoncpp lib"
-        return 0
-    fi
-
-    cd ${down_dir}
-
-    if [ -e ${fname_jsoncpp} ]
-    then
-        echo "${fname_jsoncpp} is exist"
-    else
-        wget https://github.com/open-source-parsers/jsoncpp/archive/${fname_jsoncpp_down}
-O jsoncpp-${fname_jsoncpp_down}
-    fi
-    unzip -o ${fname_jsoncpp} > unzipjsoncpp.txt 2>&1
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    jsoncpp_dir=`ls | grep ^jsoncpp | grep .*[^zip]$`
-    cd ${jsoncpp_dir}
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    mkdir build; cd build
-    echo "build jsoncpp static ######################"
-    if [ $verbose -eq 0 ];
-    then
-        echo "build jsoncpp without detail log."
-        cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
> jsoncppbuild.txt 2>&1
-    else
-        cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
-    fi
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    if [ $verbose -eq 0 ];
-    then
-         make -j $cpu_num > jsoncppbuild.txt 2>&1
-    else
-        make -j $cpu_num
-    fi
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    make install
-    echo "build jsoncpp success."
-    if [ ! -f ${install_lib_dir}/lib/libjsoncpp.a ]
-    then
-        echo " ./bin/lib directory is not libjsoncpp.a"
-        cp ${install_lib_dir}/lib/x86_64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/
-    fi
+BuildJsonCPP() {
+  if [ $need_build_jsoncpp -eq 0 ]; then
+    echo "no need build jsoncpp lib"
+    return 0
+  fi
+
+  cd ${down_dir}
+
+  if [ -e ${fname_jsoncpp} ]; then
+    echo "${fname_jsoncpp} is exist"
+  else
+    wget https://github.com/open-source-parsers/jsoncpp/archive/${fname_jsoncpp_down} -O
jsoncpp-${fname_jsoncpp_down}
+  fi
+  unzip -o ${fname_jsoncpp} >unzipjsoncpp.txt 2>&1
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  jsoncpp_dir=$(ls | grep ^jsoncpp | grep .*[^zip]$)
+  cd ${jsoncpp_dir}
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  mkdir build
+  cd build
+  echo "build jsoncpp static ######################"
+  if [ $verbose -eq 0 ]; then
+    echo "build jsoncpp without detail log."
+    cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
>jsoncppbuild.txt 2>&1
+  else
+    cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
+  fi
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  if [ $verbose -eq 0 ]; then
+    make -j $cpu_num >jsoncppbuild.txt 2>&1
+  else
+    make -j $cpu_num
+  fi
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  make install
+  echo "build jsoncpp success."
+  if [ ! -f ${install_lib_dir}/lib/libjsoncpp.a ]; then
+    echo " ./bin/lib directory is not libjsoncpp.a"
+    cp ${install_lib_dir}/lib/x86_64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/
+  fi
 }
 
-BuildBoost()
-{
-    if [ $need_build_boost -eq 0 ];then
-        echo "no need build boost lib"
-        return 0
-    fi
-
-    cd ${down_dir}
-    if [ -e ${fname_boost} ]
-    then
-        echo "${fname_boost} is exist"
-    else
-        wget http://sourceforge.net/projects/boost/files/boost/${fname_boost_down}
-    fi
-    tar -zxvf ${fname_boost} > unzipboost.txt 2>&1
-    boost_dir=`ls | grep boost | grep .*[^gz]$`
-    cd ${boost_dir}
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    ./bootstrap.sh
-    if [ $? -ne 0 ];then
-        exit 1
-    fi    
-    echo "build boost static #####################"
-    pwd
-    if [ $verbose -eq 0 ];
-    then
-        echo "build boost without detail log."
-        ./b2 -j$cpu_num cflags=-fPIC cxxflags=-fPIC   --with-atomic --with-thread --with-system
--with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem
--with-locale --with-iostreams threading=multi link=static  release install --prefix=${install_lib_dir}
> boostbuild.txt 2>&1
-    else
-        ./b2 -j$cpu_num cflags=-fPIC cxxflags=-fPIC   --with-atomic --with-thread --with-system
--with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem
--with-locale --with-iostreams threading=multi link=static  release install --prefix=${install_lib_dir}
-    fi
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
+BuildBoost() {
+  if [ $need_build_boost -eq 0 ]; then
+    echo "no need build boost lib"
+    return 0
+  fi
+
+  cd ${down_dir}
+  if [ -e ${fname_boost} ]; then
+    echo "${fname_boost} is exist"
+  else
+    wget http://sourceforge.net/projects/boost/files/boost/${fname_boost_down}
+  fi
+  tar -zxvf ${fname_boost} >unzipboost.txt 2>&1
+  boost_dir=$(ls | grep boost | grep .*[^gz]$)
+  cd ${boost_dir}
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  ./bootstrap.sh
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  echo "build boost static #####################"
+  pwd
+  if [ $verbose -eq 0 ]; then
+    echo "build boost without detail log."
+    ./b2 -j$cpu_num cflags=-fPIC cxxflags=-fPIC --with-atomic --with-thread --with-system
--with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem
--with-locale --with-iostreams threading=multi link=static release install --prefix=${install_lib_dir}
>boostbuild.txt 2>&1
+  else
+    ./b2 -j$cpu_num cflags=-fPIC cxxflags=-fPIC --with-atomic --with-thread --with-system
--with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem
--with-locale --with-iostreams threading=multi link=static release install --prefix=${install_lib_dir}
+  fi
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
 }
 
-BuildRocketMQClient()
-{
-    cd ${build_dir}
-    echo "============start to build rocketmq client cpp.========="
-    if [ $test -eq 0 ];then
-        cmake ..
-    else
-        if [ $codecov -eq 1 ];then
-          cmake .. -DRUN_UNIT_TEST=ON -DCODE_COVERAGE=ON
-        else
-          cmake .. -DRUN_UNIT_TEST=ON
-        fi
-    fi
-    if [ $verbose -eq 0 ];
-    then
-        echo "build rocketmq without detail log."
-        make -j $cpu_num > buildclient.txt 2>&1
+BuildRocketMQClient() {
+  cd ${build_dir}
+  echo "============start to build rocketmq client cpp.========="
+  if [ $test -eq 0 ]; then
+    cmake ..
+  else
+    if [ $codecov -eq 1 ]; then
+      cmake .. -DRUN_UNIT_TEST=ON -DCODE_COVERAGE=ON
     else
-        make -j $cpu_num
-    fi
-    if [ $? -ne 0 ];then
-        echo "build error....."
-        exit 1
-    fi        
-    #sudo make install
-    PackageRocketMQStatic
+      cmake .. -DRUN_UNIT_TEST=ON
+    fi
+  fi
+  if [ $verbose -eq 0 ]; then
+    echo "build rocketmq without detail log."
+    make -j $cpu_num >buildclient.txt 2>&1
+  else
+    make -j $cpu_num
+  fi
+  if [ $? -ne 0 ]; then
+    echo "build error....."
+    exit 1
+  fi
+  #sudo make install
+  PackageRocketMQStatic
 }
 
-BuildGoogleTest()
-{
-    if [ $test -eq 0 ];then
-        echo "no need build google test lib"
-        return 0
-    fi
-
-    if [ -f ./bin/lib/libgtest.a ]
-    then
-        echo "libgteest already exist no need build test"
-        return 0
-    fi
-
-    cd ${down_dir}
-    if [ -e release-1.8.1.tar.gz ]
-    then
-        echo "${fname_boost} is exist"
-    else
-        wget https://github.com/abseil/googletest/archive/release-1.8.1.tar.gz
-    fi
-    if [ ! -d "googletest-release-1.8.1" ];then
-        tar -zxvf release-1.8.1.tar.gz > googletest.txt 2>&1
-    fi
-    cd googletest-release-1.8.1
-    mkdir build; cd build
-    echo "build googletest static #####################"
-    if [ $verbose -eq 0 ];
-    then
-        echo "build googletest without detail log."
-        cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
> googletestbuild.txt 2>&1
-    else
-        cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
-    fi
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    if [ $verbose -eq 0 ];
-    then
-        make -j $cpu_num > gtestbuild.txt 2>&1
-    else
-        make -j $cpu_num
-    fi
-    if [ $? -ne 0 ];then
-        exit 1
-    fi
-    make install
-
-    if [ ! -f ${install_lib_dir}/lib/libgtest.a ]
-    then
-        echo " ./bin/lib directory is not libgtest.a"
-        cp ${install_lib_dir}/lib64/lib* ${install_lib_dir}/lib
-    fi
+BuildGoogleTest() {
+  if [ $test -eq 0 ]; then
+    echo "no need build google test lib"
+    return 0
+  fi
+
+  if [ -f ./bin/lib/libgtest.a ]; then
+    echo "libgteest already exist no need build test"
+    return 0
+  fi
+
+  cd ${down_dir}
+  if [ -e release-1.8.1.tar.gz ]; then
+    echo "${fname_boost} is exist"
+  else
+    wget https://github.com/abseil/googletest/archive/release-1.8.1.tar.gz
+  fi
+  if [ ! -d "googletest-release-1.8.1" ]; then
+    tar -zxvf release-1.8.1.tar.gz >googletest.txt 2>&1
+  fi
+  cd googletest-release-1.8.1
+  mkdir build
+  cd build
+  echo "build googletest static #####################"
+  if [ $verbose -eq 0 ]; then
+    echo "build googletest without detail log."
+    cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
>googletestbuild.txt 2>&1
+  else
+    cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${install_lib_dir}
+  fi
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  if [ $verbose -eq 0 ]; then
+    make -j $cpu_num >gtestbuild.txt 2>&1
+  else
+    make -j $cpu_num
+  fi
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+  make install
+
+  if [ ! -f ${install_lib_dir}/lib/libgtest.a ]; then
+    echo " ./bin/lib directory is not libgtest.a"
+    cp ${install_lib_dir}/lib64/lib* ${install_lib_dir}/lib
+  fi
 }
 
-ExecutionTesting()
-{
-    if [ $test -eq 0 ];then
-        echo "Build success without executing unit tests."
-        return 0
-    fi
-    echo "############# unit test  start  ###########"
-    cd ${build_dir}
-    make test
-    if [ $? -ne 0 ];then
-        echo "############# unit test failed  ###########"
-        exit 1
-    fi
-    echo "############# unit test  finish  ###########"
+ExecutionTesting() {
+  if [ $test -eq 0 ]; then
+    echo "Build success without executing unit tests."
+    return 0
+  fi
+  echo "############# unit test  start  ###########"
+  cd ${build_dir}
+  make test
+  if [ $? -ne 0 ]; then
+    echo "############# unit test failed  ###########"
+    exit 1
+  fi
+  echo "############# unit test  finish  ###########"
 }
 
-PackageRocketMQStatic()
-{
-    if test "$(uname)" = "Linux"; then
-        echo "package static library."
-        #packet libevent,jsoncpp,boost,rocketmq,Signature to one librocketmq.a
-        cp -f ${basepath}/libs/signature/lib/libSignature.a ${install_lib_dir}/lib
-        ar -M < ${basepath}/package_rocketmq.mri
-        cp -f librocketmq.a ${install_lib_dir}
-    fi
+PackageRocketMQStatic() {
+  if test "$(uname)" = "Linux"; then
+    echo "package static library."
+    #packet libevent,jsoncpp,boost,rocketmq,Signature to one librocketmq.a
+    cp -f ${basepath}/libs/signature/lib/libSignature.a ${install_lib_dir}/lib
+    ar -M <${basepath}/package_rocketmq.mri
+    cp -f librocketmq.a ${install_lib_dir}
+  fi
 }
 
 PrintParams
diff --git a/libs/signature/CMakeLists.txt b/libs/signature/CMakeLists.txt
index 6a2aa1f..0348e48 100755
--- a/libs/signature/CMakeLists.txt
+++ b/libs/signature/CMakeLists.txt
@@ -18,12 +18,12 @@ project(signature)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
 set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
 
-aux_source_directory(src/  DIR_LIB_SRCS)
+aux_source_directory(src/ DIR_LIB_SRCS)
 
 add_library(Signature STATIC ${DIR_LIB_SRCS})
 target_link_libraries(Signature ${deplibs})
 set_target_properties(Signature PROPERTIES OUTPUT_NAME "Signature")
 
 # install
-install (TARGETS   Signature             DESTINATION lib)
+install(TARGETS Signature DESTINATION lib)
 #install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include/rocketmq)
diff --git a/project/CMakeLists.txt b/project/CMakeLists.txt
index 87d5184..60b5d0d 100755
--- a/project/CMakeLists.txt
+++ b/project/CMakeLists.txt
@@ -16,17 +16,17 @@
 # source files
 project(rocketmq-client)
 
-file(GLOB_RECURSE SRC_FILES   ${CMAKE_SOURCE_DIR}/src/*)
-list(REMOVE_ITEM  SRC_FILES   ${CMAKE_SOURCE_DIR}/src/dllmain.cpp)
+file(GLOB_RECURSE SRC_FILES ${CMAKE_SOURCE_DIR}/src/*)
+list(REMOVE_ITEM SRC_FILES ${CMAKE_SOURCE_DIR}/src/dllmain.cpp)
 
 # subdirs
 SET(SUB_DIRS)
 file(GLOB children ${CMAKE_SOURCE_DIR}/src/*)
-FOREACH(child ${children})
-	IF(IS_DIRECTORY ${child})
-	    LIST(APPEND SUB_DIRS ${child})
-	ENDIF()
-ENDFOREACH()
+FOREACH (child ${children})
+    IF (IS_DIRECTORY ${child})
+        LIST(APPEND SUB_DIRS ${child})
+    ENDIF ()
+ENDFOREACH ()
 LIST(APPEND SUB_DIRS ${CMAKE_SOURCE_DIR}/src)
 
 include_directories(${CMAKE_SOURCE_DIR}/include)
@@ -34,44 +34,44 @@ include_directories(${SUB_DIRS})
 
 # libs_directories
 file(GLOB LIB_DIRS ${CMAKE_SOURCE_DIR}/libs/*)
-foreach(dir ${LIB_DIRS})
-    if(IS_DIRECTORY ${dir})
+foreach (dir ${LIB_DIRS})
+    if (IS_DIRECTORY ${dir})
         set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH};${dir})
         include_directories(${dir}/include)
-    endif()
-endforeach()
+    endif ()
+endforeach ()
 
 # static
-if(BUILD_ROCKETMQ_STATIC)
+if (BUILD_ROCKETMQ_STATIC)
     add_library(rocketmq_static STATIC ${SRC_FILES})
     set_target_properties(rocketmq_static PROPERTIES OUTPUT_NAME "rocketmq")
     add_dependencies(rocketmq_static Signature)
     target_link_libraries(rocketmq_static Signature)
-    target_link_libraries(rocketmq_static  ${JSONCPP_LIBRARIES})
-    target_link_libraries(rocketmq_static  ${LIBEVENT_LIBRARIES})
-    target_link_libraries(rocketmq_static  ${Boost_LIBRARIES})
+    target_link_libraries(rocketmq_static ${JSONCPP_LIBRARIES})
+    target_link_libraries(rocketmq_static ${LIBEVENT_LIBRARIES})
+    target_link_libraries(rocketmq_static ${Boost_LIBRARIES})
     target_link_libraries(rocketmq_static ${deplibs})
-endif()
+endif ()
 
 # shared
-if(BUILD_ROCKETMQ_SHARED)
+if (BUILD_ROCKETMQ_SHARED)
     set(CMAKE_SHARED_LINKER_FLAGS "-DBOOST_ALL_DYN_LINK -shared ")
     add_library(rocketmq_shared SHARED ${SRC_FILES})
     set_target_properties(rocketmq_shared PROPERTIES OUTPUT_NAME "rocketmq")
     add_dependencies(rocketmq_shared Signature)
-    target_link_libraries(rocketmq_shared  Signature)
-    target_link_libraries(rocketmq_shared  ${JSONCPP_LIBRARIES})
-    target_link_libraries(rocketmq_shared  ${LIBEVENT_LIBRARIES})
-    target_link_libraries(rocketmq_shared  ${Boost_LIBRARIES})
+    target_link_libraries(rocketmq_shared Signature)
+    target_link_libraries(rocketmq_shared ${JSONCPP_LIBRARIES})
+    target_link_libraries(rocketmq_shared ${LIBEVENT_LIBRARIES})
+    target_link_libraries(rocketmq_shared ${Boost_LIBRARIES})
     target_link_libraries(rocketmq_shared ${deplibs})
-endif()
+endif ()
 
 # install
-if(BUILD_ROCKETMQ_STATIC)
-    install (TARGETS   rocketmq_static             DESTINATION lib)
-endif()
-if(BUILD_ROCKETMQ_SHARED)
-    install (TARGETS   rocketmq_shared             DESTINATION lib)
-endif()
-install (DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/rocketmq)
-install (DIRECTORY ${CMAKE_SOURCE_DIR}/doc/     DESTINATION doc)
+if (BUILD_ROCKETMQ_STATIC)
+    install(TARGETS rocketmq_static DESTINATION lib)
+endif ()
+if (BUILD_ROCKETMQ_SHARED)
+    install(TARGETS rocketmq_shared DESTINATION lib)
+endif ()
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/rocketmq)
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/doc/ DESTINATION doc)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index ebe2ad7..68085c7 100755
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -17,11 +17,11 @@ project(test)
 
 SET(SUB_DIRS)
 file(GLOB children ${CMAKE_SOURCE_DIR}/src/*)
-FOREACH(child ${children})
-    IF(IS_DIRECTORY ${child})
+FOREACH (child ${children})
+    IF (IS_DIRECTORY ${child})
         LIST(APPEND SUB_DIRS ${child})
-    ENDIF()
-ENDFOREACH()
+    ENDIF ()
+ENDFOREACH ()
 LIST(APPEND SUB_DIRS ${CMAKE_SOURCE_DIR}/src)
 include_directories(${CMAKE_SOURCE_DIR}/include)
 include_directories(${SUB_DIRS})
@@ -54,41 +54,41 @@ message(STATUS "** ROCKETMQ_LIBRARIES ${ROCKETMQ_LIBRARIES}")
 set(CMAKE_BUILD_TYPE "Debug")
 
 function(compile files)
-    foreach(file ${files})
+    foreach (file ${files})
         get_filename_component(basename ${file} NAME_WE)
         add_executable(${basename} ${file})
         add_test(NAME rocketmq-${basename} COMMAND ${basename})
-        if(MSVC)
-            if(CMAKE_CONFIGURATION_TYPES STREQUAL "Release")
-                set_target_properties( ${basename} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT"
)
-            else()
-                set_target_properties( ${basename} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD"
)
-            endif()
-        endif()
+        if (MSVC)
+            if (CMAKE_CONFIGURATION_TYPES STREQUAL "Release")
+                set_target_properties(${basename} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
+            else ()
+                set_target_properties(${basename} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD")
+            endif ()
+        endif ()
 
-        if (MSVC) 
+        if (MSVC)
             if (BUILD_ROCKETMQ_SHARED)
-                target_link_libraries (${basename}  rocketmq_shared ${deplibs}
-                ${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES} ${x`})
-            else()
-                target_link_libraries (${basename}  rocketmq_static ${deplibs}
-                ${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES} ${Gtest_LIBRARIES})
-            endif()
-        else()
-            target_link_libraries (${basename}  rocketmq_shared ${deplibs})
-            target_link_libraries (${basename}  rocketmq_shared ${Gtest_LIBRARIES})
-            target_link_libraries (${basename}  rocketmq_shared ${Gmock_LIBRARIES})
-        endif()  
-    endforeach()
+                target_link_libraries(${basename} rocketmq_shared ${deplibs}
+                        ${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES} ${x`})
+            else ()
+                target_link_libraries(${basename} rocketmq_static ${deplibs}
+                        ${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES} ${Gtest_LIBRARIES})
+            endif ()
+        else ()
+            target_link_libraries(${basename} rocketmq_shared ${deplibs})
+            target_link_libraries(${basename} rocketmq_shared ${Gtest_LIBRARIES})
+            target_link_libraries(${basename} rocketmq_shared ${Gmock_LIBRARIES})
+        endif ()
+    endforeach ()
 endfunction()
 
 file(GLOB files "src/*.c*")
 compile("${files}")
 
 file(GLOB files "src/*")
-foreach(file ${files})
-    if(IS_DIRECTORY ${file})
+foreach (file ${files})
+    if (IS_DIRECTORY ${file})
         file(GLOB filess "${file}/*.c*")
         compile("${filess}")
-    endif()
-endforeach()
+    endif ()
+endforeach ()


Mime
View raw message