From 5378d90ba7dfc18cab3cf320d6df1dceadc2c3a3 Mon Sep 17 00:00:00 2001 From: Tibo Clausen Date: Wed, 9 Oct 2019 11:39:32 +0100 Subject: [PATCH 1/2] Fix cmake when compiling to a static lib --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a9f919..eb153c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,10 +64,10 @@ else() endif() if(BUILD_STATIC) add_library(qtadvanceddocking STATIC ${ads_SRCS}) - set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ADS_STATIC) + target_compile_definitions(qtadvanceddocking PUBLIC ADS_STATIC) else() add_library(qtadvanceddocking SHARED ${ads_SRCS}) - set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ADS_SHARED_EXPORT) + target_compile_definitions(qtadvanceddocking PUBLIC ADS_SHARED_EXPORT) endif() install(FILES ${ads_INSTALL_INCLUDE} DESTINATION include From 136d6d966cd945fc180b0ec3e0a32fca9fea03e7 Mon Sep 17 00:00:00 2001 From: Tibo Clausen Date: Tue, 22 Oct 2019 13:40:52 +0100 Subject: [PATCH 2/2] Partially reverse previous change --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb153c4..8b8de00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ if(BUILD_STATIC) target_compile_definitions(qtadvanceddocking PUBLIC ADS_STATIC) else() add_library(qtadvanceddocking SHARED ${ads_SRCS}) - target_compile_definitions(qtadvanceddocking PUBLIC ADS_SHARED_EXPORT) + set(ads_COMPILE_DEFINE ${ads_COMPILE_DEFINE} ADS_SHARED_EXPORT) endif() install(FILES ${ads_INSTALL_INCLUDE} DESTINATION include