From 9684bdb556f46a358cb9f05ec3dd5d34b0bd81a2 Mon Sep 17 00:00:00 2001 From: Harald Oehlmann Date: Wed, 12 Dec 2018 09:37:56 +0100 Subject: [PATCH] Ticket 134: do some CMake corrections told to be ok by the ticket author. No test by me. --- backend/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index b71da66d..7a94fe1a 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -25,7 +25,17 @@ set_target_properties(zint PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_V if(PNG_FOUND) target_link_libraries(zint ${PNG_LIBRARIES} ) endif(PNG_FOUND) -target_link_libraries(zint -lm) +if(NOT MSVC) + # Link with standard C math library. + target_link_libraries(zint m) +endif(NOT MSVC) + +if(MSVC) + # "BUILD_SHARED_LIBS" is a CMake defined variable, see documentation. + if(BUILD_SHARED_LIBS) + add_definitions("-DDLL_EXPORT") + endif(BUILD_SHARED_LIBS) +endif(MSVC) install(TARGETS zint ${INSTALL_TARGETS_DEFAULT_ARGS} ) install(FILES zint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)