Commit 252fc1e1 by Juha Kallioinen

Squashed 'libzypp/' content from commit 8b5d5f8

git-subtree-dir: libzypp
git-subtree-split: 8b5d5f8a897a51d7d1adefe9d5602be9be56cdbe
0 parents
Showing 1000 changed files with 5024 additions and 0 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

build
*.orig
*.rej
*.swp
#*
.#*
*#
.*project
.externalToolBuilders
.settings
*flymake.h.gch
PROJECT(LIBZYPP)
SET( PACKAGE "libzypp" )
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
SET( CMAKE_MODULE_PATH ${LIBZYPP_SOURCE_DIR}/cmake/modules )
cmake_minimum_required(VERSION 2.6)
OPTION (DISABLE_LIBPROXY "Build without libproxy support even if package is installed?" OFF)
OPTION (DISABLE_AUTODOCS "Do not require doxygen being installed (required to build autodocs)?" OFF)
# allow name libraries by name mixed with full
# paths
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
INCLUDE(ZyppCommon)
INCLUDE( ${LIBZYPP_SOURCE_DIR}/VERSION.cmake )
MATH( EXPR LIBZYPP_CURRENT "${LIBZYPP_MAJOR} * 100 + ${LIBZYPP_MINOR}" )
MATH( EXPR LIBZYPP_AGE "${LIBZYPP_MINOR} - ${LIBZYPP_COMPATMINOR}" )
# Libtool wanted current:patch:age
# But cmake is not libtool, it wants the verbatim suffix to libzypp.so
MATH( EXPR LIBZYPP_SO_FIRST "${LIBZYPP_CURRENT}-${LIBZYPP_AGE}" )
SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY)
CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -fno-strict-aliasing -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed -std=c++0x" )
SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wl,-as-needed" )
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3" )
IF(${CC_FORMAT_SECURITY})
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security")
ENDIF(${CC_FORMAT_SECURITY})
IF(${CXX_FORMAT_SECURITY})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security")
ENDIF(${CXX_FORMAT_SECURITY})
INCLUDE(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(pipe2 PIPE2_FOUND)
IF(${PIPE2_FOUND})
ADD_DEFINITIONS(-DHAVE_PIPE2)
ENDIF(${PIPE2_FOUND})
ADD_DEFINITIONS( -D_FILE_OFFSET_BITS=64 )
ADD_DEFINITIONS( -DVERSION="${VERSION}" )
SET( LIBZYPP_VERSION_INFO "${LIBZYPP_SO_FIRST}.${LIBZYPP_AGE}.${LIBZYPP_PATCH}" )
SET( LIBZYPP_SOVERSION_INFO "${LIBZYPP_SO_FIRST}" )
GENERATE_PACKAGING(${PACKAGE} ${VERSION})
INCLUDE(CPack)
MACRO(ADD_TESTS)
FOREACH( loop_var ${ARGV} )
SET_SOURCE_FILES_PROPERTIES( ${loop_var}_test.cc COMPILE_FLAGS "-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN -DBOOST_AUTO_TEST_MAIN=\"\" " )
ADD_EXECUTABLE( ${loop_var}_test ${loop_var}_test.cc )
TARGET_LINK_LIBRARIES( ${loop_var}_test zypp boost_unit_test_framework zypp_test_utils)
ADD_TEST( ${loop_var}_test ${CMAKE_CURRENT_BINARY_DIR}/${loop_var}_test --catch_system_errors=no)
ENDFOREACH( loop_var )
ENDMACRO(ADD_TESTS)
####################################################################
# prefer packages using the same install prefix as we do
SET(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX} usr/localX /usr/local /usr)
FIND_PACKAGE(Rpm REQUIRED)
IF ( NOT RPM_FOUND)
MESSAGE( FATAL_ERROR " rpm-devel not found" )
ELSE ( NOT RPM_FOUND)
INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR})
# fix includes not relative to rpm
INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR}/rpm)
if ( RPM_SUSPECT_VERSION STREQUAL "5.x" )
MESSAGE( STATUS "rpm found: enable rpm-4 compat interface." )
ADD_DEFINITIONS(-D_RPM_5)
elseif ( RPM_SUSPECT_VERSION STREQUAL "4.x" )
MESSAGE( STATUS "rpm found: use rpm-4.x interface." )
ADD_DEFINITIONS(-D_RPM_4_X)
elseif ( RPM_SUSPECT_VERSION STREQUAL "4.4" )
MESSAGE( STATUS "rpm found: enable rpm-4.4 legacy interface." )
ADD_DEFINITIONS(-D_RPM_4_4)
endif ( RPM_SUSPECT_VERSION STREQUAL "5.x" )
ENDIF( NOT RPM_FOUND)
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options unit_test_framework)
IF (Boost_FOUND)
MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ENDIF(Boost_FOUND)
FIND_PACKAGE(Gettext REQUIRED)
IF (GETTEXT_FOUND)
MESSAGE(STATUS "Found Gettext: ${GETTEXT_SOURCE}")
INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
ELSE (GETTEXT_FOUND)
MESSAGE( FATAL_ERROR "Gettext not found" )
ENDIF (GETTEXT_FOUND)
FIND_PACKAGE(Curl REQUIRED)
IF ( NOT CURL_FOUND)
MESSAGE( FATAL_ERROR " curl not found" )
ELSE ( NOT CURL_FOUND)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
ENDIF( NOT CURL_FOUND)
FIND_PACKAGE(Libxml REQUIRED)
IF ( NOT LIBXML_FOUND)
MESSAGE( FATAL_ERROR " libxml not found" )
ELSE ( NOT LIBXML_FOUND)
INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR})
ENDIF( NOT LIBXML_FOUND)
FIND_PACKAGE(ZLIB REQUIRED)
IF ( NOT ZLIB_FOUND)
MESSAGE( FATAL_ERROR " zlib not found" )
ELSE ( NOT ZLIB_FOUND)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
ENDIF( NOT ZLIB_FOUND)
#SET(LibSolv_USE_STATIC_LIBS ON)
FIND_PACKAGE(LibSolv REQUIRED ext)
IF ( NOT LibSolv_FOUND )
MESSAGE( FATAL_ERROR " libsolv not found" )
ELSE()
INCLUDE_DIRECTORIES( ${LibSolv_INCLUDE_DIRS} )
ENDIF()
# libsolv uses expat and has open references to it:
FIND_PACKAGE(EXPAT REQUIRED)
FIND_PACKAGE(OpenSSL REQUIRED)
FIND_PACKAGE(Udev)
IF ( NOT UDEV_FOUND )
FIND_PACKAGE(Hal)
IF ( NOT HAL_FOUND )
MESSAGE(WARNING "No udev or HAL. CD device detection will be poor")
ELSE ( NOT HAL_FOUND )
ADD_DEFINITIONS(-DHAVE_HAL)
INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR}/hal)
# HAL requires working dbus
FIND_PACKAGE(Dbus REQUIRED)
IF(DBUS_FOUND)
INCLUDE_DIRECTORIES(${DBUS_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${DBUS_ARCH_INCLUDE_DIR})
ENDIF(DBUS_FOUND)
ENDIF ( NOT HAL_FOUND )
ELSE ( NOT UDEV_FOUND )
ADD_DEFINITIONS(-DHAVE_UDEV)
ENDIF ( NOT UDEV_FOUND )
IF( DISABLE_LIBPROXY )
MESSAGE( STATUS "libproxy support disabled" )
ELSE( DISABLE_LIBPROXY )
FIND_PACKAGE(libproxy)
IF ( NOT LIBPROXY_FOUND )
MESSAGE( STATUS "libproxy not found" )
ELSE ( NOT LIBPROXY_FOUND )
INCLUDE_DIRECTORIES( ${LIBPROXY_INCLUDE_DIR} )
ADD_DEFINITIONS(-D_WITH_LIBPROXY_SUPPORT_)
ENDIF( NOT LIBPROXY_FOUND )
ENDIF( DISABLE_LIBPROXY )
FIND_PROGRAM( DOXYGEN doxygen )
IF ( NOT DOXYGEN )
IF ( DISABLE_AUTODOCS )
MESSAGE( STATUS "doxygen is not available. Can't build the documentation." )
ELSE ( DISABLE_AUTODOCS )
MESSAGE( FATAL_ERROR "doxygen not found: install doxygen to build the documentation!" )
ENDIF ( DISABLE_AUTODOCS )
ELSE ( NOT DOXYGEN )
MESSAGE( STATUS "doxygen found: ${DOXYGEN}" )
ENDIF ( NOT DOXYGEN )
MESSAGE(STATUS "soname: ${LIBZYPP_VERSION_INFO}")
MESSAGE(STATUS "version: ${VERSION}")
MESSAGE(STATUS "Writing pkg-config file...")
CONFIGURE_FILE(${LIBZYPP_SOURCE_DIR}/libzypp.pc.cmake ${LIBZYPP_BINARY_DIR}/libzypp.pc @ONLY)
INSTALL( FILES ${LIBZYPP_BINARY_DIR}/libzypp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
MESSAGE(STATUS "FindZypp.cmake will be installed in ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules")
INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/cmake/modules/FindZypp.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )
INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/cmake/modules/ZyppCommon.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )
####################################################################
# config templates
# (don't forget to mention them in the .spec file)
####################################################################
MESSAGE(STATUS "zypp.conf will be installed in ${SYSCONFDIR}/zypp")
INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/zypp.conf DESTINATION ${SYSCONFDIR}/zypp )
#install systemCheck
MESSAGE(STATUS "systemCheck will be installed in ${SYSCONFDIR}/zypp")
INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/systemCheck DESTINATION ${SYSCONFDIR}/zypp )
# logrotate config file
INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/zypp-history.lr DESTINATION ${SYSCONFDIR}/logrotate.d )
####################################################################
# SUBDIRECTORIES #
####################################################################
ADD_SUBDIRECTORY( zypp )
#ADD_SUBDIRECTORY( zypp2 )
# do not build devel by default
ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
ADD_SUBDIRECTORY( tools )
ADD_SUBDIRECTORY( examples )
ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
ADD_SUBDIRECTORY( doc )
ADD_SUBDIRECTORY( vendor )
ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
INCLUDE(CTest)
ENABLE_TESTING()
/*---------------------------------------------------------------------\
| ____ _ __ __ ___ |
| |__ / \ / / . \ . \ |
| / / \ V /| _/ _/ |
| / /__ | | | | | | |
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
Copyright (C) 2000-2002 Ximian, Inc.
Copyright (C) 2005 SUSE Linux Products GmbH
ZYpp is licensed under the GNU General Public License version 2
or later. The text of the GNU General Public License can be viewed at
http://www.gnu.org/licenses/gpl.html
As a special exception, you have permission to link this program
with the following libraries and distribute executables, as long as you
follow the requirements of the GNU GPL in regard to all of the
software in the executable aside from the following libraries:
- OpenSSL (http://www.openssl.org)
\ No newline at end of file
# Generic Makefile.cvs for CMake-based projects:
#
# Create a subdirecory build/ and call cmake from there with /usr prefix.
#
# Intentionally using /usr rather than the default /usr/local since this is for
# internal use, and we are the distribution makers: /usr/local is off limits
# for us.
#
# Author: Stefan Hundhammer <sh@suse.de>
BUILD_SUBDIR = build
HERE_FROM_BUILD_SUBDIR = ..
PREFIX = /usr
CMAKE = /usr/bin/cmake
all: cmake
cmake: create-build-subdir create-toplevel-makefile
( cd $(BUILD_SUBDIR) && $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(PREFIX) $(HERE_FROM_BUILD_SUBDIR) )
create-build-subdir:
test -d $(BUILD_SUBDIR) || mkdir $(BUILD_SUBDIR)
create-toplevel-makefile:
echo 'all:' >Makefile
echo -e '\t$$(MAKE) $$(MAKEFLAGS) -C $(BUILD_SUBDIR)' >>Makefile
API Cleanups:
=============
Source.h
- remove const from return types:
ie: const Pathname providePackage( Package::constPtr package );
- pass by reference
resolvables(zypp::Resolvable::Kind kind) const;
# ==================================================
# Versioning
# ==========
#
# MAJOR Major number for this branch.
#
# MINOR The most recent interface number this
# library implements.
#
# COMPATMINOR The latest binary compatible minor number
# this library implements.
#
# PATCH The implementation number of the current interface.
#
#
# - The package VERSION will be MAJOR.MINOR.PATCH.
#
# - Libtool's -version-info will be derived from MAJOR, MINOR, PATCH
# and COMPATMINOR (see configure.ac).
#
# - Changing MAJOR always breaks binary compatibility.
#
# - Changing MINOR doesn't break binary compatibility by default.
# Only if COMPATMINOR is changed as well.
#
#
# 1) After branching from TRUNK increment TRUNKs MAJOR and
# start with version `MAJOR.0.0' and also set COMPATMINOR to 0.
#
# 2) Update the version information only immediately before a public release
# of your software. More frequent updates are unnecessary, and only guarantee
# that the current interface number gets larger faster.
#
# 3) If the library source code has changed at all since the last update,
# then increment PATCH.
#
# 4) If any interfaces have been added, removed, or changed since the last
# update, increment MINOR, and set PATCH to 0.
#
# 5) If any interfaces have been added since the last public release, then
# leave COMPATMINOR unchanged. (binary compatible change)
#
# 6) If any interfaces have been removed since the last public release, then
# set COMPATMINOR to MINOR. (binary incompatible change)
# ==================================================
#=======
# - MOST IMPORTANT:
# - Before you submitt to git:
# - Remember the new version in 'LAST RELEASED:'
# - State the new version in the changes file by adding a line
# "- version MAJOR.MINOR.PATCH (COMPATMINOR)"
# - Commit changes and version files together in a separate
# commit using -m 'changes MAJOR.MINOR.PATCH (COMPATMINOR)'
# - Tag the above commit with 'MAJOR.MINOR.PATCH' using
# -m "tagging MAJOR.MINOR.PATCH".
#
# - Consider calling ./mkChangelog to assist you.
# See './mkChangelog -h' for help.
#
SET(LIBZYPP_MAJOR "12")
SET(LIBZYPP_COMPATMINOR "0")
SET(LIBZYPP_MINOR "2")
SET(LIBZYPP_PATCH "0")
#
# LAST RELEASED: 12.2.0 (0)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
if(CURL_INCLUDE_DIR AND CURL_LIBRARY)
# Already in cache, be silent
set(CURL_FIND_QUIETLY TRUE)
endif(CURL_INCLUDE_DIR AND CURL_LIBRARY)
set(CURL_LIBRARY)
set(CURL_INCLUDE_DIR)
FIND_PATH(CURL_INCLUDE_DIR curl/curl.h
/usr/include
/usr/local/include
)
FIND_LIBRARY(CURL_LIBRARY NAMES curl
PATHS
/usr/lib
/usr/local/lib
)
if(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MESSAGE( STATUS "curl found: includes in ${CURL_INCLUDE_DIR}, library in ${CURL_LIBRARY}")
set(CURL_FOUND TRUE)
else(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MESSAGE( STATUS "curl not found")
endif(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MARK_AS_ADVANCED(CURL_INCLUDE_DIR CURL_LIBRARY)
\ No newline at end of file
if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
# Already in cache, be silent
set(DBUS_FIND_QUIETLY TRUE)
endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
set(DBUS_LIBRARY)
set(DBUS_INCLUDE_DIR)
set(DBUS_ARCH_INCLUDE_DIR)
FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h
/usr/include
/usr/include/dbus-1.0
/usr/local/include
)
FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h
/usr/lib/include
/usr/lib/dbus-1.0/include
/usr/lib64/include
/usr/lib64/dbus-1.0/include
)
FIND_LIBRARY(DBUS_LIBRARY NAMES dbus-1 dbus
PATHS
/usr/lib
/usr/local/lib
)
if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
MESSAGE( STATUS "dbus found: includes in ${DBUS_INCLUDE_DIR}, library in ${DBUS_LIBRARY}")
set(DBUS_FOUND TRUE)
else(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
MESSAGE( STATUS "dbus not found")
endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
MARK_AS_ADVANCED(DBUS_INCLUDE_DIR DBUS_LIBRARY DBUS_ARCH_INCLUDE_DIR)
\ No newline at end of file
# - Find GNU gettext tools
# This module looks for the GNU gettext tools. This module defines the
# following values:
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
# GETTEXT_FOUND: True if gettext has been found.
#
# Additionally it provides the following macros:
# GETTEXT_CREATE_TRANSLATIONS ( _moBasename [ALL] file1 ... fileN )
# This will create a target "translations" which will convert the
# given input po files into the binary output mo file. If the
# ALL option is used, the translations will also be created when
# building the default target.
FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
#
# Macro to be called if .po files are shipped as tar ball.
#
# _translation_set_basename: Serves two purposes; a) the stem of the
# default tarball %{_translation_set_basename}-po.tar.bz2 unless its over
# riden by -DUSE_TRANSLATION_SET; b) the basename of the .gmo files.
#
# We expect a po-file tarball to unpack the .po file to the current
# directory!
#
MACRO( GETTEXT_CREATE_TARBALL_TRANSLATIONS _translation_set_basename )
IF( NOT USE_TRANSLATION_SET )
SET( USE_TRANSLATION_SET ${_translation_set_basename} )
ENDIF( NOT USE_TRANSLATION_SET )
SET( TRANSLATION_SET "${USE_TRANSLATION_SET}-po.tar.bz2" )
MESSAGE( STATUS "Translation set: ${TRANSLATION_SET}" )
# For those not familiar with 'sed': the tarball might list './' and './*.po'.
# We process just the '*.po' lines and strip off any leading './'.
EXECUTE_PROCESS(
COMMAND tar tfj ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET}
COMMAND sed -n "/\\.po$/s%.*/%%p"
COMMAND awk "{printf $1\";\"}"
OUTPUT_VARIABLE TRANSLATION_SET_CONTENT
)
MESSAGE( STATUS "Translations: ${TRANSLATION_SET_CONTENT}" )
# Create 'LANG.po's from po.tar.bz2
ADD_CUSTOM_COMMAND(
OUTPUT ${TRANSLATION_SET_CONTENT}
COMMAND tar xfj ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET}
)
# LANG.po ->msgfmt-> LANG.gmo
SET( _gmoFiles )
FOREACH( _currentPoFile ${TRANSLATION_SET_CONTENT} )
GET_FILENAME_COMPONENT( _lang ${_currentPoFile} NAME_WE )
SET( _gmoFile "${_lang}.gmo" )
SET( _gmoFiles ${_gmoFiles} ${_gmoFile} )
ADD_CUSTOM_COMMAND(
OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_currentPoFile}
DEPENDS ${_currentPoFile}
)
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${_gmoFile}
DESTINATION share/locale/${_lang}/LC_MESSAGES
RENAME ${_translation_set_basename}.mo
)
# the docs claim it can handle a list, but
SET_DIRECTORY_PROPERTIES( PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES ${_currentPoFile}
ADDITIONAL_MAKE_CLEAN_FILES ${_gmoFile}
)
ENDFOREACH( _currentPoFile )
# build all .gmo files
ADD_CUSTOM_TARGET(
translations ALL
DEPENDS ${_gmoFiles}
)
ENDMACRO( GETTEXT_CREATE_TARBALL_TRANSLATIONS )
#
# Macro to be called if .po files are part of the source tree.
#
MACRO(GETTEXT_CREATE_TRANSLATIONS _moBasename _firstPoFile)
SET(_gmoFiles)
SET(_addToAll)
IF(${_firstPoFile} STREQUAL "ALL")
SET(_addToAll "ALL")
SET(_firstPoFile)
ENDIF(${_firstPoFile} STREQUAL "ALL")
FOREACH (_currentPoFile ${_firstPoFile} ${ARGN})
GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
ADD_CUSTOM_COMMAND(
OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
DEPENDS ${_absFile}
)
INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_moBasename}.mo)
SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
ENDFOREACH (_currentPoFile )
ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles})
ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
SET(GETTEXT_FOUND TRUE)
ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
SET(GETTEXT_FOUND FALSE)
IF (GetText_REQUIRED)
MESSAGE(FATAL_ERROR "GetText not found")
ENDIF (GetText_REQUIRED)
ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
if(HAL_INCLUDE_DIR AND HAL_LIBRARY AND HAL_STORAGE_LIBRARY)
# Already in cache, be silent
set(HAL_FIND_QUIETLY TRUE)
endif(HAL_INCLUDE_DIR AND HAL_LIBRARY AND HAL_STORAGE_LIBRARY)
set(HAL_LIBRARY)
set(HAL_INCLUDE_DIR)
set(HAL_STORAGE_LIBRARY)
FIND_PATH(HAL_INCLUDE_DIR hal/libhal.h
/usr/include
/usr/local/include
)
FIND_LIBRARY(HAL_LIBRARY NAMES hal
PATHS
/usr/lib
/usr/local/lib
)
FIND_LIBRARY(HAL_STORAGE_LIBRARY NAMES hal-storage
PATHS
/usr/lib
/usr/local/lib
)
if(HAL_INCLUDE_DIR AND HAL_LIBRARY AND HAL_STORAGE_LIBRARY)
MESSAGE( STATUS "hal found: includes in ${HAL_INCLUDE_DIR}, library in ${HAL_LIBRARY}")
set(HAL_FOUND TRUE)
else(HAL_INCLUDE_DIR AND HAL_LIBRARY AND HAL_STORAGE_LIBRARY)
MESSAGE( STATUS "hal not found")
endif(HAL_INCLUDE_DIR AND HAL_LIBRARY AND HAL_STORAGE_LIBRARY)
MARK_AS_ADVANCED(HAL_INCLUDE_DIR HAL_LIBRARY HAL_STORAGE_LIBRARY)
if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
# Already in cache, be silent
set(LIBXML_FIND_QUIETLY TRUE)
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
set(LIBXML_LIBRARY)
set(LIBXML_INCLUDE_DIR)
FIND_PATH(LIBXML_INCLUDE_DIR libxml/parser.h
/usr/include
/usr/include/libxml2
/usr/local/include
)
FIND_LIBRARY(LIBXML_LIBRARY NAMES xml2
PATHS
/usr/lib
/usr/local/lib
)
if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MESSAGE( STATUS "libxml found: includes in ${LIBXML_INCLUDE_DIR}, library in ${LIBXML_LIBRARY}")
set(LIBXML_FOUND TRUE)
else(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MESSAGE( STATUS "libxml not found")
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MARK_AS_ADVANCED(LIBXML_INCLUDE_DIR LIBXML_LIBRARY)
\ No newline at end of file
# - Try to find the OpenSSL encryption library
# Once done this will define
#
# OPENSSL_FOUND - system has the OpenSSL library
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
if (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
# in cache already
SET(OPENSSL_FOUND TRUE)
else (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
/usr/include/
/usr/local/include/
$ENV{ProgramFiles}/OpenSSL/include/
$ENV{SystemDrive}/OpenSSL/include/
)
if(WIN32 AND MSVC)
# /MD and /MDd are the standard values - if somone wants to use
# others, the libnames have to change here too
# see http://www.openssl.org/support/faq.html#PROG2 for their meaning
FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd
PATHS
$ENV{ProgramFiles}/OpenSSL/lib/VC/
$ENV{SystemDrive}/OpenSSL/lib/VC/
)
FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD
PATHS
$ENV{ProgramFiles}/OpenSSL/lib/VC/
$ENV{SystemDrive}/OpenSSL/lib/VC/
)
FIND_LIBRARY(LIB_EAY_DEBUG NAMES libeay32MDd
PATHS
$ENV{ProgramFiles}/OpenSSL/lib/VC/
$ENV{SystemDrive}/OpenSSL/lib/VC/
)
FIND_LIBRARY(LIB_EAY_RELEASE NAMES libeay32MD
PATHS
$ENV{ProgramFiles}/OpenSSL/lib/VC/
$ENV{SystemDrive}/OpenSSL/lib/VC/
)
IF(MSVC_IDE)
IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
SET(OPENSSL_LIBRARIES optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG})
ELSE(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
MESSAGE(FATAL_ERROR "Could not find the debug and release version of openssl")
ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
ELSE(MSVC_IDE)
STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
SET(OPENSSL_LIBRARIES ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG})
ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
SET(OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE})
ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
ENDIF(MSVC_IDE)
MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE LIB_EAY_DEBUG LIB_EAY_RELEASE)
else(WIN32 AND MSVC)
FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD libeay32 libeay32MD
PATHS
/usr/lib
/usr/local/lib
)
FIND_LIBRARY(CRYPTO_LIBRARIES crypto
PATHS
/usr/lib
/usr/local/lib
)
endif(WIN32 AND MSVC)
if (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
set(OPENSSL_FOUND TRUE)
endif (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
if (CRYPTO_LIBRARIES)
set(CRYPTO_FOUND TRUE)
message(STATUS "Found libcrypto: ${CRYPTO_LIBRARIES}")
endif (CRYPTO_LIBRARIES)
if (OPENSSL_FOUND)
if (NOT OpenSSL_FIND_QUIETLY)
message(STATUS "Found OpenSSL: ${OPENSSL_LIBRARIES}")
endif (NOT OpenSSL_FIND_QUIETLY)
else (OPENSSL_FOUND)
if (OpenSSL_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find OpenSSL")
endif (OpenSSL_FIND_REQUIRED)
endif (OPENSSL_FOUND)
MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
endif (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
if(RPM_INCLUDE_DIR AND RPM_LIBRARY)
# Already in cache, be silent
set(RPM_FIND_QUIETLY TRUE)
endif(RPM_INCLUDE_DIR AND RPM_LIBRARY)
set(RPM_LIBRARY)
set(RPM_INCLUDE_DIR)
FIND_PATH(RPM_INCLUDE_DIR rpm/rpmdb.h
/usr/include
/usr/local/include
)
set(RPM_SUSPECT_VERSION "RPM_SUSPECT_VERSION-NOTFOUND" )
if ( RPM_INCLUDE_DIR )
FIND_PATH(RPM_SUSPECT_VERSION rpm/rpm4compat.h
${RPM_INCLUDE_DIR}
NO_DEFAULT_PATH
)
if ( RPM_SUSPECT_VERSION )