diff cmake/IrccdSystem.cmake @ 207:6635b9187d71

Irccd: switch to 4 spaces indent, #518
author David Demelier <markand@malikania.fr>
date Tue, 21 Jun 2016 20:52:17 +0200
parents c1acfacc46bd
children e9adab218027
line wrap: on
line diff
--- a/cmake/IrccdSystem.cmake	Tue Jun 21 12:36:46 2016 +0200
+++ b/cmake/IrccdSystem.cmake	Tue Jun 21 20:52:17 2016 +0200
@@ -32,49 +32,49 @@
 # instead.
 #
 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-	#
-	# For GCC, we require at least GCC 5.1
-	#
-	if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1")
-		message(FATAL_ERROR "You need at least GCC 5.1")
-	endif ()
+    #
+    # For GCC, we require at least GCC 5.1
+    #
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1")
+        message(FATAL_ERROR "You need at least GCC 5.1")
+    endif ()
 
-	set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++14 ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++14 ${CMAKE_CXX_FLAGS}")
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-	#
-	# LLVM/clang implemented C++14 starting from version 3.4 but the
-	# switch -std=c++14 was not available.
-	#
-	if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4")
-		message(FATAL_ERROR "You need at least Clang 3.4")
-	endif ()
+    #
+    # LLVM/clang implemented C++14 starting from version 3.4 but the
+    # switch -std=c++14 was not available.
+    #
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4")
+        message(FATAL_ERROR "You need at least Clang 3.4")
+    endif ()
 
-	if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5")
-		set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++1y ${CMAKE_CXX_FLAGS}")
-	else ()
-		set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++14 ${CMAKE_CXX_FLAGS}")
-	endif ()
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5")
+        set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++1y ${CMAKE_CXX_FLAGS}")
+    else ()
+        set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++14 ${CMAKE_CXX_FLAGS}")
+    endif ()
 elseif (MSVC14)
-	set(CMAKE_C_FLAGS "/DWIN32_LEAN_AND_MEAN /DNOMINMAX /wd4267 /wd4800 /D_CRT_SECURE_NO_WARNINGS ${CMAKE_C_FLAGS}")
-	set(CMAKE_CXX_FLAGS "/DWIN32_LEAN_AND_MEAN /DNOMINMAX /wd4267 /wd4800 /D_CRT_SECURE_NO_WARNINGS /EHsc ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_C_FLAGS "/DWIN32_LEAN_AND_MEAN /DNOMINMAX /wd4267 /wd4800 /D_CRT_SECURE_NO_WARNINGS ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "/DWIN32_LEAN_AND_MEAN /DNOMINMAX /wd4267 /wd4800 /D_CRT_SECURE_NO_WARNINGS /EHsc ${CMAKE_CXX_FLAGS}")
 else ()
-	message(WARNING "Unsupported ${CMAKE_CXX_COMPILER_ID}, may not build correctly.")
+    message(WARNING "Unsupported ${CMAKE_CXX_COMPILER_ID}, may not build correctly.")
 endif ()
 
 if (MINGW)
-	set(CMAKE_CXX_FLAGS "-D_WIN32_WINNT=0x0600 ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-D_WIN32_WINNT=0x0600 ${CMAKE_CXX_FLAGS}")
 endif ()
 
 if (CMAKE_SIZEOF_VOID_P MATCHES "8")
-	set(IRCCD_64BITS TRUE)
+    set(IRCCD_64BITS TRUE)
 else ()
-	set(IRCCD_64BITS FALSE)
+    set(IRCCD_64BITS FALSE)
 endif ()
 
 set(IRCCD_FAKEROOTDIR ${CMAKE_BINARY_DIR}/fakeroot)
 
 if (NOT EXISTS ${IRCCD_FAKEROOTDIR})
-	file(MAKE_DIRECTORY ${IRCCD_FAKEROOTDIR})
+    file(MAKE_DIRECTORY ${IRCCD_FAKEROOTDIR})
 endif ()
 
 # ---------------------------------------------------------
@@ -82,17 +82,17 @@
 # ---------------------------------------------------------
 
 if (WIN32)
