You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2019/01/04 12:35:42 UTC

[rocketmq-client-cpp] branch master updated: Be able to build examples with static client (#51)

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 77264ec  Be able to build examples with static client (#51)
77264ec is described below

commit 77264ecc22631b97bd3cbb9a5f80fad6583a27dd
Author: Felix <st...@gmail.com>
AuthorDate: Fri Jan 4 20:35:38 2019 +0800

    Be able to build examples with static client (#51)
---
 example/CMakeLists.txt | 14 +++++++-------
 project/CMakeLists.txt |  7 +++++--
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index c4c2466..90c9442 100755
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -40,7 +40,7 @@ foreach(file ${files})
         endif()
     endif()
 
-    if (MSVC) 
+    if (MSVC)
     	if (BUILD_ROCKETMQ_SHARED)
         	target_link_libraries (${basename}  rocketmq_shared ${deplibs}
         	${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES})
@@ -49,11 +49,11 @@ foreach(file ${files})
         	${Boost_LIBRARIES} ${LIBEVENT_LIBRARIES} ${JSONCPP_LIBRARIES})
         endif()
     else()
-        #if (BUILD_ROCKETMQ_SHARED)
-    	    target_link_libraries (${basename} rocketmq_shared ${deplibs})
-        #else()
-    	#    target_link_libraries (${basename} rocketmq_static ${deplibs})
-        #endif()
+        if (BUILD_ROCKETMQ_SHARED)
+    	    target_link_libraries (${basename} rocketmq_shared)
+        else()
+    	    target_link_libraries (${basename} rocketmq_static)
+        endif()
     endif()
-    
+
 endforeach()
diff --git a/project/CMakeLists.txt b/project/CMakeLists.txt
index 83ec6cf..a1cdc71 100755
--- a/project/CMakeLists.txt
+++ b/project/CMakeLists.txt
@@ -46,8 +46,11 @@ 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 ${deplibs})
     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 ${deplibs})
 endif()
 
 # shared
@@ -56,11 +59,11 @@ if(BUILD_ROCKETMQ_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 ${deplibs})
     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()
 
 # install