summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schuh <andreas.schuh.84@gmail.com>2013-04-21 03:09:43 +0100
committerAndreas Schuh <andreas.schuh.84@gmail.com>2013-04-21 03:09:43 +0100
commit3624d33ae5d8b4bc5dd0880a0c2b5d87124c9e3c (patch)
tree3219b8ac474a6c3ed6e5186d87991e054fe1e483
parent392eb67dbf63cb96317eaef9d3370a824d7c4ade (diff)
downloadgflags-3624d33ae5d8b4bc5dd0880a0c2b5d87124c9e3c.tar.gz
gflags-3624d33ae5d8b4bc5dd0880a0c2b5d87124c9e3c.tar.bz2
gflags-3624d33ae5d8b4bc5dd0880a0c2b5d87124c9e3c.zip
Set CMAKE_BUILD_TYPE to Release by default. Require CMake >=2.8.
-rw-r--r--CMakeLists.txt45
1 files changed, 26 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ceaf94..2aa5cec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,4 @@
-cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
-
+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
# ----------------------------------------------------------------------------
# package information
@@ -19,23 +18,13 @@ option (BUILD_SHARED_LIBS "Request build of shared libraries." OFF)
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
@@ -82,6 +71,24 @@ if (Threads_FOUND)
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))")