Commit 652be81b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Run port-cmake-style.sh to get a bit more consistency

It's not perfect, there's still plenty of inconsistency, but this makes
porting easier already.
parent 028f58e5
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
add_definitions(-Wno-unused-variable)
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
endif ()
if (SHOULD_BUILD_LIB_KDGANTT)
add_subdirectory(kdgantt)
endif (SHOULD_BUILD_LIB_KDGANTT)
endif ()
if (SHOULD_BUILD_LIB_KDCHART)
add_subdirectory(kdchart)
endif (SHOULD_BUILD_LIB_KDCHART)
endif ()
if (WIN32 AND USE_BREAKPAD)
add_subdirectory(google-breakpad)
endif (WIN32 AND USE_BREAKPAD)
endif ()
project(breakpad-client)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
cmake_minimum_required(VERSION 2.6.0)
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
message(STATUS ${CMAKE_SYSTEM_PROCESSOR})
INCLUDE_DIRECTORIES(
include_directories(
src/
)
......@@ -19,7 +19,7 @@ if (UNIX)
src/common/convert_UTF.c
src/common/string_conversion.cc
)
endif(UNIX)
endif()
if (WIN32)
SET(SOURCES ${SOURCES}
......@@ -33,11 +33,11 @@ if (WIN32)
ADD_DEFINITIONS(/GL /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "_UNICODE" /D "UNICODE" /EHsc )
#INCLUDE_DIRECTORIES(c:/progra~1/micros~1.0/vc/atlmfc)
SET(EXTRA_LIBS ole32)
endif (WIN32)
endif ()
if (UNIX)
if (APPLE)
INCLUDE_DIRECTORIES(/Developer/Headers/FlatCarbon)
include_directories(/Developer/Headers/FlatCarbon)
FIND_LIBRARY(COCOA_LIBRARY COCOA)
MARK_AS_ADVANCED(COCOA_LIBRARY)
SET(EXTRA_LIBS crypto ${COCOA_LIBRARY})
......@@ -58,7 +58,7 @@ if (UNIX)
src/common/mac/macho_walker.cc
src/common/mac/string_utilities.cc
)
else (APPLE)
else ()
SET(SOURCES ${SOURCES}
src/client/linux/handler/exception_handler.cc
src/client/linux/handler/linux_thread.cc
......@@ -69,14 +69,14 @@ if (UNIX)
src/common/linux/http_upload.cc
src/common/md5.c
)
endif (APPLE)
endif (UNIX)
endif ()
endif ()
add_library(breakpad ${SOURCES})
IF(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE)
SET_TARGET_PROPERTIES( breakpad PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX AND NOT APPLE)
endif()
target_link_libraries(breakpad ${EXTRA_LIBS})
install(TARGETS breakpad DESTINATION lib${LIB_SUFFIX})
......
......@@ -7,7 +7,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../kdablibfakes/include
)
ADD_DEFINITIONS(-DKDCHART_BUILD_KDCHART_LIB)
add_definitions(-DKDCHART_BUILD_KDCHART_LIB)
########### next target ###############
......
This diff is collapsed.
......@@ -616,7 +616,7 @@ calligra_define_productset(OKULAR "Okular generators"
#
# if (PLATFORMX OR NOT EXTERNAL_DEP_X_FOUND)
# set(SHOULD_BUILD_MYPRODUCT FALSE)
# endif (PLATFORMX OR NOT EXTERNAL_DEP_X_FOUND)
# endif ()
#
# 4. Wrap everything belonging to the product with the build flag of the product.
# Ideally this is done around subdirectory inclusions, results in easier code.
......@@ -624,7 +624,7 @@ calligra_define_productset(OKULAR "Okular generators"
#
# if (SHOULD_BUILD_MYPRODUCT)
# add_subdirectory(myproduct)
# endif (SHOULD_BUILD_MYPRODUCT)
# endif ()
#
# 5. Tag the product as STAGING, if it is not yet ready for release, but already
# integrated in the master branch, e.g.
......@@ -662,7 +662,7 @@ calligra_define_productset(OKULAR "Okular generators"
#
# if (PLATFORMX OR NOT EXTERNAL_DEP_X_FOUND)
# set(SHOULD_BUILD_MYFEATURE FALSE)
# endif (PLATFORMX OR NOT EXTERNAL_DEP_X_FOUND)
# endif ()
#
# 4. Wrap everything belonging to the feature with the build flag of the feature.
# Ideally this is done around subdirectory inclusions, results in easier code.
......@@ -670,7 +670,7 @@ calligra_define_productset(OKULAR "Okular generators"
#
# if (SHOULD_BUILD_MYFEATURE)
# add_subdirectory(myproduct)
# endif (SHOULD_BUILD_MYFEATURE)
# endif ()
#
# 5. Tag the feature as STAGING, if it is not yet ready for release, but already
# integrated in the master branch, e.g.
......
......@@ -61,7 +61,7 @@ endfunction()
if ( MARBLE_INCLUDE_DIR AND MARBLE_LIBRARIES )
# in cache already
set( MARBLE_FIND_QUIETLY TRUE )
endif ( MARBLE_INCLUDE_DIR AND MARBLE_LIBRARIES )
endif ()
find_path( MARBLE_INCLUDE_DIR NAMES marble/MarbleMap.h PATH_SUFFIXES marble)
find_file( MARBLE_GLOBAL_HEADER NAMES marble/MarbleGlobal.h PATH_SUFFIXES marble)
......@@ -87,7 +87,7 @@ if(MARBLE_GLOBAL_HEADER)
set(MARBLE_VERSION "${MARBLE_VERSION_MAJOR}.${MARBLE_VERSION_MINOR}.${MARBLE_VERSION_PATCH}")
endif(MARBLE_GLOBAL_HEADER)
endif()
include( FindPackageHandleStandardArgs )
......@@ -102,9 +102,9 @@ if(MARBLE_VERSION)
"Could not find Marble"
)
else(MARBLE_VERSION)
else()
find_package_handle_standard_args( marble
DEFAULT_MSG
MARBLE_INCLUDE_DIR
MARBLE_LIBRARIES )
endif(MARBLE_VERSION)
endif()
......@@ -53,9 +53,9 @@
if(SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
if(SQLITE_LOAD_EXTENSION_REQUIRED AND SQLITE_LOAD_EXTENSION OR NOT SQLITE_LOAD_EXTENSION_REQUIRED)
# in cache already
SET(Sqlite_FIND_QUIETLY TRUE)
endif(SQLITE_LOAD_EXTENSION_REQUIRED AND SQLITE_LOAD_EXTENSION OR NOT SQLITE_LOAD_EXTENSION_REQUIRED)
endif(SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
set(Sqlite_FIND_QUIETLY TRUE)
endif()
endif()
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
......@@ -65,22 +65,22 @@ if(NOT WIN32)
pkg_check_modules(PC_SQLITE QUIET sqlite3)
set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER})
endif(NOT WIN32)
endif()
FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h
find_path(SQLITE_INCLUDE_DIR NAMES sqlite3.h
PATHS
${PC_SQLITE_INCLUDEDIR}
${PC_SQLITE_INCLUDE_DIRS}
)
FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3
find_library(SQLITE_LIBRARIES NAMES sqlite3
PATHS
${PC_SQLITE_LIBDIR}
${PC_SQLITE_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES)
find_package_handle_standard_args(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES)
macro(_check_min_sqlite_version)
# Suppport finding at least a particular version, for instance FIND_PACKAGE(Sqlite 3.6.22)
......@@ -94,19 +94,19 @@ macro(_check_min_sqlite_version)
if(SQLITE_MIN_VERSION_NUMBER GREATER SQLITE_VERSION)
if(CalligraSqlite_FIND_REQUIRED)
message(FATAL_ERROR "Minimal SQLite version required: ${SQLITE_MIN_VERSION}, found ${SQLITE_VERSION_STRING}")
else(CalligraSqlite_FIND_REQUIRED)
else()
message(STATUS "WARNING: Minimal SQLite version required: ${SQLITE_MIN_VERSION}, found ${SQLITE_VERSION_STRING}")
endif(CalligraSqlite_FIND_REQUIRED)
endif()
unset(SQLITE_FOUND)
unset(SQLITE_FOUND CACHE)
endif(SQLITE_MIN_VERSION_NUMBER GREATER SQLITE_VERSION)
endif(Sqlite_FIND_VERSION)
endif()
endif()
if(SQLITE_FOUND)
if(NOT Sqlite_FIND_QUIETLY)
message(STATUS "Found SQLite version ${SQLITE_VERSION_STRING}")
endif(NOT Sqlite_FIND_QUIETLY)
endif(SQLITE_FOUND)
endif()
endif()
endmacro(_check_min_sqlite_version)
macro(_check_recommended_sqlite_version)
......@@ -118,34 +118,34 @@ macro(_check_recommended_sqlite_version)
"${SQLITE_RECOMMENDED_VERSION_MAJOR} * 1000000 + ${SQLITE_RECOMMENDED_VERSION_MINOR} * 1000 + ${SQLITE_RECOMMENDED_VERSION_PATCH}")
if(SQLITE_RECOMMENDED_VERSION_NUMBER GREATER SQLITE_VERSION)
message(STATUS "NOTE: Recommended SQLite version is ${SQLITE_RECOMMENDED_VERSION}")
endif(SQLITE_RECOMMENDED_VERSION_NUMBER GREATER SQLITE_VERSION)
endif(SQLITE_RECOMMENDED_VERSION)
endif()
endif()
endmacro(_check_recommended_sqlite_version)
macro(_get_compile_options)
FIND_PROGRAM(SQLITE_SHELL sqlite3 DOC "sqlite3 executable with full path")
find_program(SQLITE_SHELL sqlite3 DOC "sqlite3 executable with full path")
if (SQLITE_SHELL)
SET(_COMPILE_OPTIONS_TEST_DB pragma_compile_options_test.sqlite3)
EXECUTE_PROCESS(COMMAND ${SQLITE_SHELL} ${_COMPILE_OPTIONS_TEST_DB} "pragma compile_options"
set(_COMPILE_OPTIONS_TEST_DB pragma_compile_options_test.sqlite3)
execute_process(COMMAND ${SQLITE_SHELL} ${_COMPILE_OPTIONS_TEST_DB} "pragma compile_options"
OUTPUT_VARIABLE _COMPILE_OPTIONS_RESULT)
STRING(REGEX REPLACE "=1\n" ";" SQLITE_COMPILE_OPTIONS "${_COMPILE_OPTIONS_RESULT}")
STRING(REPLACE "\n" ";" SQLITE_COMPILE_OPTIONS "${SQLITE_COMPILE_OPTIONS}")
SET(SQLITE_COMPILE_OPTIONS ${SQLITE_COMPILE_OPTIONS})
else (SQLITE_SHELL)
endif (SQLITE_SHELL)
string(REGEX REPLACE "=1\n" ";" SQLITE_COMPILE_OPTIONS "${_COMPILE_OPTIONS_RESULT}")
string(REPLACE "\n" ";" SQLITE_COMPILE_OPTIONS "${SQLITE_COMPILE_OPTIONS}")
set(SQLITE_COMPILE_OPTIONS ${SQLITE_COMPILE_OPTIONS})
else ()
endif ()
endmacro(_get_compile_options)
macro(SQLITE_CHECK_COMPILE_OPTION _OPTION_NAME)
LIST(FIND SQLITE_COMPILE_OPTIONS "${_OPTION_NAME}" _RESULT)
list(FIND SQLITE_COMPILE_OPTIONS "${_OPTION_NAME}" _RESULT)
if (NOT ${_RESULT} EQUAL -1)
SET(${_OPTION_NAME} ON)
endif (NOT ${_RESULT} EQUAL -1)
set(${_OPTION_NAME} ON)
endif ()
endmacro(SQLITE_CHECK_COMPILE_OPTION)
if(NOT EXISTS "${SQLITE_INCLUDE_DIR}/sqlite3.h")
unset(SQLITE_FOUND)
unset(SQLITE_FOUND CACHE)
endif(NOT EXISTS "${SQLITE_INCLUDE_DIR}/sqlite3.h")
endif()
if(SQLITE_FOUND)
file(READ "${SQLITE_INCLUDE_DIR}/sqlite3.h" SQLITE_VERSION_CONTENT)
......@@ -158,39 +158,39 @@ if(SQLITE_FOUND)
set(SQLITE_VERSION_STRING ${SQLITE_VERSION_STRING} CACHE STRING "SQLite version")
_check_min_sqlite_version()
_check_recommended_sqlite_version()
endif(SQLITE_VERSION_STRING_MATCH AND SQLITE_VERSION_MATCH)
endif()
_get_compile_options()
if(SQLITE_LOAD_EXTENSION_REQUIRED)
SQLITE_CHECK_COMPILE_OPTION(OMIT_LOAD_EXTENSION)
sqlite_check_compile_option(OMIT_LOAD_EXTENSION)
if(OMIT_LOAD_EXTENSION)
message(STATUS "WARNING: SQLite found but it is not built with support for extensions loading. It should be configured with --enable-load-extension option.")
unset(SQLITE_FOUND)
unset(SQLITE_FOUND CACHE)
else(OMIT_LOAD_EXTENSION)
else()
set(SQLITE_LOAD_EXTENSION ON CACHE STRING "Support for extensions loading in SQLite")
if(NOT Sqlite_FIND_QUIETLY)
message(STATUS "Found support for extensions loading in SQLite.")
endif(NOT Sqlite_FIND_QUIETLY)
endif(OMIT_LOAD_EXTENSION)
endif(SQLITE_LOAD_EXTENSION_REQUIRED)
else(SQLITE_FOUND)
endif()
endif()
endif()
else()
if(CalligraSqlite_FIND_REQUIRED)
message(FATAL_ERROR "Required package SQLite NOT found")
else(CalligraSqlite_FIND_REQUIRED)
else()
message(STATUS "WARNING: SQLite NOT found")
endif(CalligraSqlite_FIND_REQUIRED)
endif(SQLITE_FOUND)
endif()
endif()
if(SQLITE_FOUND)
set(SQLITE_FOUND 1 CACHE INTERNAL "" FORCE)
else(SQLITE_FOUND)
else()
unset(SQLITE_FOUND CACHE)
unset(SQLITE_INCLUDE_DIR CACHE)
unset(SQLITE_LIBRARIES CACHE)
unset(SQLITE_VERSION CACHE)
unset(SQLITE_VERSION_STRING CACHE)
unset(SQLITE_LOAD_EXTENSION CACHE)
endif(SQLITE_FOUND)
endif()
mark_as_advanced(SQLITE_FOUND SQLITE_INCLUDE_DIR SQLITE_LIBRARIES SQLITE_VERSION_STRING SQLITE_VERSION
SQLITE_SHELL SQLITE_MIN_VERSION SQLITE_MIN_VERSION_MAJOR SQLITE_MIN_VERSION_MINOR
......
......@@ -9,23 +9,23 @@
# Copyright (c) 2011, Cyrille Berger <cberger@cberger.net>
# Redistribution and use is allowed according to the terms of the BSD license.
FIND_PATH(CAUCHY_INCLUDE_DIR m2mml.h
find_path(CAUCHY_INCLUDE_DIR m2mml.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(M2MML_LIBRARY
find_library(M2MML_LIBRARY
NAMES m2mml
PATHS /usr/lib /usr/local/lib )
IF (CAUCHY_INCLUDE_DIR)
SET(CAUCHY_FOUND "YES")
ELSE ()
SET(CAUCHY_FOUND "NO")
ENDIF ()
if (CAUCHY_INCLUDE_DIR)
set(CAUCHY_FOUND "YES")
else ()
set(CAUCHY_FOUND "NO")
endif ()
IF(CAUCHY_FOUND AND M2MML_LIBRARY)
SET(M2MML_FOUND "YES")
ELSE ()
SET(M2MML_FOUND "NO")
ENDIF ()
if(CAUCHY_FOUND AND M2MML_LIBRARY)
set(M2MML_FOUND "YES")
else ()
set(M2MML_FOUND "NO")
endif ()
......@@ -18,16 +18,16 @@
if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2)
endif(NOT Eigen3_FIND_VERSION_MAJOR)
endif()
if(NOT Eigen3_FIND_VERSION_MINOR)
set(Eigen3_FIND_VERSION_MINOR 91)
endif(NOT Eigen3_FIND_VERSION_MINOR)
endif()
if(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION_PATCH 0)
endif(NOT Eigen3_FIND_VERSION_PATCH)
endif()
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
endif(NOT Eigen3_FIND_VERSION)
endif()
macro(_eigen3_check_version)
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
......@@ -42,15 +42,15 @@ macro(_eigen3_check_version)
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK FALSE)
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
else()
set(EIGEN3_VERSION_OK TRUE)
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
endif()
if(NOT EIGEN3_VERSION_OK)
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
"but at least version ${Eigen3_FIND_VERSION} is required")
endif(NOT EIGEN3_VERSION_OK)
endif()
endmacro(_eigen3_check_version)
if (EIGEN3_INCLUDE_DIR)
......@@ -59,7 +59,7 @@ if (EIGEN3_INCLUDE_DIR)
_eigen3_check_version()
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
else (EIGEN3_INCLUDE_DIR)
else ()
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
PATHS
......@@ -70,12 +70,12 @@ else (EIGEN3_INCLUDE_DIR)
if(EIGEN3_INCLUDE_DIR)
_eigen3_check_version()
endif(EIGEN3_INCLUDE_DIR)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
mark_as_advanced(EIGEN3_INCLUDE_DIR)
endif(EIGEN3_INCLUDE_DIR)
endif()
......@@ -6,25 +6,25 @@
# FreeTDS_LIBRARIES - Link these to use FreeTDS
IF (FreeTDS_INCLUDE_DIR AND FreeTDS_LIBRARIES )
if (FreeTDS_INCLUDE_DIR AND FreeTDS_LIBRARIES )
# Already in cache
SET(FREETDS_FOUND TRUE)
ELSE (FreeTDS_INCLUDE_DIR AND FreeTDS_LIBRARIES)
else ()
FIND_PATH(FreeTDS_INCLUDE_DIR NAMES sqldb.h sqlfront.h)
find_path(FreeTDS_INCLUDE_DIR NAMES sqldb.h sqlfront.h)
# FIND_LIBRARY(FreeTDS_TDS_LIBRARIES NAMES tds )
FIND_LIBRARY(FreeTDS_LIBRARIES NAMES sybdb )
find_library(FreeTDS_LIBRARIES NAMES sybdb )
#set(FreeTDS_LIBRARIES ${FreeTDS_SYBDB_LIBRARIES} CACHE STRING "Libraries needed for sybase/mssql driver")
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FreeTDS DEFAULT_MSG FreeTDS_INCLUDE_DIR FreeTDS_LIBRARIES)
find_package_handle_standard_args(FreeTDS DEFAULT_MSG FreeTDS_INCLUDE_DIR FreeTDS_LIBRARIES)
MARK_AS_ADVANCED(FreeTDS_INCLUDE_DIR FreeTDS_LIBRARIES)
mark_as_advanced(FreeTDS_INCLUDE_DIR FreeTDS_LIBRARIES)
ENDIF (FreeTDS_INCLUDE_DIR AND FreeTDS_LIBRARIES )
endif ()
......@@ -22,7 +22,7 @@ if (GLEW_INCLUDE_DIRS AND GLEW_LIBRARIES)
# Already in cache
set(GLEW_FOUND TRUE)
else (GLEW_INCLUDE_DIRS AND GLEW_LIBRARIES)
else ()
find_path(GLEW_INCLUDE_DIR GL/glew.h)
find_library(GLEW_LIBRARY NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64)
......@@ -38,4 +38,4 @@ else (GLEW_INCLUDE_DIRS AND GLEW_LIBRARIES)
mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY)
endif (GLEW_INCLUDE_DIRS AND GLEW_LIBRARIES)
endif ()
......@@ -65,7 +65,7 @@ else ()
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
find_package_handle_standard_args(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
if (GLUT_FOUND)
# Is -lXi and -lXmu required on all platforms that have it?
......
......@@ -9,14 +9,14 @@
# GSL_VERSION
#
INCLUDE(UsePkgConfig)
include(UsePkgConfig)
IF (GSL_INCLUDE_DIR AND GSL_LIBRARIES AND GSL_CBLAS_LIBRARIES AND GSL_VERSION)
if (GSL_INCLUDE_DIR AND GSL_LIBRARIES AND GSL_CBLAS_LIBRARIES AND GSL_VERSION)
# Already in cache
SET(GSL_FOUND TRUE)
ELSE (GSL_INCLUDE_DIR AND GSL_LIBRARIES AND GSL_CBLAS_LIBRARIES AND GSL_VERSION)
else ()
FIND_LIBRARY (GSL_LIBRARIES gsl)
......@@ -57,20 +57,20 @@ ELSE (GSL_INCLUDE_DIR AND GSL_LIBRARIES AND GSL_CBLAS_LIBRARIES AND GSL_VERSION)
SET (GSL_FOUND FALSE)
ENDIF (GSL_LIBRARIES AND GSL_CBLAS_LIBRARIES AND GSL_INCLUDE_DIR)
ENDIF (GSL_INCLUDE_DIR AND GSL_LIBRARIES AND GSL_CBLAS_LIBRARIES AND GSL_VERSION)
endif ()
#
# output status
#
IF (GSL_FOUND)
if (GSL_FOUND)
if (NOT GSL_FIND_QUIETLY)
MESSAGE (STATUS "Found GNU Scientific Library ${GSL_VERSION}: ${GSL_INCLUDE_DIR} ${GSL_LIBRARIES};${GSL_CBLAS_LIBRARIES}")
endif(NOT GSL_FIND_QUIETLY)
ELSE (GSL_FOUND)
endif()
else ()
if (GSL_FIND_REQUIRED)
MESSAGE (STATUS "GNU Scientific Library not found. "
"Calligra Sheets' solver plugin won't be compiled.")
endif (GSL_FIND_REQUIRED)
ENDIF (GSL_FOUND)
endif ()
endif ()
......@@ -33,13 +33,13 @@ if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
set(ICU_MAJOR_VERSION 0)
set(ICU_MINOR_VERSION 0)
if (EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
FILE(READ "${ICU_INCLUDE_DIR}/unicode/uvernum.h" _ICU_VERSION_CONENTS)
file(READ "${ICU_INCLUDE_DIR}/unicode/uvernum.h" _ICU_VERSION_CONENTS)
else()
FILE(READ "${ICU_INCLUDE_DIR}/unicode/uversion.h" _ICU_VERSION_CONENTS)
file(READ "${ICU_INCLUDE_DIR}/unicode/uversion.h" _ICU_VERSION_CONENTS)
endif()
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}")
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}")
......@@ -52,11 +52,11 @@ if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
if (ICU_I18N_LIBRARY)
set(ICU_I18N_FOUND 1)
set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
else (ICU_I18N_LIBRARY)
else ()
set(ICU_I18N_FOUND 0)
set(ICU_I18N_LIBRARIES)
endif (ICU_I18N_LIBRARY)
else(ICU_INCLUDE_DIR AND ICU_LIBRARY)
endif ()
else()
set(ICU_FOUND 0)
set(ICU_I18N_FOUND 0)
set(ICU_LIBRARIES)
......@@ -65,18 +65,18 @@ else(ICU_INCLUDE_DIR AND ICU_LIBRARY)
set(ICU_VERSION)
set(ICU_MAJOR_VERSION)
set(ICU_MINOR_VERSION)
endif(ICU_INCLUDE_DIR AND ICU_LIBRARY)
endif()
IF(ICU_FOUND)
IF( NOT ICU_FIND_QUIETLY )
MESSAGE( STATUS "Found ICU header files in ${ICU_INCLUDE_DIRS}")
MESSAGE( STATUS "Found ICU libraries: ${ICU_LIBRARIES}")
ENDIF( NOT ICU_FIND_QUIETLY )
ELSE(ICU_FOUND)
if(ICU_FOUND)
if( NOT ICU_FIND_QUIETLY )
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(ICU_FIND_REQUIRED)
MESSAGE( STATUS "Optional package ICU was not found" )
ENDIF(ICU_FIND_REQUIRED)
ENDIF(ICU_FOUND)
endif()
......@@ -8,22 +8,22 @@
#
include(CheckCXXSourceCompiles)
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
if (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
# Already in cache, be silent
SET(ICONV_FIND_QUIETLY TRUE)
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
set(ICONV_FIND_QUIETLY TRUE)
endif ()
FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
find_path(ICONV_INCLUDE_DIR iconv.h)
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
SET(ICONV_FOUND TRUE)
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
if(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
set(ICONV_FOUND TRUE)
endif()
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
IF(ICONV_FOUND)
if(ICONV_FOUND)
check_cxx_source_compiles("
#include <iconv.h>
int main(){
......@@ -36,21 +36,21 @@ IF(ICONV_FOUND)
return 0;
}
" ICONV_SECOND_ARGUMENT_IS_CONST )
ENDIF(ICONV_FOUND)
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
IF(ICONV_FOUND)
IF(NOT ICONV_FIND_QUIETLY)
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
ENDIF(NOT ICONV_FIND_QUIETLY)
ELSE(ICONV_FOUND)
IF(Iconv_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Iconv")
ENDIF(Iconv_FIND_REQUIRED)
ENDIF(ICONV_FOUND)
if(ICONV_FOUND)
if(NOT ICONV_FIND_QUIETLY)
message(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
endif()
else()
if(Iconv_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Iconv")
endif()
endif()
MARK_AS_ADVANCED(
mark_as_advanced(
ICONV_INCLUDE_DIR
ICONV_LIBRARIES
ICONV_SECOND_ARGUMENT_IS_CONST
......
......@@ -29,15 +29,15 @@ if(IMAGEMAGICK_INCLUDE_DIR AND IMAGEMAGICK_LIBRARIES AND IMAGEMAGICK_VERSION)
# and the executables are in the cache too, if they were found.
else(IMAGEMAGICK_INCLUDE_DIR AND IMAGEMAGICK_LIBRARIES AND IMAGEMAGICK_VERSION)
else()
SET(HAVE_MAGICK 0)
set(HAVE_MAGICK 0)
if (WIN32)
# Try to find the ImageMagick binary path.
FIND_PATH(IMAGEMAGICK_BINARY_PATH mogrify.exe
find_path(IMAGEMAGICK_BINARY_PATH mogrify.exe
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]
DOC "Path to the ImageMagick binary directory where all executable should be found."
)
......@@ -46,46 +46,46 @@ else(IMAGEMAGICK_INCLUDE_DIR AND IMAGEMAGICK_LIBRARIES AND IMAGEMAGICK_VERSION)
# env var to search for convert.exe, otherwise it is going to pick
# Window's own convert.exe, and you may say good-bye to your disk.
FIND_PROGRAM(IMAGEMAGICK_CONVERT_EXECUTABLE
find_program(IMAGEMAGICK_CONVERT_EXECUTABLE
NAMES convert
PATHS ${IMAGEMAGICK_BINARY_PATH}
NO_SYSTEM_PATH
DOC "Path to ImageMagick's convert executable. WARNING: note that this tool, named convert.exe, conflicts with Microsoft Window's own convert.exe, which is used to convert FAT partitions to NTFS format ! Therefore, be extra-careful and make sure the right convert.exe has been picked."
)
ELSE (WIN32)
else ()
SET (IMAGEMAGICK_BINARY_PATH "")
set (IMAGEMAGICK_BINARY_PATH "")
FIND_PROGRAM(IMAGEMAGICK_CONVERT_EXECUTABLE
find_program(IMAGEMAGICK_CONVERT_EXECUTABLE
NAMES convert
PATHS ${IMAGEMAGICK_BINARY_PATH}
DOC "Path to ImageMagick's convert executable."
)
ENDIF (WIN32)
endif ()
# Find mogrify, import, montage, composite
FIND_PROGRAM(IMAGEMAGICK_MOGRIFY_EXECUTABLE