-cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
-
+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
# ----------------------------------------------------------------------------
# package information
set (GFLAGS_NAMESPACE "gflags" CACHE STRING "C++ namespace identifier of gflags library.")
mark_as_advanced (GFLAGS_NAMESPACE)
-# ----------------------------------------------------------------------------
-# source files - excluding root subdirectory and/or .in suffix
-set (PUBLIC_HDRS
- "gflags/gflags.h"
- "gflags/gflags_declare.h"
- "gflags/gflags_completions.h"
-)
-
-set (PRIVATE_HDRS
- "config.h"
-)
-
-set (GFLAGS_SRCS
- "gflags.cc"
- "gflags_reporting.cc"
- "gflags_completions.cc"
-)
+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 ()
# ----------------------------------------------------------------------------
# system checks
endif ()
# ----------------------------------------------------------------------------
+# source files - excluding root subdirectory and/or .in suffix
+set (PUBLIC_HDRS
+ "gflags/gflags.h"
+ "gflags/gflags_declare.h"
+ "gflags/gflags_completions.h"
+)
+
+set (PRIVATE_HDRS
+ "config.h"
+)
+
+set (GFLAGS_SRCS
+ "gflags.cc"
+ "gflags_reporting.cc"
+ "gflags_completions.cc"
+)
+
+# ----------------------------------------------------------------------------
# configure source files
if (CMAKE_COMPILER_IS_GNUCXX)
set (__ATTRIBUTE__UNUSED "__attribute((unused))")