From 31bac1b4ec1f2ab590610c98a9a443c92e50e9d2 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 20 Jun 2023 15:10:37 +0200 Subject: [PATCH] Define and propagate CCD_STATIC_DEFINE if the library is compiled as static --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1407080..44fa392 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,7 +47,9 @@ set_target_properties(ccd PROPERTIES target_include_directories(ccd PUBLIC $ $) - +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(ccd PUBLIC CCD_STATIC_DEFINE) +endif() if(NOT WIN32) find_library(LIBM_LIBRARY NAMES m) if(NOT LIBM_LIBRARY)