summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2015-06-01 08:34:43 -0400
committerAllen Winter <allen.winter@kdab.com>2015-06-01 08:34:43 -0400
commit013047d93b6f523349e106bf5fafb09f9d8a120e (patch)
treeb3ac8048324e012eddd683dec5d79b788b898ce7
parentf8aa15bb83a93a3f616bfe23b626b0d50bc29169 (diff)
downloadlibical-git-013047d93b6f523349e106bf5fafb09f9d8a120e.tar.gz
cmake/modules - minor cleaning
-rw-r--r--cmake/modules/FindICU.cmake113
-rw-r--r--cmake/modules/FindWcecompat.cmake16
2 files changed, 66 insertions, 63 deletions
diff --git a/cmake/modules/FindICU.cmake b/cmake/modules/FindICU.cmake
index 01ff8a89..27302c9d 100644
--- a/cmake/modules/FindICU.cmake
+++ b/cmake/modules/FindICU.cmake
@@ -14,74 +14,77 @@
#
if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
- # Already in cache, be silent
- set(ICU_FIND_QUIETLY TRUE)
+ # Already in cache, be silent
+ set(ICU_FIND_QUIETLY TRUE)
endif()
# Look for the header file.
find_path(
- ICU_INCLUDE_DIR
- NAMES unicode/utypes.h
- HINTS /usr/local/opt/icu4c/include
- DOC "Include directory for the ICU library")
+ ICU_INCLUDE_DIR
+ NAMES unicode/utypes.h
+ HINTS /usr/local/opt/icu4c/include
+ DOC "Include directory for the ICU library"
+)
mark_as_advanced(ICU_INCLUDE_DIR)
# Look for the library.
find_library(
- ICU_LIBRARY
- NAMES icuuc cygicuuc cygicuuc32
- HINTS /usr/local/opt/icu4c/lib
- DOC "Libraries to link against for the common parts of ICU")
+ ICU_LIBRARY
+ NAMES icuuc cygicuuc cygicuuc32
+ HINTS /usr/local/opt/icu4c/lib
+ DOC "Libraries to link against for the common parts of ICU"
+)
mark_as_advanced(ICU_LIBRARY)
# Copy the results to the output variables.
-if (ICU_INCLUDE_DIR AND ICU_LIBRARY)
- set(ICU_FOUND 1)
- set(ICU_LIBRARIES ${ICU_LIBRARY})
- set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
+if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
+ set(ICU_FOUND 1)
+ set(ICU_LIBRARIES ${ICU_LIBRARY})
+ set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
- set(ICU_VERSION 0)
- set(ICU_MAJOR_VERSION 0)
- set(ICU_MINOR_VERSION 0)
- file(READ "${ICU_INCLUDE_DIR}/unicode/uvernum.h" _ICU_VERSION_CONENTS)
- string(REGEX REPLACE ".*#define U_ICU_VERSION_MAJOR_NUM ([0-9]+).*" "\\1" ICU_MAJOR_VERSION "${_ICU_VERSION_CONENTS}")
- string(REGEX REPLACE ".*#define U_ICU_VERSION_MINOR_NUM ([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_ICU_VERSION_CONENTS}")
+ set(ICU_VERSION 0)
+ set(ICU_MAJOR_VERSION 0)
+ set(ICU_MINOR_VERSION 0)
+ file(READ "${ICU_INCLUDE_DIR}/unicode/uvernum.h" _ICU_VERSION_CONENTS)
+ string(REGEX REPLACE ".*#define U_ICU_VERSION_MAJOR_NUM ([0-9]+).*" "\\1" ICU_MAJOR_VERSION "${_ICU_VERSION_CONENTS}")
+ string(REGEX REPLACE ".*#define U_ICU_VERSION_MINOR_NUM ([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_ICU_VERSION_CONENTS}")
- set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}")
+ set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}")
- # Look for the ICU internationalization libraries
- find_library(
- ICU_I18N_LIBRARY
- NAMES icuin icui18n cygicuin cygicuin32
- HINTS /usr/local/opt/icu4c/lib
- DOC "Libraries to link against for ICU internationalization")
- mark_as_advanced(ICU_I18N_LIBRARY)
- if (ICU_I18N_LIBRARY)
- set(ICU_I18N_FOUND 1)
- set(ICU_LIBRARIES "${ICU_LIBRARIES} ${ICU_I18N_LIBRARY}")
- else ()
- set(ICU_I18N_FOUND 0)
- endif ()
-else ()
- set(ICU_FOUND 0)
+ # Look for the ICU internationalization libraries
+ find_library(
+ ICU_I18N_LIBRARY
+ NAMES icuin icui18n cygicuin cygicuin32
+ HINTS /usr/local/opt/icu4c/lib
+ DOC "Libraries to link against for ICU internationalization"
+ )
+ mark_as_advanced(ICU_I18N_LIBRARY)
+ if(ICU_I18N_LIBRARY)
+ set(ICU_I18N_FOUND 1)
+ set(ICU_LIBRARIES "${ICU_LIBRARIES} ${ICU_I18N_LIBRARY}")
+ else()
set(ICU_I18N_FOUND 0)
- set(ICU_INCLUDE_DIRS)
- set(ICU_LIBRARIES)
- set(ICU_VERSION)
- set(ICU_MAJOR_VERSION)
- set(ICU_MINOR_VERSION)
-endif ()
+ endif()
+else()
+ set(ICU_FOUND 0)
+ set(ICU_I18N_FOUND 0)
+ set(ICU_INCLUDE_DIRS)
+ set(ICU_LIBRARIES)
+ set(ICU_VERSION)
+ set(ICU_MAJOR_VERSION)
+ set(ICU_MINOR_VERSION)
+endif()
-if (ICU_FOUND)
- if (NOT ICU_FIND_QUIETLY)
- message(STATUS "Found ICU version ${ICU_VERSION}")
- message(STATUS "Found ICU header files in ${ICU_INCLUDE_DIRS}")
- message(STATUS "Found ICU libraries: ${ICU_LIBRARIES}")
- endif ()
-else ()
- if (ICU_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find ICU")
- else ()
- message(STATUS "Optional package ICU was not found")
- endif ()
-endif ()
+if(ICU_FOUND)
+ if(NOT ICU_FIND_QUIETLY)
+ message(STATUS "Found ICU version ${ICU_VERSION}")
+ message(STATUS "Found ICU header files in ${ICU_INCLUDE_DIRS}")
+ message(STATUS "Found ICU libraries: ${ICU_LIBRARIES}")
+ endif()
+else()
+ if(ICU_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find ICU")
+ else()
+ message(STATUS "Optional package ICU was not found")
+ endif()
+endif()
diff --git a/cmake/modules/FindWcecompat.cmake b/cmake/modules/FindWcecompat.cmake
index 42769750..4af53aa5 100644
--- a/cmake/modules/FindWcecompat.cmake
+++ b/cmake/modules/FindWcecompat.cmake
@@ -11,23 +11,23 @@
if(WCECOMPAT_INCLUDE_DIR AND WCECOMPAT_LIB_FOUND)
set(Wcecompat_FIND_QUIETLY TRUE)
-endif(WCECOMPAT_INCLUDE_DIR AND WCECOMPAT_LIB_FOUND)
+endif()
find_path(WCECOMPAT_INCLUDE_DIR errno.h PATH_SUFFIXES wcecompat)
set(WCECOMPAT_LIB_FOUND FALSE)
if(WCECOMPAT_INCLUDE_DIR)
- find_library(WCECOMPAT_LIBRARIES NAMES wcecompat wcecompatex )
- if(WCECOMPAT_LIBRARIES)
- set(WCECOMPAT_LIB_FOUND TRUE)
- endif(WCECOMPAT_LIBRARIES)
-endif(WCECOMPAT_INCLUDE_DIR)
+ find_library(WCECOMPAT_LIBRARIES NAMES wcecompat wcecompatex)
+ if(WCECOMPAT_LIBRARIES)
+ set(WCECOMPAT_LIB_FOUND TRUE)
+ endif()
+endif()
# I have no idea what this is about, but it seems to be used quite often, so I add this here
set(WCECOMPAT_CONST const)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Wcecompat DEFAULT_MSG WCECOMPAT_LIBRARIES WCECOMPAT_LIB_FOUND)
+find_package_handle_standard_args(Wcecompat DEFAULT_MSG WCECOMPAT_LIBRARIES WCECOMPAT_LIB_FOUND)
-mark_as_advanced(WCECOMPAT_INCLUDE_DIR WCECOMPAT_LIBRARIES WCECOMPAT_CONST WCECOMPAT_LIB_FOUND)
+mark_as_advanced(WCECOMPAT_INCLUDE_DIR WCECOMPAT_LIBRARIES WCECOMPAT_CONST WCECOMPAT_LIB_FOUND)