Commit 6bd636c9 authored by Andreas Schuh's avatar Andreas Schuh

cmake: Clean up static library filename suffix code from PR #126

parent dd48d704
...@@ -298,21 +298,19 @@ set (TARGETS) ...@@ -298,21 +298,19 @@ set (TARGETS)
# static vs. shared # static vs. shared
foreach (TYPE IN ITEMS STATIC SHARED) foreach (TYPE IN ITEMS STATIC SHARED)
if (BUILD_${TYPE}_LIBS) if (BUILD_${TYPE}_LIBS)
string (TOLOWER "${TYPE}" type) string (TOLOWER "${TYPE}" type)
# whether or not targets are a DLL # whether or not targets are a DLL
if (OS_WINDOWS AND "^${TYPE}$" STREQUAL "^SHARED$") if (OS_WINDOWS AND "^${TYPE}$" STREQUAL "^SHARED$")
set (GFLAGS_IS_A_DLL 1) set (GFLAGS_IS_A_DLL 1)
set(GFLAG_STATIC_EXTENSION "")
else () else ()
if (OS_WINDOWS)
set(GFLAG_STATIC_EXTENSION _${type})
endif ()
set (GFLAGS_IS_A_DLL 0) set (GFLAGS_IS_A_DLL 0)
endif () 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 # multi-threaded vs. single-threaded
foreach (opts IN ITEMS "" _nothreads) foreach (opts IN ITEMS "" _nothreads)
if (BUILD_gflags${opts}_LIB) if (BUILD_gflags${opts}_LIB)
...@@ -333,10 +331,9 @@ foreach (TYPE IN ITEMS STATIC SHARED) ...@@ -333,10 +331,9 @@ foreach (TYPE IN ITEMS STATIC SHARED)
target_link_libraries (gflags${opts}-${type} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (gflags${opts}-${type} ${CMAKE_THREAD_LIBS_INIT})
endif () endif ()
endif () endif ()
set_target_properties ( set_target_properties (
gflags${opts}-${type} PROPERTIES COMPILE_DEFINITIONS "${defines}" gflags${opts}-${type} PROPERTIES COMPILE_DEFINITIONS "${defines}"
OUTPUT_NAME "gflags${opts}${GFLAG_STATIC_EXTENSION}" OUTPUT_NAME "gflags${opts}${type_suffix}"
VERSION "${PACKAGE_VERSION}" VERSION "${PACKAGE_VERSION}"
SOVERSION "${PACKAGE_SOVERSION}" SOVERSION "${PACKAGE_SOVERSION}"
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment