# ----------------------------------------------------------------------------
# source files - excluding root subdirectory and/or .in suffix
set (PUBLIC_HDRS
- "gflags/gflags.h"
- "gflags/gflags_declare.h"
- "gflags/gflags_completions.h"
+ "gflags.h"
+ "gflags_declare.h"
+ "gflags_completions.h"
)
set (PRIVATE_HDRS
set (__ATTRIBUTE__UNUSED)
endif ()
-function (configure_sources out subdir)
+function (configure_sources out)
set (tmp)
foreach (src IN LISTS ARGN)
- set (src "${subdir}/${src}")
- if (EXISTS "${PROJECT_SOURCE_DIR}/${src}.in")
- configure_file ("${PROJECT_SOURCE_DIR}/${src}.in" "${PROJECT_BINARY_DIR}/${src}" @ONLY)
- list (APPEND tmp "${PROJECT_BINARY_DIR}/${src}")
+ 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}")
else ()
- list (APPEND tmp "${PROJECT_SOURCE_DIR}/${src}")
+ list (APPEND tmp "${PROJECT_SOURCE_DIR}/src/${src}")
endif ()
endforeach ()
set (${out} "${tmp}" PARENT_SCOPE)
endfunction ()
-configure_sources (PUBLIC_HDRS include ${PUBLIC_HDRS})
-configure_sources (PRIVATE_HDRS src ${PRIVATE_HDRS})
-configure_sources (GFLAGS_SRCS src ${GFLAGS_SRCS})
+configure_sources (PUBLIC_HDRS ${PUBLIC_HDRS})
+configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS})
+configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS})
# ----------------------------------------------------------------------------
# output directories
# ----------------------------------------------------------------------------
# add library target
-include_directories (
- "${PROJECT_BINARY_DIR}/include"
- "${PROJECT_SOURCE_DIR}/include"
- "${PROJECT_BINARY_DIR}/src"
- "${PROJECT_SOURCE_DIR}/src"
-)
-
if (WIN32)
add_definitions (-DGFLAGS_DLL_EXPORT)
endif ()
-
+include_directories ("${PROJECT_BINARY_DIR}/include")
+include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_NAMESPACE}")
add_library (gflags ${GFLAGS_SRCS})
# ----------------------------------------------------------------------------
# installation
install (TARGETS gflags DESTINATION lib)
-install (FILES ${PUBLIC_HDRS} DESTINATION include/gflags)
+install (FILES ${PUBLIC_HDRS} DESTINATION include/${GFLAGS_NAMESPACE})
// other hand, hooks into CommandLineFlagParser. Other API functions
// are, similarly, mostly hooks into the functionality described above.
-// This comes first to ensure we define __STDC_FORMAT_MACROS in time.
-#include <config.h>
-#if HAVE_INTTYPES_H && !defined(__STDC_FORMAT_MACROS)
-# define __STDC_FORMAT_MACROS 1 // gcc requires this to get PRId64, etc.
-#endif
+#include "config.h"
+#include "gflags.h"
-#include <gflags/gflags.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#if HAVE_FNMATCH_H
-# include <fnmatch.h>
+# include <fnmatch.h>
#endif
#include <stdarg.h> // For va_list and related operations
#include <stdio.h>
#include <string>
#include <utility> // for pair<>
#include <vector>
+
#include "mutex.h"
#include "util.h"
-#ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR '/'
-#endif
-
// Special flags, type 1: the 'recursive' flags. They set another flag's val.
DEFINE_string(flagfile, "",