diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 62668182..574a4683 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -89,7 +89,7 @@ set_target_properties(libmosquitto_static PROPERTIES VERSION ${VERSION} ) -target_compile_definitions(libmosquitto_static PUBLIC "STATIC_LIB") +target_compile_definitions(libmosquitto_static PUBLIC "LIBMOSQUITTO_STATIC") install(TARGETS libmosquitto libmosquitto_static RUNTIME DESTINATION ${BINDIR} LIBRARY DESTINATION ${LIBDIR} ARCHIVE DESTINATION ${LIBDIR}) install(FILES mosquitto.h DESTINATION ${INCLUDEDIR}) diff --git a/lib/mosquitto.h b/lib/mosquitto.h index f1deb3e6..b41a94c5 100644 --- a/lib/mosquitto.h +++ b/lib/mosquitto.h @@ -21,7 +21,7 @@ Contributors: extern "C" { #endif -#if defined(WIN32) && !defined(WITH_BROKER) && !defined(STATIC_LIB) +#if defined(WIN32) && !defined(WITH_BROKER) && !defined(LIBMOSQUITTO_STATIC) # ifdef libmosquitto_EXPORTS # define libmosq_EXPORT __declspec(dllexport) # else