-	set(IRCCD_SYSTEM_WINDOWS TRUE)
+    set(IRCCD_SYSTEM_WINDOWS TRUE)
 elseif (APPLE)
-	set(IRCCD_SYSTEM_MAC TRUE)
+    set(IRCCD_SYSTEM_MAC TRUE)
 elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
-	set(IRCCD_SYSTEM_FREEBSD TRUE)
+    set(IRCCD_SYSTEM_FREEBSD TRUE)
 elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
-	set(IRCCD_SYSTEM_NETBSD TRUE)
+    set(IRCCD_SYSTEM_NETBSD TRUE)
 elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
-	set(IRCCD_SYSTEM_OPENBSD TRUE)
+    set(IRCCD_SYSTEM_OPENBSD TRUE)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
-	set(IRCCD_SYSTEM_LINUX TRUE)
+    set(IRCCD_SYSTEM_LINUX TRUE)
 endif ()
 
 # ---------------------------------------------------------
@@ -109,7 +109,7 @@
 check_type_size(uint64_t HAVE_UINT64)
 
 if (NOT HAVE_STDINT_H)
-	message("irccd requires stdint.h or cstdint header")
+    message("irccd requires stdint.h or cstdint header")
 endif ()
 
 #
@@ -117,26 +117,26 @@
 #
 # The following variables are defined in irccd/sysconfig.h
 #
-# HAVE_ACCESS		- True if has access(2) function (and sys/types.h and sys/stat.h),
-# HAVE_DAEMON		- True if daemon(3),
-# HAVE_GETPID		- True if has getpid(2) function (and sys/types.h and unistd.h and grp.h),
-# HAVE_POPEN		- True if has popen(3) function (in stdio.h)
-# HAVE_SETGID		- True if has setgid(2) function and getgrnam(3) (and sys/types.h and unistd.h and pwd.h),
-# HAVE_SETPROGNAME	- True if setprogname(3) is available from C library,
-# HAVE_SETUID		- True if has setuid(2) function and getpwnam(3) (and sys/types.h and unistd.h and pwd.h),
-# HAVE_STAT		- True if has stat(2) function (and sys/types.h and sys/stat.h),
-# HAVE_STAT_ST_DEV	- The struct stat has st_dev field,
-# HAVE_STAT_ST_INO	- The struct stat has st_ino field,
-# HAVE_STAT_ST_NLINK	- The struct stat has st_nlink field,
-# HAVE_STAT_ST_UID	- The struct stat has st_uid field,
-# HAVE_STAT_ST_GID	- The struct stat has st_gid field,
-# HAVE_STAT_ST_ATIME	- The struct stat has st_atime field,
-# HAVE_STAT_ST_MTIME	- The struct stat has st_mtime field,
-# HAVE_STAT_ST_CTIME	- The struct stat has st_ctime field,
-# HAVE_STAT_ST_SIZE	- The struct stat has st_size field,
-# HAVE_STAT_ST_BLKSIZE	- The struct stat has st_blksize field,
-# HAVE_STAT_ST_BLOCKS	- The struct stat has st_blocks field,
-# HAVE_SYSLOG		- True if syslog functions are available (and syslog.h),
+# HAVE_ACCESS           True if has access(2) function (and sys/types.h and sys/stat.h),
+# HAVE_DAEMON           True if daemon(3),
+# HAVE_GETPID           True if has getpid(2) function (and sys/types.h and unistd.h and grp.h),
+# HAVE_POPEN            True if has popen(3) function (in stdio.h)
+# HAVE_SETGID           True if has setgid(2) function and getgrnam(3) (and sys/types.h and unistd.h and pwd.h),
+# HAVE_SETPROGNAME      True if setprogname(3) is available from C library,
+# HAVE_SETUID           True if has setuid(2) function and getpwnam(3) (and sys/types.h and unistd.h and pwd.h),
+# HAVE_STAT             True if has stat(2) function (and sys/types.h and sys/stat.h),
+# HAVE_STAT_ST_DEV      The struct stat has st_dev field,
+# HAVE_STAT_ST_INO      The struct stat has st_ino field,
+# HAVE_STAT_ST_NLINK    The struct stat has st_nlink field,
+# HAVE_STAT_ST_UID      The struct stat has st_uid field,
+# HAVE_STAT_ST_GID      The struct stat has st_gid field,
+# HAVE_STAT_ST_ATIME    The struct stat has st_atime field,
+# HAVE_STAT_ST_MTIME    The struct stat has st_mtime field,
+# HAVE_STAT_ST_CTIME    The struct stat has st_ctime field,
+# HAVE_STAT_ST_SIZE     The struct stat has st_size field,
+# HAVE_STAT_ST_BLKSIZE  The struct stat has st_blksize field,
+# HAVE_STAT_ST_BLOCKS   The struct stat has st_blocks field,
+# HAVE_SYSLOG           True if syslog functions are available (and syslog.h),
 #
 
 # Check for unistd.h
