diff --git a/src/jsontestrunner/CMakeLists.txt b/src/jsontestrunner/CMakeLists.txt index 1fc71ea..d24aa6f 100644 --- a/src/jsontestrunner/CMakeLists.txt +++ b/src/jsontestrunner/CMakeLists.txt @@ -19,10 +19,8 @@ if(BUILD_SHARED_LIBS) else() add_definitions(-DJSON_DLL) endif() - target_link_libraries(jsontestrunner_exe jsoncpp_lib) -else() - target_link_libraries(jsontestrunner_exe jsoncpp_static) endif() +target_link_libraries(jsontestrunner_exe jsoncpp_lib) set_target_properties(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe) diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index af26476..8cdc5e2 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt @@ -151,7 +151,11 @@ if(BUILD_SHARED_LIBS) endif() if(BUILD_STATIC_LIBS) - set(STATIC_LIB ${PROJECT_NAME}_static) + if (BUILD_SHARED_LIBS) + set(STATIC_LIB ${PROJECT_NAME}_static) + else() + set(STATIC_LIB ${PROJECT_NAME}_lib) + endif() add_library(${STATIC_LIB} STATIC ${PUBLIC_HEADERS} ${JSONCPP_SOURCES}) # avoid name clashes on windows as the shared import lib is alse named jsoncpp.lib @@ -160,7 +164,7 @@ if(BUILD_STATIC_LIBS) endif() set_target_properties(${STATIC_LIB} PROPERTIES - OUTPUT_NAME jsoncpp${STATIC_SUFFIX} + OUTPUT_NAME jsoncpp VERSION ${PROJECT_VERSION} ) diff --git a/src/test_lib_json/CMakeLists.txt b/src/test_lib_json/CMakeLists.txt index 1c3fce9..b803db6 100644 --- a/src/test_lib_json/CMakeLists.txt +++ b/src/test_lib_json/CMakeLists.txt @@ -15,10 +15,8 @@ if(BUILD_SHARED_LIBS) else() add_definitions( -DJSON_DLL ) endif() - target_link_libraries(jsoncpp_test jsoncpp_lib) -else() - target_link_libraries(jsoncpp_test jsoncpp_static) endif() +target_link_libraries(jsoncpp_test jsoncpp_lib) # another way to solve issue #90 #set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store)