summaryrefslogtreecommitdiff
path: root/cmake/FindStatNsec.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindStatNsec.cmake')
-rw-r--r--cmake/FindStatNsec.cmake30
1 files changed, 12 insertions, 18 deletions
diff --git a/cmake/FindStatNsec.cmake b/cmake/FindStatNsec.cmake
index a4a09fa81..9dfdf51c4 100644
--- a/cmake/FindStatNsec.cmake
+++ b/cmake/FindStatNsec.cmake
@@ -1,26 +1,20 @@
-INCLUDE(FeatureSummary)
+include(FeatureSummary)
-CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtim "sys/types.h;sys/stat.h"
+check_struct_has_member("struct stat" st_mtim "sys/types.h;sys/stat.h"
HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C)
-CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtimespec "sys/types.h;sys/stat.h"
+check_struct_has_member("struct stat" st_mtimespec "sys/types.h;sys/stat.h"
HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE C)
-CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtime_nsec sys/stat.h
+check_struct_has_member("struct stat" st_mtime_nsec sys/stat.h
HAVE_STRUCT_STAT_MTIME_NSEC LANGUAGE C)
-IF (HAVE_STRUCT_STAT_ST_MTIM)
- CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec sys/stat.h
+if(HAVE_STRUCT_STAT_ST_MTIM)
+ check_struct_has_member("struct stat" st_mtim.tv_nsec sys/stat.h
HAVE_STRUCT_STAT_NSEC LANGUAGE C)
-ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC)
- CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec sys/stat.h
+elseif(HAVE_STRUCT_STAT_ST_MTIMESPEC)
+ check_struct_has_member("struct stat" st_mtimespec.tv_nsec sys/stat.h
HAVE_STRUCT_STAT_NSEC LANGUAGE C)
-ELSE ()
- SET( HAVE_STRUCT_STAT_NSEC ON )
-ENDIF()
+else()
+ set(HAVE_STRUCT_STAT_NSEC ON )
+endif()
-IF (HAVE_STRUCT_STAT_NSEC OR WIN32)
- OPTION( USE_NSEC "Care about sub-second file mtimes and ctimes" ON )
-ELSE()
- SET(USE_NSEC OFF)
-ENDIF()
-
-ADD_FEATURE_INFO(nanoseconds USE_NSEC "whether to use sub-second file mtimes and ctimes")
+add_feature_info(nanoseconds USE_NSEC "support nanosecond precision file mtimes and ctimes")