@@ -163,7 +163,7 @@
 check_function_exists(access HAVE_ACCESS)
 
 if (NOT HAVE_UNISTD_H)
-	set(HAVE_ACCESS FALSE)
+    set(HAVE_ACCESS FALSE)
 endif ()
 
 # getpid() function
@@ -175,7 +175,7 @@
 check_function_exists(getpid HAVE_GETPID)
 
 if (NOT HAVE_UNISTD_H OR NOT HAVE_SYS_TYPES_H)
-	set(HAVE_GETPID FALSE)
+    set(HAVE_GETPID FALSE)
 endif ()
 
 # setgid() function (and getgrnam)
@@ -184,13 +184,13 @@
 #
 # #include <sys/types.h>
 # #include <unistd.h>
-# #include <grp.h>		// only for getgrnam
+# #include <grp.h>        // only for getgrnam
 check_include_file(grp.h HAVE_GRP_H)
 check_function_exists(getgrnam HAVE_GETGRNAM)
 check_function_exists(setgid HAVE_SETGID)
 
 if (NOT HAVE_UNISTD_H OR NOT HAVE_SYS_TYPES_H OR NOT HAVE_GETGRNAM OR NOT HAVE_GRP_H)
-	set(HAVE_SETGID FALSE)
+    set(HAVE_SETGID FALSE)
 endif ()
 
 # popen() function
@@ -206,13 +206,13 @@
 #
 # #include <sys/types.h>
 # #include <unistd.h>
-# #include <pwd.h>		// only for getpwnam
+# #include <pwd.h>        // only for getpwnam
 check_include_file(pwd.h HAVE_PWD_H)
 check_function_exists(getpwnam HAVE_GETPWNAM)
 check_function_exists(setuid HAVE_SETUID)
 
 if (NOT HAVE_UNISTD_H OR NOT HAVE_SYS_TYPES_H OR NOT HAVE_GETPWNAM OR NOT HAVE_PWD_H)
-	set(HAVE_SETUID FALSE)
+    set(HAVE_SETUID FALSE)
 endif ()
 
 # stat(2) function
@@ -226,7 +226,7 @@
 
 # If the sys/stat.h is not found, we disable stat(2)
 if (NOT HAVE_SYS_STAT_H OR NOT HAVE_SYS_TYPES_H)
-	set(HAVE_STAT FALSE)
+    set(HAVE_STAT FALSE)
 endif ()
 
 # syslog functions
@@ -240,7 +240,7 @@
 check_function_exists(closelog HAVE_CLOSELOG)
 
 if (NOT HAVE_SYSLOG_H OR NOT HAVE_OPENLOG OR NOT HAVE_CLOSELOG)
-	set(HAVE_SYSLOG FALSE)
+    set(HAVE_SYSLOG FALSE)
 endif ()
 
 # Check for struct stat fields.
@@ -260,6 +260,6 @@
 
 # Configuration file.
 configure_file(
-	${CMAKE_CURRENT_LIST_DIR}/internal/sysconfig.hpp.in
-	${IRCCD_FAKEROOTDIR}/include/irccd/sysconfig.hpp
+    ${CMAKE_CURRENT_LIST_DIR}/internal/sysconfig.hpp.in
+    ${IRCCD_FAKEROOTDIR}/include/irccd/sysconfig.hpp
 )