diff options
author | Andreas Schuh <andreas.schuh.84@gmail.com> | 2016-02-29 17:58:46 +0000 |
---|---|---|
committer | Andreas Schuh <andreas.schuh.84@gmail.com> | 2016-02-29 17:58:46 +0000 |
commit | 6bd636c964b7bdf1721ba4b000cdcf11c57a8f8d (patch) | |
tree | 2e02f4bd89e9526387570686d05d7c2269914c2f /CMakeLists.txt | |
parent | dd48d704c5c5b1e877e05205683bc1a8e595fc90 (diff) | |
download | gflags-6bd636c964b7bdf1721ba4b000cdcf11c57a8f8d.tar.gz gflags-6bd636c964b7bdf1721ba4b000cdcf11c57a8f8d.tar.bz2 gflags-6bd636c964b7bdf1721ba4b000cdcf11c57a8f8d.zip |
cmake: Clean up static library filename suffix code from PR #126
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 21c8660..025a9d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,21 +298,19 @@ set (TARGETS) # static vs. shared foreach (TYPE IN ITEMS STATIC SHARED) if (BUILD_${TYPE}_LIBS) - string (TOLOWER "${TYPE}" type) - # whether or not targets are a DLL if (OS_WINDOWS AND "^${TYPE}$" STREQUAL "^SHARED$") set (GFLAGS_IS_A_DLL 1) - set(GFLAG_STATIC_EXTENSION "") else () - if (OS_WINDOWS) - set(GFLAG_STATIC_EXTENSION _${type}) - endif () set (GFLAGS_IS_A_DLL 0) endif () - - + # filename suffix for static libraries on Windows + if (OS_WINDOWS AND "^${TYPE}$" STREQUAL "^STATIC$") + set (type_suffix "_${type}") + else () + set (type_suffix "") + endif () # multi-threaded vs. single-threaded foreach (opts IN ITEMS "" _nothreads) if (BUILD_gflags${opts}_LIB) @@ -333,10 +331,9 @@ foreach (TYPE IN ITEMS STATIC SHARED) target_link_libraries (gflags${opts}-${type} ${CMAKE_THREAD_LIBS_INIT}) endif () endif () - set_target_properties ( gflags${opts}-${type} PROPERTIES COMPILE_DEFINITIONS "${defines}" - OUTPUT_NAME "gflags${opts}${GFLAG_STATIC_EXTENSION}" + OUTPUT_NAME "gflags${opts}${type_suffix}" VERSION "${PACKAGE_VERSION}" SOVERSION "${PACKAGE_SOVERSION}" ) |