]> granicus.if.org Git - taglib/commitdiff
Don't look for CppUnit unless BUILD_TESTS, general cleanup.
authorFestus Hagen <festushagen2002@yahoo.com>
Wed, 20 May 2015 05:16:54 +0000 (01:16 -0400)
committerFestus Hagen <festushagen2002@yahoo.com>
Wed, 20 May 2015 15:11:55 +0000 (11:11 -0400)
ConfigureChecks.cmake

index d436e358e2307a0586fadb55c88162d14822032c..1a7446fcad482b25fb532949b4ddb0b15a70449a 100644 (file)
@@ -9,39 +9,37 @@ include(TestBigEndian)
 include(TestFloatFormat)
 
 # Check if the size of numeric types are suitable.
-
 check_type_size("short" SIZEOF_SHORT)
 if(NOT ${SIZEOF_SHORT} EQUAL 2)
-  MESSAGE(FATAL_ERROR "TagLib requires that short is 16-bit wide.")
+  message(FATAL_ERROR "TagLib requires that short is 16-bit wide.")
 endif()
 
 check_type_size("int" SIZEOF_INT)
 if(NOT ${SIZEOF_INT} EQUAL 4)
-  MESSAGE(FATAL_ERROR "TagLib requires that int is 32-bit wide.")
+  message(FATAL_ERROR "TagLib requires that int is 32-bit wide.")
 endif()
 
 check_type_size("long long" SIZEOF_LONGLONG)
 if(NOT ${SIZEOF_LONGLONG} EQUAL 8)
-  MESSAGE(FATAL_ERROR "TagLib requires that long long is 64-bit wide.")
+  message(FATAL_ERROR "TagLib requires that long long is 64-bit wide.")
 endif()
 
 check_type_size("wchar_t" SIZEOF_WCHAR_T)
 if(${SIZEOF_WCHAR_T} LESS 2)
-  MESSAGE(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.")
+  message(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.")
 endif()
 
 check_type_size("float" SIZEOF_FLOAT)
 if(NOT ${SIZEOF_FLOAT} EQUAL 4)
-  MESSAGE(FATAL_ERROR "TagLib requires that float is 32-bit wide.")
+  message(FATAL_ERROR "TagLib requires that float is 32-bit wide.")
 endif()
 
 check_type_size("double" SIZEOF_DOUBLE)
 if(NOT ${SIZEOF_DOUBLE} EQUAL 8)
-  MESSAGE(FATAL_ERROR "TagLib requires that double is 64-bit wide.")
+  message(FATAL_ERROR "TagLib requires that double is 64-bit wide.")
 endif()
 
 # Determine the CPU byte order.
-
 test_big_endian(IS_BIG_ENDIAN)
 
 if(NOT IS_BIG_ENDIAN)
@@ -51,19 +49,16 @@ else()
 endif()
 
 # Check if the format of floating point types are suitable.
-
 test_float_format(FP_IEEE754)
 if(${FP_IEEE754} EQUAL 1)
   set(FLOAT_BYTEORDER 1)
 elseif(${FP_IEEE754} EQUAL 2)
   set(FLOAT_BYTEORDER 2)
 else()
-  MESSAGE(FATAL_ERROR "TagLib requires that floating point types are IEEE754 compliant.")
+  message(FATAL_ERROR "TagLib requires that floating point types are IEEE754 compliant.")
 endif()
 
-
 # Determine which kind of atomic operations your compiler supports.
-
 check_cxx_source_compiles("
   #include <atomic>
   int main() {
@@ -207,21 +202,27 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP
 endif()
 
 # Determine whether your compiler supports some safer version of sprintf.
-
 check_cxx_source_compiles("
   #include <cstdio>
-  int main() { char buf[20]; snprintf(buf, 20, \"%d\", 1); return 0; }
+  int main() {
+    char buf[20];
+    snprintf(buf, 20, \"%d\", 1);
+    return 0;
+  }
 " HAVE_SNPRINTF)
 
 if(NOT HAVE_SNPRINTF)
   check_cxx_source_compiles("
     #include <cstdio>
-    int main() { char buf[20]; sprintf_s(buf, \"%d\", 1);  return 0; }
+    int main() {
+      char buf[20];
+      sprintf_s(buf, \"%d\", 1);
+      return 0;
+    }
   " HAVE_SPRINTF_S)
 endif()
 
 # Check for libz using the cmake supplied FindZLIB.cmake
-
 if(NOT ZLIB_SOURCE)
   find_package(ZLIB)
   if(ZLIB_FOUND)
@@ -231,8 +232,11 @@ if(NOT ZLIB_SOURCE)
   endif()
 endif()
 
-find_package(CppUnit)
-if(NOT CppUnit_FOUND AND BUILD_TESTS)
-  message(STATUS "CppUnit not found, disabling tests.")
-  set(BUILD_TESTS OFF)
+if(BUILD_TESTS)
+  find_package(CppUnit)
+  if(NOT CppUnit_FOUND AND BUILD_TESTS)
+    message(STATUS "CppUnit not found, disabling tests.")
+    set(BUILD_TESTS OFF)
+  endif()
 endif()
+