From cf40f73c4019a08de47da53f0c7f1d8ae0e9af32 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Thu, 20 Mar 2014 20:56:05 +0000 Subject: [PATCH 01/14] Set package architecture to i386 when compiling with -m32. --- CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 759fcb2..faefdd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -375,6 +375,25 @@ if (BUILD_PACKAGING) endif () else () string (TOLOWER "${CMAKE_SYSTEM_NAME}" CPACK_SYSTEM_NAME) + if (CMAKE_CXX_FLAGS MATCHES "-m32") + set (CPACK_PACKAGE_ARCHITECTURE i386) + else () + execute_process ( + COMMAND dpkg --print-architecture + RESULT_VARIABLE RV + OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE + ) + if (RV EQUAL 0) + string (STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE) + else () + execute_process (COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE) + if (CPACK_PACKAGE_ARCHITECTURE MATCHES "x86_64") + set (CPACK_PACKAGE_ARCHITECTURE amd64) + else () + set (CPACK_PACKAGE_ARCHITECTURE i386) + endif () + endif () + endif () endif () # source package settings From bbe1895559c61ea72faeabf1f083e0cb16bc3a6b Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Sat, 22 Mar 2014 01:00:11 +0000 Subject: [PATCH 02/14] Remove devel package content summary from README --- README.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.txt b/README.txt index b5ecbbb..958c87e 100644 --- a/README.txt +++ b/README.txt @@ -2,5 +2,3 @@ This package contains a library that implements commandline flags processing. As such it's a replacement for getopt(). It has increased flexibility, including built-in support for C++ types like string, and the ability to define flags in the source file in which they're used. -The devel package contains static and debug libraries and header files -for developing applications that use the gflags package. From 09f7800768f8cc02ecaff4fdb020c195ba4d363a Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Tue, 25 Mar 2014 15:29:56 +0000 Subject: [PATCH 03/14] Use GFLAGS_IS_A_DLL=1 in public headers if BUILD_SHARED_LIBS is enabled (Fixes issue #77). --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93d3a73..7ada98c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,15 @@ else () set (GFLAGS_ATTRIBUTE_UNUSED) endif () +# whenever we build a shared library (DLL on Windows), configure the public +# headers of the API for use of this library rather than the optionally +# also build statically linked library; users can override GFLAGS_DLL_DECL +if (BUILD_SHARED_LIBS) + set (GFLAGS_IS_A_DLL 1) +else () + set (GFLAGS_IS_A_DLL 0) +endif () + configure_headers (PUBLIC_HDRS ${PUBLIC_HDRS}) configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS}) configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS}) From 6040eac5b35763d94af5a0cf6aff75d84f0129b6 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Tue, 25 Mar 2014 15:29:56 +0000 Subject: [PATCH 04/14] Use GFLAGS_IS_A_DLL=1 in public headers if BUILD_SHARED_LIBS is enabled (Fixes issue #77). --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ed3161..4702485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,15 @@ else () set (GFLAGS_ATTRIBUTE_UNUSED) endif () +# whenever we build a shared library (DLL on Windows), configure the public +# headers of the API for use of this library rather than the optionally +# also build statically linked library; users can override GFLAGS_DLL_DECL +if (BUILD_SHARED_LIBS) + set (GFLAGS_IS_A_DLL 1) +else () + set (GFLAGS_IS_A_DLL 0) +endif () + configure_headers (PUBLIC_HDRS ${PUBLIC_HDRS}) configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS}) configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS}) From 38213112a57f48e0d86206477313bf389e13d8fa Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Wed, 26 Mar 2014 19:37:01 +0000 Subject: [PATCH 05/14] Replace GFLAGS_NAMESPACE by @GFLAGS_NAMESPACE@ in gflags_declare.h (Fixes issue #79). --- src/gflags_declare.h.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gflags_declare.h.in b/src/gflags_declare.h.in index b0548fa..b9ab9c7 100644 --- a/src/gflags_declare.h.in +++ b/src/gflags_declare.h.in @@ -113,13 +113,13 @@ typedef std::string clstring; DECLARE_VARIABLE(bool, B, name) #define DECLARE_int32(name) \ - DECLARE_VARIABLE(GFLAGS_NAMESPACE::int32, I, name) + DECLARE_VARIABLE(::@GFLAGS_NAMESPACE@::int32, I, name) #define DECLARE_int64(name) \ - DECLARE_VARIABLE(GFLAGS_NAMESPACE::int64, I64, name) + DECLARE_VARIABLE(::@GFLAGS_NAMESPACE@::int64, I64, name) #define DECLARE_uint64(name) \ - DECLARE_VARIABLE(GFLAGS_NAMESPACE::uint64, U64, name) + DECLARE_VARIABLE(::@GFLAGS_NAMESPACE@::uint64, U64, name) #define DECLARE_double(name) \ DECLARE_VARIABLE(double, D, name) From aff8ef820a165d373ff47614304b337d2082f9dd Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Thu, 27 Mar 2014 01:09:20 +0000 Subject: [PATCH 06/14] Add GFLAGS_INCLUDE_DIR CMake variable (Fixes issue #80). Both GFLAGS_NAMESPACE and GFLAGS_INCLUDE_DIR can be used to customize the installation of the gflags library. One specifies the C++ namespace name of the gflags symbols, the other the include subdirectory path of the public header files. By default, both are set to "gflags", but other Google libraries still expect "google" as C++ namespace name, but not necessarily also include path. --- CMakeLists.txt | 15 ++++++++++++--- cmake/utils.cmake | 12 ++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4702485..8afdddf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,15 @@ version_numbers ( # ---------------------------------------------------------------------------- # options -set (GFLAGS_NAMESPACE "${PACKAGE_NAME}" CACHE STRING "C++ namespace identifier of gflags library.") +set (GFLAGS_NAMESPACE "${PACKAGE_NAME}" CACHE STRING "C++ namespace identifier of gflags library.") +set (GFLAGS_INCLUDE_DIR "${PACKAGE_NAME}" CACHE STRING "Include subdirectory of gflags header files.") + +if (IS_ABSOLUTE GFLAGS_INCLUDE_DIR) + message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must be a path relative to CMAKE_INSTALL_PREFIX/include") +endif () +if (GFLAGS_INCLUDE_DIR MATCHES "^\\.\\.[/\\]") + message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must not start with parent directory reference (../)") +endif () option (BUILD_SHARED_LIBS "Request build of shared libraries." OFF) option (BUILD_STATIC_LIBS "Request build of static libraries (default if BUILD_SHARED_LIBS is OFF)." OFF) @@ -38,6 +46,7 @@ option (INSTALL_HEADERS "Request packaging of headers and other devel mark_as_advanced (CLEAR CMAKE_INSTALL_PREFIX) mark_as_advanced (CMAKE_CONFIGURATION_TYPES GFLAGS_NAMESPACE + GFLAGS_INCLUDE_DIR BUILD_STATIC_LIBS BUILD_NC_TESTS INSTALL_HEADERS) @@ -212,7 +221,7 @@ configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS}) include_directories ("${PROJECT_SOURCE_DIR}/src") include_directories ("${PROJECT_BINARY_DIR}/include") -include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}") +include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}") # ---------------------------------------------------------------------------- # output directories @@ -282,7 +291,7 @@ configure_file (cmake/version.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-co install (TARGETS ${TARGETS} DESTINATION ${LIBRARY_INSTALL_DIR} EXPORT gflags-lib) if (INSTALL_HEADERS) - install (FILES ${PUBLIC_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${GFLAGS_NAMESPACE}) + install (FILES ${PUBLIC_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${GFLAGS_INCLUDE_DIR}) install ( FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake" RENAME ${PACKAGE_NAME}-config.cmake diff --git a/cmake/utils.cmake b/cmake/utils.cmake index ead2638..97c9a66 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -47,11 +47,11 @@ function (configure_headers out) set (tmp) foreach (src IN LISTS ARGN) if (EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in") - configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" @ONLY) - list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}") + configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" @ONLY) + list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") else () - configure_file ("${PROJECT_SOURCE_DIR}/src/${src}" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" COPYONLY) - list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}") + configure_file ("${PROJECT_SOURCE_DIR}/src/${src}" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" COPYONLY) + list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") endif () endforeach () set (${out} "${tmp}" PARENT_SCOPE) @@ -63,8 +63,8 @@ function (configure_sources out) set (tmp) foreach (src IN LISTS ARGN) if (src MATCHES ".h$" AND EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in") - configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" @ONLY) - list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}") + configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" @ONLY) + list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") else () list (APPEND tmp "${PROJECT_SOURCE_DIR}/src/${src}") endif () From 7c80cfd87c1eb195135c91f3493b35a53fb74c88 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Sat, 22 Mar 2014 01:00:11 +0000 Subject: [PATCH 07/14] Remove devel package content summary from README --- README.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.txt b/README.txt index b5ecbbb..958c87e 100644 --- a/README.txt +++ b/README.txt @@ -2,5 +2,3 @@ This package contains a library that implements commandline flags processing. As such it's a replacement for getopt(). It has increased flexibility, including built-in support for C++ types like string, and the ability to define flags in the source file in which they're used. -The devel package contains static and debug libraries and header files -for developing applications that use the gflags package. From 38c4402f58ada036f4609ade095b9fb0ae3276e2 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Tue, 25 Mar 2014 15:29:56 +0000 Subject: [PATCH 08/14] Use GFLAGS_IS_A_DLL=1 in public headers if BUILD_SHARED_LIBS is enabled (Fixes issue #77). --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93d3a73..7ada98c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,15 @@ else () set (GFLAGS_ATTRIBUTE_UNUSED) endif () +# whenever we build a shared library (DLL on Windows), configure the public +# headers of the API for use of this library rather than the optionally +# also build statically linked library; users can override GFLAGS_DLL_DECL +if (BUILD_SHARED_LIBS) + set (GFLAGS_IS_A_DLL 1) +else () + set (GFLAGS_IS_A_DLL 0) +endif () + configure_headers (PUBLIC_HDRS ${PUBLIC_HDRS}) configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS}) configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS}) From 0c6e5fdb3f94da4e26ab5212a0e6b01739ecc999 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Thu, 27 Mar 2014 01:09:20 +0000 Subject: [PATCH 09/14] Add GFLAGS_INCLUDE_DIR CMake variable (Fixes issue #80). Both GFLAGS_NAMESPACE and GFLAGS_INCLUDE_DIR can be used to customize the installation of the gflags library. One specifies the C++ namespace name of the gflags symbols, the other the include subdirectory path of the public header files. By default, both are set to "gflags", but other Google libraries still expect "google" as C++ namespace name, but not necessarily also include path. --- CMakeLists.txt | 15 ++++++++++++--- cmake/utils.cmake | 12 ++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ada98c..bb9f5e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,15 @@ version_numbers ( # ---------------------------------------------------------------------------- # options -set (GFLAGS_NAMESPACE "${PACKAGE_NAME}" CACHE STRING "C++ namespace identifier of gflags library.") +set (GFLAGS_NAMESPACE "${PACKAGE_NAME}" CACHE STRING "C++ namespace identifier of gflags library.") +set (GFLAGS_INCLUDE_DIR "${PACKAGE_NAME}" CACHE STRING "Include subdirectory of gflags header files.") + +if (IS_ABSOLUTE GFLAGS_INCLUDE_DIR) + message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must be a path relative to CMAKE_INSTALL_PREFIX/include") +endif () +if (GFLAGS_INCLUDE_DIR MATCHES "^\\.\\.[/\\]") + message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must not start with parent directory reference (../)") +endif () option (BUILD_SHARED_LIBS "Request build of shared libraries." OFF) option (BUILD_STATIC_LIBS "Request build of static libraries (default if BUILD_SHARED_LIBS is OFF)." OFF) @@ -38,6 +46,7 @@ option (INSTALL_HEADERS "Request packaging of headers and other devel mark_as_advanced (CLEAR CMAKE_INSTALL_PREFIX) mark_as_advanced (CMAKE_CONFIGURATION_TYPES GFLAGS_NAMESPACE + GFLAGS_INCLUDE_DIR BUILD_STATIC_LIBS BUILD_NC_TESTS INSTALL_HEADERS) @@ -212,7 +221,7 @@ configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS}) include_directories ("${PROJECT_SOURCE_DIR}/src") include_directories ("${PROJECT_BINARY_DIR}/include") -include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}") +include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}") # ---------------------------------------------------------------------------- # output directories @@ -282,7 +291,7 @@ configure_file (cmake/version.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-co install (TARGETS ${TARGETS} DESTINATION ${LIBRARY_INSTALL_DIR} EXPORT gflags-lib) if (INSTALL_HEADERS) - install (FILES ${PUBLIC_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${GFLAGS_NAMESPACE}) + install (FILES ${PUBLIC_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${GFLAGS_INCLUDE_DIR}) install ( FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake" RENAME ${PACKAGE_NAME}-config.cmake diff --git a/cmake/utils.cmake b/cmake/utils.cmake index ead2638..97c9a66 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -47,11 +47,11 @@ function (configure_headers out) set (tmp) foreach (src IN LISTS ARGN) if (EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in") - configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" @ONLY) - list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}") + configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" @ONLY) + list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") else () - configure_file ("${PROJECT_SOURCE_DIR}/src/${src}" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" COPYONLY) - list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}") + configure_file ("${PROJECT_SOURCE_DIR}/src/${src}" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" COPYONLY) + list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") endif () endforeach () set (${out} "${tmp}" PARENT_SCOPE) @@ -63,8 +63,8 @@ function (configure_sources out) set (tmp) foreach (src IN LISTS ARGN) if (src MATCHES ".h$" AND EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in") - configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}" @ONLY) - list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}/${src}") + configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" @ONLY) + list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") else () list (APPEND tmp "${PROJECT_SOURCE_DIR}/src/${src}") endif () From 94c23575c7183b73912f4b60a66f49d3f3d59b70 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Thu, 27 Mar 2014 01:45:47 +0000 Subject: [PATCH 10/14] Update NEWS. --- NEWS.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index b9a68f3..ba8d91c 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,12 +1,15 @@ === 20 March 2014 === -I've just released gflags 2.1.0. +I've just released gflags 2.1. The major changes are the use of CMake for the build configuration instead -of the autotools and packaging support through CPack. This release compiles -with all major compilers without warnings and passed the unit tests on -Ubuntu 12.04, Windows 7 (Visual Studio 2008 and 2010, Cygwin, MinGW), and -Mac OS X (Xcode 5.1). +of the autotools and packaging support through CPack. The default namespace +of all C++ symbols is now "gflags" instead of "google". This can be +configured via the GFLAGS_NAMESPACE variable. + +This release compiles with all major compilers without warnings and passed +the unit tests on Ubuntu 12.04, Windows 7 (Visual Studio 2008 and 2010, +Cygwin, MinGW), and Mac OS X (Xcode 5.1). The SVN repository on Google Code is now frozen and replaced by a Git repository such that it can be used as Git submodule by projects. The main @@ -21,9 +24,7 @@ For the further development, I am following the with feature branch names prefixed by "feature/" and bugfix branch names prefixed by "bugfix/", respectively. -Binary and source distribution packages can be downloaded from -[https://github.com/schuhschuh/gflags GitHub] as Google Code no longer -permits the upload of such download packages. +Binary and source [https://github.com/schuhschuh/gflags/releases packages] are available on GitHub. === 14 January 2013 === From dc8543a4738548dda6f210cca035693e19c7042d Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Sun, 30 Mar 2014 15:16:00 +0100 Subject: [PATCH 11/14] Add test which uses gflags_declare.h. Update issue 79 Added a test which uses gflags_declare.h as any other project would use it to avoid such avoidable build configuration mistakes. --- test/CMakeLists.txt | 7 +++++++ test/gflags_declare_flags.cc | 9 +++++++++ test/gflags_declare_test.cc | 12 ++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 test/gflags_declare_flags.cc create mode 100644 test/gflags_declare_test.cc diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 49c97ea..ff07474 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -154,6 +154,13 @@ add_gflags_test(always_fail 1 "ERROR: failed validation of new value 'true' for # debugger abort() intervention in case of Debug configuration. #add_gflags_test(deadlock_if_cant_lock 0 "PASS" "" gflags_unittest --deadlock_if_cant_lock) +# ---------------------------------------------------------------------------- +# use gflags_declare.h +add_executable (gflags_declare_test gflags_declare_test.cc gflags_declare_flags.cc) + +add_test(NAME gflags_declare COMMAND gflags_declare_test --message "Hello gflags!") +set_tests_properties(gflags_declare PROPERTIES PASS_REGULAR_EXPRESSION "Hello gflags!") + # ---------------------------------------------------------------------------- # (negative) compilation tests if (BUILD_NC_TESTS) diff --git a/test/gflags_declare_flags.cc b/test/gflags_declare_flags.cc new file mode 100644 index 0000000..dc53de5 --- /dev/null +++ b/test/gflags_declare_flags.cc @@ -0,0 +1,9 @@ +#include +#include + +DECLARE_string(message); // in gflags_delcare_test.cc + +void print_message() +{ + std::cout << FLAGS_message << std::endl; +} diff --git a/test/gflags_declare_test.cc b/test/gflags_declare_test.cc new file mode 100644 index 0000000..707bcc0 --- /dev/null +++ b/test/gflags_declare_test.cc @@ -0,0 +1,12 @@ +#include + +DEFINE_string(message, "", "The message to print"); +void print_message(); // in gflags_declare_flags.cc + +int main(int argc, char **argv) +{ + gflags::SetUsageMessage("Test compilation and use of gflags_declare.h"); + gflags::ParseCommandLineFlags(&argc, &argv, true); + print_message(); + return 0; +} From eb5e1f7fe44992058db423594cba5c94da85462c Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Sun, 30 Mar 2014 15:17:49 +0100 Subject: [PATCH 12/14] Bump version to 2.1.1. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8afdddf..b11c697 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ include (utils) # ---------------------------------------------------------------------------- # package information set (PACKAGE_NAME "gflags") -set (PACKAGE_VERSION "2.1.0") +set (PACKAGE_VERSION "2.1.1") set (PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set (PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set (PACKAGE_BUGREPORT "https://code.google.com/p/gflags/issues/") From 0890b699e97d7f8ffc898f3c5de6e2645be74e0c Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Sun, 30 Mar 2014 15:18:26 +0100 Subject: [PATCH 13/14] Add NEWS of release version 2.1.1. --- NEWS.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS.txt b/NEWS.txt index ba8d91c..7418607 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,14 @@ +=== 30 March 2014 === + +I've just released gflags 2.1.1. + +This release fixes a few bugs in the configuration of gflags_declare.h +and adds a separate GFLAGS_INCLUDE_DIR CMake variable to the build configuration. +Setting GFLAGS_NAMESPACE to "google" no longer changes also the include +path of the public header files. This allows the use of the library with +other Google projects such as glog which still use the deprecated "google" +namespace for the gflags library, but include it as "gflags/gflags.h". + === 20 March 2014 === I've just released gflags 2.1. From ef5c5474b29318a418c1628038865ee252e98b0e Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Sun, 30 Mar 2014 15:34:13 +0100 Subject: [PATCH 14/14] Set CPACK_PACKAGE_ARCHITECTURE to darwin on Mac OS. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b11c697..17d38b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -392,6 +392,8 @@ if (BUILD_PACKAGING) set (CPACK_SYSTEM_NAME "win32") endif () set (CPACK_PACKAGE_ARCHITECTURE) + elseif (APPLE) + set (CPACK_PACKAGE_ARCHITECTURE darwin) else () string (TOLOWER "${CMAKE_SYSTEM_NAME}" CPACK_SYSTEM_NAME) if (CMAKE_CXX_FLAGS MATCHES "-m32")