mirror of
https://github.com/gflags/gflags.git
synced 2025-04-04 21:15:05 +00:00
Merge branch 'refs/heads/feature/cpack-package-generation' into develop
This commit is contained in:
commit
06ad5027d2
14 changed files with 490 additions and 293 deletions
285
CMakeLists.txt
Executable file → Normal file
285
CMakeLists.txt
Executable file → Normal file
|
@ -1,27 +1,19 @@
|
|||
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
|
||||
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
set (OS_WINDOWS 1)
|
||||
else ()
|
||||
set (OS_WINDOWS 0)
|
||||
endif ()
|
||||
cmake_minimum_required (VERSION 2.8.4 FATAL_ERROR)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# includes
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
include (utils)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# package information
|
||||
set (PROJECT_NAME "gflags")
|
||||
set (PACKAGE_NAME "${PROJECT_NAME}")
|
||||
set (PACKAGE_VERSION "2.1.0")
|
||||
set (PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
|
||||
set (PACKAGE_TARNAME "${PROJECT_NAME}-${PACKAGE_VERSION}")
|
||||
set (PACKAGE_NAME "gflags")
|
||||
set (PACKAGE_VERSION "2.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/")
|
||||
|
||||
project (${PROJECT_NAME} CXX)
|
||||
project (${PACKAGE_NAME} CXX)
|
||||
|
||||
version_numbers (
|
||||
${PACKAGE_VERSION}
|
||||
|
@ -31,50 +23,53 @@ version_numbers (
|
|||
)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# configure options
|
||||
option (BUILD_SHARED_LIBS "Request build of shared libraries." OFF)
|
||||
# options
|
||||
set (GFLAGS_NAMESPACE "${PACKAGE_NAME}" CACHE STRING "C++ namespace identifier of gflags library.")
|
||||
|
||||
if (OS_WINDOWS AND BUILD_SHARED_LIBS)
|
||||
set (GFLAGS_IS_A_DLL 1)
|
||||
else ()
|
||||
set (GFLAGS_IS_A_DLL 0)
|
||||
endif ()
|
||||
|
||||
option (BUILD_gflags_LIB "Request build of the multi-threaded gflags library." ON)
|
||||
option (BUILD_gflags_nothreads_LIB "Request build of the single-threaded gflags library." ON)
|
||||
|
||||
if (NOT BUILD_gflags_LIB AND NOT BUILD_gflags_nothreads_LIB)
|
||||
message (FATAL_ERROR "At least one of BUILD_gflags_LIB and BUILD_gflags_nothreads_LIB must be ON.")
|
||||
endif ()
|
||||
|
||||
option (BUILD_NEGATIVE_COMPILATION_TESTS "Request addition of negative compilation tests." OFF)
|
||||
mark_as_advanced (BUILD_NEGATIVE_COMPILATION_TESTS)
|
||||
|
||||
set (GFLAGS_NAMESPACE "gflags" CACHE STRING "C++ namespace identifier of gflags library.")
|
||||
mark_as_advanced (GFLAGS_NAMESPACE)
|
||||
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)
|
||||
option (BUILD_gflags_LIB "Request build of the multi-threaded gflags library." ON)
|
||||
option (BUILD_gflags_nothreads_LIB "Request build of the single-threaded gflags library." ON)
|
||||
option (BUILD_PACKAGING "Enable build of distribution packages using CPack." OFF)
|
||||
option (BUILD_TESTING "Enable build of the unit tests and their execution using CTest." OFF)
|
||||
option (BUILD_NC_TESTS "Request addition of negative compilation tests." OFF)
|
||||
option (INSTALL_HEADERS "Request packaging of headers and other development files." ON)
|
||||
|
||||
mark_as_advanced (CLEAR CMAKE_INSTALL_PREFIX)
|
||||
mark_as_advanced (CMAKE_CONFIGURATION_TYPES)
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS AND NOT CMAKE_C_FLAGS)
|
||||
set (
|
||||
CMAKE_BUILD_TYPE "Release"
|
||||
CACHE STRING "Choose the type of build, options are: None (CMAKE_C_FLAGS and CMAKE_CXX_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
|
||||
FORCE
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (CMAKE_CONFIGURATION_TYPES
|
||||
GFLAGS_NAMESPACE
|
||||
BUILD_STATIC_LIBS
|
||||
BUILD_NC_TESTS
|
||||
INSTALL_HEADERS)
|
||||
if (APPLE)
|
||||
mark_as_advanced(CMAKE_OSX_ARCHITECTURES
|
||||
CMAKE_OSX_DEPLOYMENT_TARGET
|
||||
CMAKE_OSX_SYSROOT)
|
||||
endif ()
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS)
|
||||
set (BUILD_STATIC_LIBS ON)
|
||||
endif ()
|
||||
if (NOT BUILD_gflags_LIB AND NOT BUILD_gflags_nothreads_LIB)
|
||||
message (FATAL_ERROR "At least one of BUILD_gflags_LIB and BUILD_gflags_nothreads_LIB must be ON.")
|
||||
endif ()
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
|
||||
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY VALUE Release)
|
||||
endif ()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# system checks
|
||||
include (CheckTypeSize)
|
||||
include (CheckIncludeFileCXX)
|
||||
include (CheckCXXSymbolExists)
|
||||
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
set (OS_WINDOWS 1)
|
||||
else ()
|
||||
set (OS_WINDOWS 0)
|
||||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
set (HAVE_SYS_TYPES_H 1)
|
||||
set (HAVE_STDINT_H 1)
|
||||
|
@ -179,6 +174,8 @@ set (PUBLIC_HDRS
|
|||
|
||||
set (PRIVATE_HDRS
|
||||
"config.h"
|
||||
"util.h"
|
||||
"mutex.h"
|
||||
)
|
||||
|
||||
set (GFLAGS_SRCS
|
||||
|
@ -204,6 +201,10 @@ configure_headers (PUBLIC_HDRS ${PUBLIC_HDRS})
|
|||
configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS})
|
||||
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}")
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# output directories
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin")
|
||||
|
@ -211,27 +212,46 @@ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib")
|
|||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "lib")
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# add library target
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/src")
|
||||
include_directories ("${PROJECT_BINARY_DIR}/include")
|
||||
include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}")
|
||||
|
||||
set (LIB_TARGETS)
|
||||
if (BUILD_gflags_LIB)
|
||||
add_library (gflags ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
|
||||
if (HAVE_SHLWAPI_H)
|
||||
target_link_libraries (gflags shlwapi.lib)
|
||||
# add library targets
|
||||
set (TARGETS)
|
||||
# static vs. shared
|
||||
foreach (TYPE IN ITEMS STATIC SHARED)
|
||||
if (BUILD_${TYPE}_LIBS)
|
||||
# whether or not targets are a DLL
|
||||
if (OS_WINDOWS AND "^${TYPE}$" STREQUAL "^SHARED$")
|
||||
set (GFLAGS_IS_A_DLL 1)
|
||||
else ()
|
||||
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)
|
||||
add_library (gflags${opts}-${type} ${TYPE} ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
|
||||
if (opts MATCHES "nothreads")
|
||||
set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL};NOTHREADS")
|
||||
else ()
|
||||
set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL}")
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
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}"
|
||||
)
|
||||
if (HAVE_SHLWAPI_H)
|
||||
target_link_libraries (gflags${opts}-${type} shlwapi.lib)
|
||||
endif ()
|
||||
if (NOT TARGET gflags${opts})
|
||||
add_custom_target (gflags${opts})
|
||||
endif ()
|
||||
add_dependencies (gflags${opts} gflags${opts}-${type})
|
||||
list (APPEND TARGETS gflags${opts}-${type})
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
list (APPEND LIB_TARGETS gflags)
|
||||
endif ()
|
||||
if (BUILD_gflags_nothreads_LIB)
|
||||
add_library (gflags_nothreads ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
|
||||
set_target_properties (gflags_nothreads PROPERTIES COMPILE_DEFINITIONS NO_THREADS)
|
||||
if (HAVE_SHLWAPI_H)
|
||||
target_link_libraries (gflags_nothreads shlwapi.lib)
|
||||
endif ()
|
||||
list (APPEND LIB_TARGETS gflags_nothreads)
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# installation
|
||||
|
@ -247,41 +267,140 @@ else ()
|
|||
set (CONFIG_INSTALL_DIR lib/cmake/${PACKAGE_NAME})
|
||||
endif ()
|
||||
|
||||
install (TARGETS ${LIB_TARGETS} DESTINATION ${LIBRARY_INSTALL_DIR} EXPORT gflags-lib)
|
||||
install (FILES ${PUBLIC_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${GFLAGS_NAMESPACE})
|
||||
|
||||
file (RELATIVE_PATH INSTALL_PREFIX_REL2CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${CONFIG_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}")
|
||||
configure_file (cmake/config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake" @ONLY)
|
||||
configure_file (cmake/version.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake" @ONLY)
|
||||
|
||||
install (
|
||||
FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake"
|
||||
RENAME ${PACKAGE_NAME}-config.cmake
|
||||
DESTINATION ${CONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install (
|
||||
FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake"
|
||||
DESTINATION ${CONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install (EXPORT gflags-lib DESTINATION ${CONFIG_INSTALL_DIR} FILE ${PACKAGE_NAME}-export.cmake)
|
||||
|
||||
if (UNIX)
|
||||
install (PROGRAMS src/gflags_completions.sh DESTINATION ${RUNTIME_INSTALL_DIR})
|
||||
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 "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake"
|
||||
RENAME ${PACKAGE_NAME}-config.cmake
|
||||
DESTINATION ${CONFIG_INSTALL_DIR}
|
||||
)
|
||||
install (
|
||||
FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake"
|
||||
DESTINATION ${CONFIG_INSTALL_DIR}
|
||||
)
|
||||
install (EXPORT gflags-lib DESTINATION ${CONFIG_INSTALL_DIR} FILE ${PACKAGE_NAME}-export.cmake)
|
||||
if (UNIX)
|
||||
install (PROGRAMS src/gflags_completions.sh DESTINATION ${RUNTIME_INSTALL_DIR})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# support direct use of build tree
|
||||
set (INSTALL_PREFIX_REL2CONFIG_DIR .)
|
||||
export (TARGETS ${LIB_TARGETS} FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-export.cmake")
|
||||
export (TARGETS ${TARGETS} FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-export.cmake")
|
||||
export (PACKAGE gflags)
|
||||
configure_file (cmake/config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake" @ONLY)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# testing - MUST follow the generation of the build tree config file
|
||||
include (CTest)
|
||||
if (BUILD_TESTING)
|
||||
include (CTest)
|
||||
enable_testing ()
|
||||
add_subdirectory (test)
|
||||
endif ()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# packaging
|
||||
if (BUILD_PACKAGING)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS AND NOT INSTALL_HEADERS)
|
||||
message (WARNING "Package will contain static libraries without headers!"
|
||||
"\nRecommended options for generation of runtime package:"
|
||||
"\n BUILD_SHARED_LIBS=ON"
|
||||
"\n BUILD_STATIC_LIBS=OFF"
|
||||
"\n INSTALL_HEADERS=OFF"
|
||||
"\nRecommended options for generation of development package:"
|
||||
"\n BUILD_SHARED_LIBS=ON"
|
||||
"\n BUILD_STATIC_LIBS=ON"
|
||||
"\n INSTALL_HEADERS=ON")
|
||||
endif ()
|
||||
|
||||
# default package generators
|
||||
if (APPLE)
|
||||
set (PACKAGE_GENERATOR "PackageMaker")
|
||||
set (PACKAGE_SOURCE_GENERATOR "TGZ;ZIP")
|
||||
elseif (UNIX)
|
||||
set (PACKAGE_GENERATOR "DEB;RPM")
|
||||
set (PACKAGE_SOURCE_GENERATOR "TGZ;ZIP")
|
||||
else ()
|
||||
set (PACKAGE_GENERATOR "ZIP")
|
||||
set (PACKAGE_SOURCE_GENERATOR "ZIP")
|
||||
endif ()
|
||||
|
||||
# used package generators
|
||||
set (CPACK_GENERATOR "${PACKAGE_GENERATOR}" CACHE STRING "List of binary package generators (CPack).")
|
||||
set (CPACK_SOURCE_GENERATOR "${PACKAGE_SOURCE_GENERATOR}" CACHE STRING "List of source package generators (CPack).")
|
||||
mark_as_advanced (CPACK_GENERATOR CPACK_SOURCE_GENERATOR)
|
||||
|
||||
# common package information
|
||||
set (CPACK_PACKAGE_VENDOR "Andreas Schuh")
|
||||
set (CPACK_PACKAGE_CONTACT "google-gflags@googlegroups.com")
|
||||
set (CPACK_PACKAGE_NAME "${PACKAGE_NAME}")
|
||||
set (CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR "${PACKAGE_VERSION_MAJOR}")
|
||||
set (CPACK_PACKAGE_VERSION_MINOR "${PACKAGE_VERSION_MINOR}")
|
||||
set (CPACK_PACKAGE_VERSION_PATCH "${PACKAGE_VERSION_PATCH}")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "A commandline flags library that allows for distributed flags.")
|
||||
set (CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_LIST_DIR}/README.txt")
|
||||
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_LIST_DIR}/COPYING.txt")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_LIST_DIR}/README.txt")
|
||||
set (CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
set (CPACK_OUTPUT_FILE_PREFIX packages)
|
||||
set (CPACK_PACKAGE_RELOCATABLE TRUE)
|
||||
set (CPACK_MONOLITHIC_INSTALL TRUE)
|
||||
|
||||
# RPM package information -- used in cmake/package.cmake.in also for DEB
|
||||
set (CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
|
||||
set (CPACK_RPM_PACKAGE_LICENSE "BSD")
|
||||
set (CPACK_RPM_PACKAGE_URL "http://code.google.com/p/gflags")
|
||||
set (CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_LIST_DIR}/ChangeLog.txt")
|
||||
|
||||
if (INSTALL_HEADERS)
|
||||
set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/doc/gflags.html")
|
||||
else ()
|
||||
set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/cmake/README_runtime.txt")
|
||||
endif ()
|
||||
|
||||
# system name used for binary package file name
|
||||
if (WINDOWS)
|
||||
if (CMAKE_CL_64)
|
||||
set (CPACK_SYSTEM_NAME "win64")
|
||||
else ()
|
||||
set (CPACK_SYSTEM_NAME "win32")
|
||||
endif ()
|
||||
else ()
|
||||
string (TOLOWER "${CMAKE_SYSTEM_NAME}" CPACK_SYSTEM_NAME)
|
||||
endif ()
|
||||
|
||||
# source package settings
|
||||
set (CPACK_SOURCE_TOPLEVEL_TAG "source")
|
||||
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
|
||||
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;\\\\.swp$;\\\\.#;/#;\\\\.*~;cscope\\\\.*;/[Bb]uild[.+-_a-zA-Z0-9]*/")
|
||||
|
||||
# default binary package settings
|
||||
set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY TRUE)
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
|
||||
if (CMAKE_SYSTEM_PROCESSOR)
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif ()
|
||||
|
||||
# generator specific configuration file
|
||||
#
|
||||
# allow package maintainers to use their own configuration file
|
||||
# $ cmake -DCPACK_PROJECT_CONFIG_FILE:FILE=/path/to/package/config
|
||||
if (NOT CPACK_PROJECT_CONFIG_FILE)
|
||||
configure_file (
|
||||
"${CMAKE_CURRENT_LIST_DIR}/cmake/package.cmake.in"
|
||||
"${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-package.cmake" @ONLY
|
||||
)
|
||||
set (CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-package.cmake")
|
||||
endif ()
|
||||
|
||||
include (CPack)
|
||||
|
||||
endif () # BUILD_PACKAGING
|
||||
|
|
195
ChangeLog
195
ChangeLog
|
@ -1,195 +0,0 @@
|
|||
Wed Jan 25 15:09:14 2012 Google Inc. <google-gflags@googlegroups.com>
|
||||
|
||||
* gflags: version 2.0
|
||||
* Changed the 'official' gflags email in setup.py/etc
|
||||
* Renamed google-gflags.sln to gflags.sln
|
||||
* Changed copyright text to reflect Google's relinquished ownership
|
||||
|
||||
Tue Dec 20 19:48:57 2011 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.7
|
||||
* Add CommandLineFlagInfo::flag_ptr pointing to current storage (musji)
|
||||
* PORTING: flush after writing to stderr, needed on cygwin
|
||||
* PORTING: Clean up the GFLAGS_DLL_DECL stuff better
|
||||
* Fix a bug in StringPrintf() that affected large strings (csilvers)
|
||||
* Die at configure-time when g++ isn't installed
|
||||
|
||||
Fri Jul 29 19:05:21 2011 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.6
|
||||
* BUGFIX: Fix a bug where we were leaving out a required $(top_srcdir)
|
||||
* Fix definition of clstring (jyrki)
|
||||
* Split up flag declares into its own file (jyrki)
|
||||
* Add --version support (csilvers)
|
||||
* Update the README for gflags with static libs
|
||||
* Update acx_pthread.m4 for nostdlib
|
||||
* Change ReparseCommandLineFlags to return void (csilvers)
|
||||
* Some doc typofixes and example augmentation (various)
|
||||
|
||||
Mon Jan 24 16:11:35 2011 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.5
|
||||
* Better reporting of current vs default value (handler)
|
||||
* Add API for cleaning up of memory at program-exit (jmarantz)
|
||||
* Fix macros to work inside namespaces (csilvers)
|
||||
* Use our own string typedef in case string is redefined (csilvers)
|
||||
* Updated to autoconf 2.65
|
||||
|
||||
Wed Oct 13 17:40:12 2010 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.4
|
||||
* Add a check to prevent passing 0 to DEFINE_string (jorg)
|
||||
* Reduce compile (.o) size (jyrki)
|
||||
* Some small changes to quiet debug compiles (alexk)
|
||||
* PORTING: better support static linking on windows (csilvers)
|
||||
* DOCUMENTATION: change default values, use validators, etc.
|
||||
* Update the NEWS file to be non-empty
|
||||
* Add pkg-config (.pc) files for libgflags and libgflags_nothreads
|
||||
|
||||
Mon Jan 4 18:09:30 2010 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.3
|
||||
* PORTABILITY: can now build and run tests under MSVC (csilvers)
|
||||
* Remove the python gflags code, which is now its own package (tansell)
|
||||
* Clarify that "last flag wins" in the docs (csilvers)
|
||||
* Comment danger of using GetAllFlags in validators (wojtekm)
|
||||
* PORTABILITY: Some fixes necessary for c++0x (mboerger)
|
||||
* Makefile fix: $(srcdir) -> $(top_srcdir) in one place (csilvres)
|
||||
* INSTALL: autotools to autoconf v2.64 + automake v1.11 (csilvers)
|
||||
|
||||
Thu Sep 10 12:53:04 2009 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.2
|
||||
* PORTABILITY: can now build and run tests under mingw (csilvers)
|
||||
* Using a string arg for a bool flag is a compile-time error (rbayardo)
|
||||
* Add --helpxml to gflags.py (salcianu)
|
||||
* Protect against a hypothetical global d'tor mutex problem (csilvers)
|
||||
* BUGFIX: can now define a flag after 'using namespace google' (hamaji)
|
||||
|
||||
Tue Apr 14 12:35:25 2009 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.1
|
||||
* Add both foo and nofoo for boolean flags, with --undefok (andychu)
|
||||
* Better document how validators work (wojtekm)
|
||||
* Improve binary-detection for bash-completion (mtamsky)
|
||||
* Python: Add a concept of "key flags", used with --help (salcianu)
|
||||
* Python: Robustify flag_values (salcianu)
|
||||
* Python: Add a new DEFINE_bool alias (keir, andrewliu)
|
||||
* Python: Do module introspection based on module name (dsturtevant)
|
||||
* Fix autoconf a bit better, especially on windows and solaris (ajenjo)
|
||||
* BUG FIX: gflags_nothreads was linking against the wrong lib (ajenjo)
|
||||
* BUG FIX: threads-detection failed on FreeBSD; replace it (ajenjo)
|
||||
* PORTABILITY: Quiet an internal compiler error with SUSE 10 (csilvers)
|
||||
* PORTABILITY: Update deb.sh for more recenty debuilds (csilvers)
|
||||
* PORTABILITY: #include more headers to satify new gcc's (csilvers)
|
||||
* INSTALL: Updated to autoconf 2.61 and libtool 1.5.26 (csilvers)
|
||||
|
||||
Fri Oct 3 15:16:46 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.0
|
||||
* Add a missing newline to an error string (bcmills)
|
||||
* (otherwise exactly the same as gflags 1.0rc2)
|
||||
|
||||
Thu Sep 18 12:58:05 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.0rc2
|
||||
* Report current flag values in --helpxml (hdn)
|
||||
* Fix compilation troubles with gcc 4.3.3 (simonb)
|
||||
* BUG FIX: I was missing a std:: in DECLARE_string (csilvers)
|
||||
* BUG FIX: Clarify in docs how to specify --bool flags (csilvers)
|
||||
* BUG FIX: Fix --helpshort for source files not in a subdir (csilvers)
|
||||
* BUG FIX: Fix python unittest for 64-bit builds (bcmills)
|
||||
|
||||
Tue Aug 19 16:15:48 2008
|
||||
|
||||
* google-gflags: version 1.0rc1
|
||||
* Move #include files from google/ to gflags/ (csilvers)
|
||||
* Small optimizations to reduce binary (library) size (jyrki)
|
||||
* BUGFIX: forgot a std:: in one of the .h files (csilvers)
|
||||
* Speed up locking by making sure calls are inlined (ajenjo)
|
||||
* 64-BIT COMPATIBILITY: Use %PRId64 instead of %lld (csilvers)
|
||||
* PORTABILITY: fix Makefile to work with Cygwin (ajenjo)
|
||||
* PORTABILITY: fix code to compile under Visual Studio (ajenjo)
|
||||
* PORTABILITY: fix code to compile under Solaris 10 with CC (csilvers)
|
||||
|
||||
Mon Jul 21 23:01:38 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.9
|
||||
* Add the ability to validate a command-line flag (csilvers)
|
||||
* Add completion support for commandline flags in bash (daven)
|
||||
* Add -W compile flags to Makefile, when using gcc (csilvers)
|
||||
* Allow helpstring to be NULL (cristianoc)
|
||||
* Improved documentation of classes in the .cc file (csilvers)
|
||||
* Fix python bug with AppendFlagValues + shortnames (jjtswan)
|
||||
* Use bool instead of int for boolean flags in gflags.py (bcmills)
|
||||
* Simplify the way we declare flags, now more foolproof (csilvers)
|
||||
* Better error messages when bool flags collide (colohan)
|
||||
* Only evaluate DEFINE_foo macro args once (csilvers)
|
||||
|
||||
Wed Mar 26 15:20:18 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.8
|
||||
* Export DescribeOneFlag() in the API
|
||||
* Add support for automatic line wrapping at 80 cols for gflags.py
|
||||
* Bugfix: do not treat an isolated "-" the same as an isolated "--"
|
||||
* Update rpm spec to point to Google Code rather than sourceforge (!)
|
||||
* Improve documentation (including documenting thread-safety)
|
||||
* Improve #include hygiene
|
||||
* Improve testing
|
||||
|
||||
Thu Oct 18 11:33:20 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.7
|
||||
* Deal even more correctly with libpthread not linked in (csilvers)
|
||||
* Add STRIP_LOG, an improved DO_NOT_SHOW_COMMANDLINE_HELP (sioffe)
|
||||
* Be more accurate printing default flag values in --help (dsturtevant)
|
||||
* Reduce .o file size a bit by using shorter namespace names (jeff)
|
||||
* Use relative install path, so 'setup.py --home' works (csilvers)
|
||||
* Notice when a boolean flag has a non-boolean default (bnmouli)
|
||||
* Broaden --helpshort to match foo-main.cc and foo_main.cc (hendrie)
|
||||
* Fix "no modules match" message for --helpshort, etc (hendrie)
|
||||
|
||||
Wed Aug 15 07:35:51 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.6
|
||||
* Deal correctly with case that libpthread is not linked in (csilvers)
|
||||
* Update Makefile/tests so we pass "make distcheck" (csilvers)
|
||||
* Document and test that last assignment to a flag wins (wan)
|
||||
|
||||
Tue Jun 12 15:23:42 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.5
|
||||
* Include all m4 macros in the distribution (csilvers)
|
||||
* Python: Fix broken data_files field in setup.py (sidlon)
|
||||
* Python: better string serliaizing and unparsing (abo, csimmons)
|
||||
* Fix checks for NaN and inf to work with Mac OS X (csilvers)
|
||||
|
||||
Thu Apr 19 15:15:07 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.4
|
||||
* Remove is_default from GetCommandLineFlagInfo (csilvers)
|
||||
* Portability fixes: includes, strtoll, gcc4.3 errors (csilvers)
|
||||
* A few doc typo cleanups (csilvers)
|
||||
|
||||
Wed Mar 28 12:15:56 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.3
|
||||
* python portability fix: use popen instead of subprocess (csilvers)
|
||||
* Add is_default to CommandLineFlagInfo (pchien)
|
||||
* Make docs a bit prettier (csilvers)
|
||||
* Actually include the python files in the distribution! :-/ (csilvers)
|
||||
|
||||
Mon Jan 22 15:33:06 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.2
|
||||
* added support for python commandlineflags, as well as c++
|
||||
* gflags2man, a script to turn flags into a man page (dchristian)
|
||||
|
||||
Wed Dec 13 12:37:19 2006 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: initial release:
|
||||
The gflags 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.
|
190
ChangeLog.txt
Normal file
190
ChangeLog.txt
Normal file
|
@ -0,0 +1,190 @@
|
|||
* Wed Jan 25 2012 - Google Inc. <google-gflags@googlegroups.com>
|
||||
|
||||
- gflags: version 2.0
|
||||
- Changed the 'official' gflags email in setup.py/etc
|
||||
- Renamed google-gflags.sln to gflags.sln
|
||||
- Changed copyright text to reflect Google's relinquished ownership
|
||||
|
||||
* Tue Dec 20 2011 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.7
|
||||
- Add CommandLineFlagInfo::flag_ptr pointing to current storage (musji)
|
||||
- PORTING: flush after writing to stderr, needed on cygwin
|
||||
- PORTING: Clean up the GFLAGS_DLL_DECL stuff better
|
||||
- Fix a bug in StringPrintf() that affected large strings (csilvers)
|
||||
- Die at configure-time when g++ isn't installed
|
||||
|
||||
* Fri Jul 29 2011 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.6
|
||||
- BUGFIX: Fix a bug where we were leaving out a required $(top_srcdir)
|
||||
- Fix definition of clstring (jyrki)
|
||||
- Split up flag declares into its own file (jyrki)
|
||||
- Add --version support (csilvers)
|
||||
- Update the README for gflags with static libs
|
||||
- Update acx_pthread.m4 for nostdlib
|
||||
- Change ReparseCommandLineFlags to return void (csilvers)
|
||||
- Some doc typofixes and example augmentation (various)
|
||||
|
||||
* Mon Jan 24 2011 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.5
|
||||
- Better reporting of current vs default value (handler)
|
||||
- Add API for cleaning up of memory at program-exit (jmarantz)
|
||||
- Fix macros to work inside namespaces (csilvers)
|
||||
- Use our own string typedef in case string is redefined (csilvers)
|
||||
- Updated to autoconf 2.65
|
||||
|
||||
* Wed Oct 13 2010 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.4
|
||||
- Add a check to prevent passing 0 to DEFINE_string (jorg)
|
||||
- Reduce compile (.o) size (jyrki)
|
||||
- Some small changes to quiet debug compiles (alexk)
|
||||
- PORTING: better support static linking on windows (csilvers)
|
||||
- DOCUMENTATION: change default values, use validators, etc.
|
||||
- Update the NEWS file to be non-empty
|
||||
- Add pkg-config (.pc) files for libgflags and libgflags_nothreads
|
||||
|
||||
* Mon Jan 4 2010 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.3
|
||||
- PORTABILITY: can now build and run tests under MSVC (csilvers)
|
||||
- Remove the python gflags code, which is now its own package (tansell)
|
||||
- Clarify that "last flag wins" in the docs (csilvers)
|
||||
- Comment danger of using GetAllFlags in validators (wojtekm)
|
||||
- PORTABILITY: Some fixes necessary for c++0x (mboerger)
|
||||
- Makefile fix: $(srcdir) -> $(top_srcdir) in one place (csilvres)
|
||||
- INSTALL: autotools to autoconf v2.64 + automake v1.11 (csilvers)
|
||||
|
||||
* Thu Sep 10 2009 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.2
|
||||
- PORTABILITY: can now build and run tests under mingw (csilvers)
|
||||
- Using a string arg for a bool flag is a compile-time error (rbayardo)
|
||||
- Add --helpxml to gflags.py (salcianu)
|
||||
- Protect against a hypothetical global d'tor mutex problem (csilvers)
|
||||
- BUGFIX: can now define a flag after 'using namespace google' (hamaji)
|
||||
|
||||
* Tue Apr 14 2009 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.1
|
||||
- Add both foo and nofoo for boolean flags, with --undefok (andychu)
|
||||
- Better document how validators work (wojtekm)
|
||||
- Improve binary-detection for bash-completion (mtamsky)
|
||||
- Python: Add a concept of "key flags", used with --help (salcianu)
|
||||
- Python: Robustify flag_values (salcianu)
|
||||
- Python: Add a new DEFINE_bool alias (keir, andrewliu)
|
||||
- Python: Do module introspection based on module name (dsturtevant)
|
||||
- Fix autoconf a bit better, especially on windows and solaris (ajenjo)
|
||||
- BUG FIX: gflags_nothreads was linking against the wrong lib (ajenjo)
|
||||
- BUG FIX: threads-detection failed on FreeBSD; replace it (ajenjo)
|
||||
- PORTABILITY: Quiet an internal compiler error with SUSE 10 (csilvers)
|
||||
- PORTABILITY: Update deb.sh for more recenty debuilds (csilvers)
|
||||
- PORTABILITY: #include more headers to satify new gcc's (csilvers)
|
||||
- INSTALL: Updated to autoconf 2.61 and libtool 1.5.26 (csilvers)
|
||||
|
||||
* Fri Oct 3 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.0
|
||||
- Add a missing newline to an error string (bcmills)
|
||||
- (otherwise exactly the same as gflags 1.0rc2)
|
||||
|
||||
* Thu Sep 18 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.0rc2
|
||||
- Report current flag values in --helpxml (hdn)
|
||||
- Fix compilation troubles with gcc 4.3.3 (simonb)
|
||||
- BUG FIX: I was missing a std:: in DECLARE_string (csilvers)
|
||||
- BUG FIX: Clarify in docs how to specify --bool flags (csilvers)
|
||||
- BUG FIX: Fix --helpshort for source files not in a subdir (csilvers)
|
||||
- BUG FIX: Fix python unittest for 64-bit builds (bcmills)
|
||||
|
||||
* Tue Aug 19 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.0rc1
|
||||
- Move #include files from google/ to gflags/ (csilvers)
|
||||
- Small optimizations to reduce binary (library) size (jyrki)
|
||||
- BUGFIX: forgot a std:: in one of the .h files (csilvers)
|
||||
- Speed up locking by making sure calls are inlined (ajenjo)
|
||||
- 64-BIT COMPATIBILITY: Use %PRId64 instead of %lld (csilvers)
|
||||
- PORTABILITY: fix Makefile to work with Cygwin (ajenjo)
|
||||
- PORTABILITY: fix code to compile under Visual Studio (ajenjo)
|
||||
- PORTABILITY: fix code to compile under Solaris 10 with CC (csilvers)
|
||||
|
||||
* Mon Jul 21 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.9
|
||||
- Add the ability to validate a command-line flag (csilvers)
|
||||
- Add completion support for commandline flags in bash (daven)
|
||||
- Add -W compile flags to Makefile, when using gcc (csilvers)
|
||||
- Allow helpstring to be NULL (cristianoc)
|
||||
- Improved documentation of classes in the .cc file (csilvers)
|
||||
- Fix python bug with AppendFlagValues + shortnames (jjtswan)
|
||||
- Use bool instead of int for boolean flags in gflags.py (bcmills)
|
||||
- Simplify the way we declare flags, now more foolproof (csilvers)
|
||||
- Better error messages when bool flags collide (colohan)
|
||||
- Only evaluate DEFINE_foo macro args once (csilvers)
|
||||
|
||||
* Wed Mar 26 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.8
|
||||
- Export DescribeOneFlag() in the API
|
||||
- Add support for automatic line wrapping at 80 cols for gflags.py
|
||||
- Bugfix: do not treat an isolated "-" the same as an isolated "--"
|
||||
- Update rpm spec to point to Google Code rather than sourceforge (!)
|
||||
- Improve documentation (including documenting thread-safety)
|
||||
- Improve #include hygiene
|
||||
- Improve testing
|
||||
|
||||
* Thu Oct 18 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.7
|
||||
- Deal even more correctly with libpthread not linked in (csilvers)
|
||||
- Add STRIP_LOG, an improved DO_NOT_SHOW_COMMANDLINE_HELP (sioffe)
|
||||
- Be more accurate printing default flag values in --help (dsturtevant)
|
||||
- Reduce .o file size a bit by using shorter namespace names (jeff)
|
||||
- Use relative install path, so 'setup.py --home' works (csilvers)
|
||||
- Notice when a boolean flag has a non-boolean default (bnmouli)
|
||||
- Broaden --helpshort to match foo-main.cc and foo_main.cc (hendrie)
|
||||
- Fix "no modules match" message for --helpshort, etc (hendrie)
|
||||
|
||||
* Wed Aug 15 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.6
|
||||
- Deal correctly with case that libpthread is not linked in (csilvers)
|
||||
- Update Makefile/tests so we pass "make distcheck" (csilvers)
|
||||
- Document and test that last assignment to a flag wins (wan)
|
||||
|
||||
* Tue Jun 12 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.5
|
||||
- Include all m4 macros in the distribution (csilvers)
|
||||
- Python: Fix broken data_files field in setup.py (sidlon)
|
||||
- Python: better string serliaizing and unparsing (abo, csimmons)
|
||||
- Fix checks for NaN and inf to work with Mac OS X (csilvers)
|
||||
|
||||
* Thu Apr 19 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.4
|
||||
- Remove is_default from GetCommandLineFlagInfo (csilvers)
|
||||
- Portability fixes: includes, strtoll, gcc4.3 errors (csilvers)
|
||||
- A few doc typo cleanups (csilvers)
|
||||
|
||||
* Wed Mar 28 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.3
|
||||
- python portability fix: use popen instead of subprocess (csilvers)
|
||||
- Add is_default to CommandLineFlagInfo (pchien)
|
||||
- Make docs a bit prettier (csilvers)
|
||||
- Actually include the python files in the distribution! :-/ (csilvers)
|
||||
|
||||
* Mon Jan 22 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.2
|
||||
- added support for python commandlineflags, as well as c++
|
||||
- gflags2man, a script to turn flags into a man page (dchristian)
|
||||
|
||||
* Wed Dec 13 2006 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.1
|
|
@ -3,9 +3,9 @@ INSTALLING A BINARY DISTRIBUTION PACKAGE
|
|||
========================================
|
||||
|
||||
No official binary distribution packages are provided by the gflags developers.
|
||||
There may, however, be binary packages available for your OS, in particular
|
||||
for various flavors of Linux. Please consult the package repositories of your
|
||||
Linux distribution to see if a binary package is available.
|
||||
There may, however, be binary packages available for your OS at
|
||||
https://code.google.com/p/gflags/downloads/list. Please consult also the
|
||||
package repositories of your Linux distribution.
|
||||
|
||||
For example on Debian/Ubuntu Linux, gflags can be installed using the
|
||||
following command:
|
5
README
5
README
|
@ -1,5 +0,0 @@
|
|||
This repository contains the C++ implementation of the commandline flags module
|
||||
originally developed at Google. Documentation for this module is in doc/.
|
||||
The python version of gflags is now a separate project.
|
||||
|
||||
See INSTALL for (generic) installation instructions.
|
6
README.txt
Normal file
6
README.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
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.
|
4
cmake/README_runtime.txt
Normal file
4
cmake/README_runtime.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
This package contains runtime libraries only which are required
|
||||
by applications that use these libraries for the commandline flags
|
||||
processing. If you want to develop such application, download
|
||||
and install the development package instead.
|
66
cmake/package.cmake.in
Normal file
66
cmake/package.cmake.in
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Per-generator CPack configuration file. See CPACK_PROJECT_CONFIG_FILE documented at
|
||||
# http://www.cmake.org/cmake/help/v2.8.12/cpack.html#variable:CPACK_PROJECT_CONFIG_FILE
|
||||
#
|
||||
# All common CPACK_* variables are set in CMakeLists.txt already. This file only
|
||||
# overrides some of these to provide package generator specific settings.
|
||||
|
||||
# whether package contains all development files or only runtime files
|
||||
set (DEVEL @INSTALL_HEADERS@)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Mac OS X package
|
||||
if (CPACK_GENERATOR MATCHES "PackageMaker|DragNDrop")
|
||||
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
||||
if (DEVEL)
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-devel")
|
||||
endif ()
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_VERSION}")
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Debian package
|
||||
elseif (CPACK_GENERATOR MATCHES "DEB")
|
||||
|
||||
set (CPACK_PACKAGE_FILE_NAME "lib${CPACK_PACKAGE_NAME}")
|
||||
if (DEVEL)
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-dev")
|
||||
else ()
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}0")
|
||||
endif ()
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_PACKAGE_VERSION}-1_${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
execute_process (
|
||||
COMMAND dpkg --print-architecture
|
||||
RESULT_VARIABLE RV
|
||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||
)
|
||||
if (NOT RV EQUAL 0)
|
||||
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
|
||||
endif ()
|
||||
|
||||
set (CPACK_DEBIAN_PACKAGE_DEPENDS)
|
||||
set (CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||
set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_RPM_PACKAGE_URL}")
|
||||
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}")
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# RPM package
|
||||
elseif (CPACK_GENERATOR MATCHES "RPM")
|
||||
|
||||
execute_process (
|
||||
COMMAND dpkg --print-architecture
|
||||
RESULT_VARIABLE RV
|
||||
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
|
||||
)
|
||||
if (NOT RV EQUAL 0)
|
||||
set (CPACK_RPM_PACKAGE_ARCHITECTURE i386)
|
||||
endif ()
|
||||
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
||||
if (DEVEL)
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-devel")
|
||||
endif ()
|
||||
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_VERSION}-1_${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
endif ()
|
|
@ -86,8 +86,10 @@
|
|||
// ---------------------------------------------------------------------------
|
||||
// Windows
|
||||
|
||||
// Whether gflags library is shared.
|
||||
#define GFLAGS_IS_A_DLL @GFLAGS_IS_A_DLL@
|
||||
// Whether gflags library is a DLL.
|
||||
#ifndef GFLAGS_IS_A_DLL
|
||||
# define GFLAGS_IS_A_DLL 0
|
||||
#endif
|
||||
|
||||
// Always export symbols when compiling a shared library as this file is only
|
||||
// included by internal modules when building the gflags library itself.
|
||||
|
|
0
src/gflags.cc
Executable file → Normal file
0
src/gflags.cc
Executable file → Normal file
|
@ -12,7 +12,17 @@ set (GFLAGS_FLAGFILES_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|||
# ----------------------------------------------------------------------------
|
||||
# common include directories and link libraries
|
||||
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
link_libraries (gflags_nothreads)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set (type shared)
|
||||
else ()
|
||||
set (type static)
|
||||
endif ()
|
||||
if (BUILD_gflags_LIB)
|
||||
link_libraries (gflags-${type})
|
||||
else ()
|
||||
link_libraries (gflags_nothreads-${type})
|
||||
endif ()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# STRIP_FLAG_HELP
|
||||
|
@ -35,7 +45,7 @@ add_executable (gflags_unittest gflags_unittest.cc)
|
|||
add_executable (gflags_unittest-main gflags_unittest-main.cc)
|
||||
add_executable (gflags_unittest_main gflags_unittest_main.cc)
|
||||
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
if (OS_WINDOWS)
|
||||
set (SLASH "\\\\")
|
||||
else ()
|
||||
set (SLASH "/")
|
||||
|
@ -146,11 +156,11 @@ add_gflags_test(always_fail 1 "ERROR: failed validation of new value 'true' for
|
|||
|
||||
# ----------------------------------------------------------------------------
|
||||
# (negative) compilation tests
|
||||
if (BUILD_NEGATIVE_COMPILATION_TESTS)
|
||||
if (BUILD_NC_TESTS)
|
||||
find_package (PythonInterp)
|
||||
if (NOT PYTHON_EXECUTABLE)
|
||||
message (FATAL_ERROR "No Python installation found! It is required by the negative compilation tests."
|
||||
" Either install Python or set NEGATIVE_COMPILATION_TESTS to FALSE and try again.")
|
||||
" Either install Python or set BUILD_NC_TESTS to FALSE and try again.")
|
||||
endif ()
|
||||
set (SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/nc")
|
||||
configure_file (gflags_nc.py.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/nc.py" @ONLY)
|
||||
|
@ -165,4 +175,4 @@ if (BUILD_NEGATIVE_COMPILATION_TESTS)
|
|||
add_gflags_nc_test (int_instead_of_bool)
|
||||
add_gflags_nc_test (bool_in_quotes)
|
||||
add_gflags_nc_test (define_string_with_0)
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
Loading…
Add table
Reference in a new issue