diff options
author | Andreas Schuh <andreas.schuh.84@gmail.com> | 2016-02-29 17:54:40 +0000 |
---|---|---|
committer | Andreas Schuh <andreas.schuh.84@gmail.com> | 2016-02-29 17:54:40 +0000 |
commit | dd48d704c5c5b1e877e05205683bc1a8e595fc90 (patch) | |
tree | 77ee5f7adecab1c2f42eb2eda4888905f28779de /CMakeLists.txt | |
parent | 9ef0d5220eb9ebd9044b935b62a02b35024f9686 (diff) | |
parent | d78b00d2de9cb90e794e94f73a3483641e5f07e3 (diff) | |
download | gflags-dd48d704c5c5b1e877e05205683bc1a8e595fc90.tar.gz gflags-dd48d704c5c5b1e877e05205683bc1a8e595fc90.tar.bz2 gflags-dd48d704c5c5b1e877e05205683bc1a8e595fc90.zip |
Merge pull request #126 from hevy-CC4477/master
Use ```_static``` suffix in filename of static library on Windows to distinguish it from the import library.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 11e350f..21c8660 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,13 +298,21 @@ 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 () - string (TOLOWER "${TYPE}" type) + + # multi-threaded vs. single-threaded foreach (opts IN ITEMS "" _nothreads) if (BUILD_gflags${opts}_LIB) @@ -325,9 +333,10 @@ 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}" + OUTPUT_NAME "gflags${opts}${GFLAG_STATIC_EXTENSION}" VERSION "${PACKAGE_VERSION}" SOVERSION "${PACKAGE_SOVERSION}" ) |