From c6087d222ddf39329db4642d4ac0397153b3517a Mon Sep 17 00:00:00 2001 From: Mikko Johannes Koivunalho Date: Sun, 20 Oct 2019 00:57:38 +0200 Subject: [PATCH 1/2] Add comments about library creation Why we create both static and shared type of library? Signed-off-by: Mikko Johannes Koivunalho --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 437ea2a6..7f99cab6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,6 +45,11 @@ set(HEADERS configure_file(check.h.in check.h @ONLY) +# To maintain compatibility with the Autotools installation +# we specifically create both shared and static libraries +# as that is what Autotools script has been doing. +# Normally CMake would create the system's native default library type. + add_library(check STATIC ${SOURCES} ${HEADERS}) # We would like to create an OBJECT library but currently they are From 86fe1ba22135f31cfd6cb6c94a48bb967fe35891 Mon Sep 17 00:00:00 2001 From: Mikko Johannes Koivunalho Date: Sun, 20 Oct 2019 00:59:21 +0200 Subject: [PATCH 2/2] Correct wrong Win dynamic library name Change from checkStatic to checkDynamic. Was erroneously "checkStatic". Signed-off-by: Mikko Johannes Koivunalho --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7f99cab6..a2268239 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -153,7 +153,9 @@ if (MSVC) # "On Windows you should probably give each library a different name, # since there is a ".lib" file for both shared and static". # https://stackoverflow.com/a/2152157/4716395 - set(LIBRARY_OUTPUT_NAME "checkStatic") + # "Dynamic-Link Library" (DLL) is Microsoft terminology. + # So we call it this: + set(LIBRARY_OUTPUT_NAME "checkDynamic") endif (MSVC) set_target_properties(checkShared PROPERTIES OUTPUT_NAME ${LIBRARY_OUTPUT_NAME}