Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 1 | From bc38fb41044503c9debf5710910c51dd29674b6a Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com> |
| 3 | Date: Fri, 15 Dec 2017 22:14:01 +0100 |
| 4 | Subject: [PATCH] CMake build: Force shared libs with unsuffixed names |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | For windows build sake CMake complains when a project wants to build shared and |
| 10 | static libraries with same name. This caused the authors of fltk to generate |
| 11 | libraries with names suffixed by '_SHARED' when building fltk with cmake - |
| 12 | autotools builds do not suffix. |
| 13 | |
| 14 | Reasons to build shared libs with correct names: |
| 15 | |
| 16 | * Shared libraries are the preferred choice for embedded devices |
| 17 | * There are projects (e.g yoshimi) expecting shared libraries with unsuffixed |
| 18 | names - as created by autotools build. These projects link against static |
| 19 | libraries by accident causing unusable binaries. |
| 20 | |
| 21 | Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com> |
| 22 | --- |
| 23 | CMake/macros.cmake | 2 +- |
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 25 | |
| 26 | diff --git a/CMake/macros.cmake b/CMake/macros.cmake |
| 27 | index 4def62d..ab675f0 100644 |
| 28 | --- a/CMake/macros.cmake |
| 29 | +++ b/CMake/macros.cmake |
| 30 | @@ -49,7 +49,7 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) |
| 31 | PROPERTIES |
| 32 | VERSION ${FLTK_VERSION_FULL} |
| 33 | SOVERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR} |
| 34 | - PREFIX "lib" # for MSVC static/shared coexistence |
| 35 | + OUTPUT_NAME ${LIBNAME} CLEAN_DIRECT_OUTPUT 1 |
| 36 | ) |
| 37 | endif (${LIBTYPE} STREQUAL "SHARED") |
| 38 | |
| 39 | -- |
| 40 | 2.9.5 |
| 41 | |