diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 63ed6115..e7e27ce2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -50,6 +50,12 @@ IF (MSGPACK_CXX11) ) ENDIF () +IF (MSGPACK_ENABLE_SHARED) + SET (MSGPACK_TEST_LIB msgpack) +ELSE () + SET (MSGPACK_TEST_LIB msgpack-static) +ENDIF () + FOREACH (source_file ${check_PROGRAMS}) GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE) ADD_EXECUTABLE ( @@ -57,7 +63,7 @@ FOREACH (source_file ${check_PROGRAMS}) ${source_file} ) TARGET_LINK_LIBRARIES (${source_file_we} - msgpack + ${MSGPACK_TEST_LIB} ${GTEST_BOTH_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}