[cmake-commits] hoffman committed CMakeVCManifest.cmake NONE 1.1.2.1 COPYING-CMAKE-SCRIPTS NONE 1.1.2.1 CheckCCompilerFlag.cmake NONE 1.1.2.1 CheckCSourceRuns.cmake NONE 1.4.2.1 CheckCXXCompilerFlag.cmake NONE 1.1.2.1 CheckCXXSourceRuns.cmake NONE 1.2.2.1 FindASPELL.cmake NONE 1.1.2.1 FindBZip2.cmake NONE 1.1.2.1 FindHSPELL.cmake NONE 1.1.2.1 FindJasper.cmake NONE 1.1.2.1 FindLibXml2.cmake NONE 1.1.2.1 FindLibXslt.cmake NONE 1.1.2.1 FindOpenSSL.cmake NONE 1.1.2.1

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 13 10:58:13 EDT 2006


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv5047/Modules

Added Files:
      Tag: CMake-2-4
	CMakeVCManifest.cmake COPYING-CMAKE-SCRIPTS 
	CheckCCompilerFlag.cmake CheckCSourceRuns.cmake 
	CheckCXXCompilerFlag.cmake CheckCXXSourceRuns.cmake 
	FindASPELL.cmake FindBZip2.cmake FindHSPELL.cmake 
	FindJasper.cmake FindLibXml2.cmake FindLibXslt.cmake 
	FindOpenSSL.cmake 
Log Message:
ENH: merge files from main tree to 2.4


--- NEW FILE: FindJasper.cmake ---
# - Try to find the Jasper JPEG2000 library
# Once done this will define
#
#  JASPER_FOUND - system has Jasper
#  JASPER_INCLUDE_DIR - the Jasper include directory
#  JASPER_LIBRARIES - The libraries needed to use Jasper

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


FIND_PACKAGE(JPEG)

IF (JASPER_INCLUDE_DIR AND JASPER_LIBRARIES AND JPEG_LIBRARIES)
  # Already in cache, be silent
  SET(Jasper_FIND_QUIETLY TRUE)
ENDIF (JASPER_INCLUDE_DIR AND JASPER_LIBRARIES AND JPEG_LIBRARIES)

FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h)

FIND_LIBRARY(JASPER_LIBRARY NAMES jasper libjasper)

IF (JASPER_INCLUDE_DIR AND JASPER_LIBRARY AND JPEG_LIBRARIES)
   SET(JASPER_FOUND TRUE)
   SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} )
ELSE (JASPER_INCLUDE_DIR AND JASPER_LIBRARY AND JPEG_LIBRARIES)
   SET(JASPER_FOUND FALSE)
ENDIF (JASPER_INCLUDE_DIR AND JASPER_LIBRARY AND JPEG_LIBRARIES)


IF (JASPER_FOUND)
   IF (NOT Jasper_FIND_QUIETLY)
      MESSAGE(STATUS "Found jasper: ${JASPER_LIBRARIES}")
   ENDIF (NOT Jasper_FIND_QUIETLY)
ELSE (JASPER_FOUND)
   IF (Jasper_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could NOT find jasper library")
   ENDIF (Jasper_FIND_REQUIRED)
ENDIF (JASPER_FOUND)

MARK_AS_ADVANCED(JASPER_INCLUDE_DIR JASPER_LIBRARIES JASPER_LIBRARY)

--- NEW FILE: FindOpenSSL.cmake ---
# - 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

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


IF(OPENSSL_LIBRARIES)
   SET(OpenSSL_FIND_QUIETLY TRUE)
ENDIF(OPENSSL_LIBRARIES)

IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
   SET(LIB_FOUND 1)
ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)

FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h )

IF(WIN32 AND MSVC)
   # /MD and /MDd are the standard values - if somone wants to use
   # others, the libnames have to change here too
   # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b

   FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssl ssleay32)
   FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssl ssleay32)

   IF(MSVC_IDE)
      IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
         SET(OPENSSL_LIBRARIES optimized ${SSL_EAY_RELEASE} debug ${SSL_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})
      ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
         SET(OPENSSL_LIBRARIES ${SSL_EAY_RELEASE})
      ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
   ENDIF(MSVC_IDE)
   MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
ELSE(WIN32 AND MSVC)

   FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD )

ENDIF(WIN32 AND MSVC)

IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
   SET(OPENSSL_FOUND TRUE)
ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
   SET(OPENSSL_FOUND FALSE)
ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_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)


--- NEW FILE: FindBZip2.cmake ---
# - Try to find BZip2
# Once done this will define
#
#  BZIP2_FOUND - system has BZip2
#  BZIP2_INCLUDE_DIR - the BZip2 include directory
#  BZIP2_LIBRARIES - Link these to use BZip2
#  BZIP2_DEFINITIONS - Compiler switches required for using BZip2
#  BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


IF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
    SET(BZip2_FIND_QUIETLY TRUE)
ENDIF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)

FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )

FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 )

IF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
   SET(BZIP2_FOUND TRUE)
   INCLUDE(CheckLibraryExists)
   CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARIES} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
ELSE (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
   SET(BZIP2_FOUND FALSE)
ENDIF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)

IF (BZIP2_FOUND)
  IF (NOT BZip2_FIND_QUIETLY)
    MESSAGE(STATUS "Found BZip2: ${BZIP2_LIBRARIES}")
  ENDIF (NOT BZip2_FIND_QUIETLY)
ELSE (BZIP2_FOUND)
  IF (BZip2_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could NOT find BZip2")
  ENDIF (BZip2_FIND_REQUIRED)
ENDIF (BZIP2_FOUND)

MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES)


--- NEW FILE: CheckCSourceRuns.cmake ---
# - Check if the source code provided in the SOURCE argument compiles and runs.
# CHECK_C_SOURCE_RUNS(SOURCE VAR)
# - macro which checks if the source code runs
#  SOURCE   - source code to try to compile
#  VAR - variable to store size if the type exists.
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
#  CMAKE_REQUIRED_INCLUDES = list of include directories
#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link

MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
  IF("${VAR}" MATCHES "^${VAR}$")
    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
    IF(CMAKE_REQUIRED_LIBRARIES)
      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
    ELSE(CMAKE_REQUIRED_LIBRARIES)
      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
    ENDIF(CMAKE_REQUIRED_LIBRARIES)
    IF(CMAKE_REQUIRED_INCLUDES)
      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
    ELSE(CMAKE_REQUIRED_INCLUDES)
      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
    ENDIF(CMAKE_REQUIRED_INCLUDES)
    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
      "${SOURCE}\n")

    MESSAGE(STATUS "Performing Test ${VAR}")
    TRY_RUN(${VAR} ${VAR}_COMPILED
      ${CMAKE_BINARY_DIR}
      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
      "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
      "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
      OUTPUT_VARIABLE OUTPUT)
    # if it did not compile make the return value fail code of 1
    IF(NOT ${VAR}_COMPILED)
      SET(${VAR} 1)
    ENDIF(NOT ${VAR}_COMPILED)
    # if the return value was 0 then it worked
    SET(result_var ${${VAR}})
    IF("${result_var}" EQUAL 0)
      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
      MESSAGE(STATUS "Performing Test ${VAR} - Success")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
        "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
        "${OUTPUT}\n"
        "Return value: ${${VAR}}\n"
        "Source file was:\n${SOURCE}\n")
    ELSE("${result_var}" EQUAL 0)
      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
      SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
        "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
        "${OUTPUT}\n"
        "Return value: ${result_var}\n"
        "Source file was:\n${SOURCE}\n")
    ENDIF("${result_var}" EQUAL 0)
  ENDIF("${VAR}" MATCHES "^${VAR}$")
ENDMACRO(CHECK_C_SOURCE_RUNS)


--- NEW FILE: FindLibXml2.cmake ---
# - Try to find LibXml2
# Once done this will define
#
#  LIBXML2_FOUND - system has LibXml2
#  LIBXML2_INCLUDE_DIR - the LibXml2 include directory
#  LIBXML2_LIBRARIES - the libraries needed to use LibXml2
#  LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
#
# Copyright (c) 2006, Alexander Neundorf <neundorf at kde.org>
# This code is available under the BSD license, see licenses/BSD for details.

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
   # in cache already
   SET(LibXml2_FIND_QUIETLY TRUE)
ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)

IF (NOT WIN32)
   # use pkg-config to get the directories and then use these values
   # in the FIND_PATH() and FIND_LIBRARY() calls
   INCLUDE(UsePkgConfig)
   PKGCONFIG(libxml-2.0 _LibXml2IncDir _LibXml2LinkDir _LibXml2LinkFlags _LibXml2Cflags)
   SET(LIBXML2_DEFINITIONS ${_LibXml2Cflags})
ENDIF (NOT WIN32)

FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
   PATHS
   ${_LibXml2IncDir}
   PATH_SUFFIXES libxml2
   )

FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
   PATHS
   ${_LibXml2LinkDir}
   )

IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
   SET(LIBXML2_FOUND TRUE)
ELSE (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
   SET(LIBXML2_FOUND FALSE)
ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)

IF (LIBXML2_FOUND)
   IF (NOT LibXml2_FIND_QUIETLY)
      MESSAGE(STATUS "Found LibXml2: ${LIBXML2_LIBRARIES}")
   ENDIF (NOT LibXml2_FIND_QUIETLY)
ELSE (LIBXML2_FOUND)
   IF (LibXml2_FIND_REQUIRED)
      MESSAGE(SEND_ERROR "Could NOT find LibXml2")
   ENDIF (LibXml2_FIND_REQUIRED)
ENDIF (LIBXML2_FOUND)

MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)


--- NEW FILE: FindASPELL.cmake ---
# - Try to find ASPELL
# Once done this will define
#
#  ASPELL_FOUND - system has ASPELL
#  ASPELL_INCLUDE_DIR - the ASPELL include directory
#  ASPELL_LIBRARIES - The libraries needed to use ASPELL
#  ASPELL_DEFINITIONS - Compiler switches required for using ASPELL

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


IF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)
  # Already in cache, be silent
  SET(ASPELL_FIND_QUIETLY TRUE)
ENDIF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)

FIND_PATH(ASPELL_INCLUDE_DIR aspell.h )

FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15)

IF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)
   SET(ASPELL_FOUND TRUE)
ELSE (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)
   SET(ASPELL_FOUND FALSE)
ENDIF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)

IF (ASPELL_FOUND)
  IF (NOT ASPELL_FIND_QUIETLY)
    MESSAGE(STATUS "Found ASPELL: ${ASPELL_LIBRARIES}")
  ENDIF (NOT ASPELL_FIND_QUIETLY)
ELSE (ASPELL_FOUND)
  IF (ASPELL_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could NOT find ASPELL")
  ENDIF (ASPELL_FIND_REQUIRED)
ENDIF (ASPELL_FOUND)

MARK_AS_ADVANCED(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES)

--- NEW FILE: FindHSPELL.cmake ---
# - Try to find HSPELL
# Once done this will define
#
#  HSPELL_FOUND - system has HSPELL
#  HSPELL_INCLUDE_DIR - the HSPELL include directory
#  HSPELL_LIBRARIES - The libraries needed to use HSPELL
#  HSPELL_DEFINITIONS - Compiler switches required for using HSPELL

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


IF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)
  # Already in cache, be silent
  SET(HSPELL_FIND_QUIETLY TRUE)
ENDIF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)


FIND_PATH(HSPELL_INCLUDE_DIR hspell.h )

FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell )

IF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)
   SET(HSPELL_FOUND TRUE)
ELSE (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)
   SET(HSPELL_FOUND FALSE)
ENDIF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)

IF (HSPELL_FOUND)
  IF (NOT HSPELL_FIND_QUIETLY)
    MESSAGE(STATUS "Found HSPELL: ${HSPELL_LIBRARIES}")
  ENDIF (NOT HSPELL_FIND_QUIETLY)
ELSE (HSPELL_FOUND)
  IF (HSPELL_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could NOT find HSPELL")
  ENDIF (HSPELL_FIND_REQUIRED)
ENDIF (HSPELL_FOUND)

MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)


--- NEW FILE: CheckCXXSourceRuns.cmake ---
# - Check if the source code provided in the SOURCE argument compiles and runs.
# CHECK_CXX_SOURCE_RUNS(SOURCE VAR)
# - macro which checks if the source code compiles
#  SOURCE - source code to try to compile
#  VAR    - variable to store size if the type exists.
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
#  CMAKE_REQUIRED_INCLUDES = list of include directories
#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link

MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
  IF("${VAR}" MATCHES "^${VAR}$")
    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
    IF(CMAKE_REQUIRED_LIBRARIES)
      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
    ELSE(CMAKE_REQUIRED_LIBRARIES)
      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
    ENDIF(CMAKE_REQUIRED_LIBRARIES)
    IF(CMAKE_REQUIRED_INCLUDES)
      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
    ELSE(CMAKE_REQUIRED_INCLUDES)
      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
    ENDIF(CMAKE_REQUIRED_INCLUDES)
    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
      "${SOURCE}\n")

    MESSAGE(STATUS "Performing Test ${VAR}")
    TRY_RUN(${VAR} ${VAR}_COMPILED
      ${CMAKE_BINARY_DIR}
      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
      "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
      "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
      OUTPUT_VARIABLE OUTPUT)
    # if it did not compile make the return value fail code of 1
    IF(NOT ${VAR}_COMPILED)
      SET(${VAR} 1)
    ENDIF(NOT ${VAR}_COMPILED)
    # if the return value was 0 then it worked
    SET(result_var ${${VAR}})
    IF("${result_var}" EQUAL 0)
      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
      MESSAGE(STATUS "Performing Test ${VAR} - Success")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
        "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
        "${OUTPUT}\n" 
        "Return value: ${${VAR}}\n"
        "Source file was:\n${SOURCE}\n")
    ELSE("${result_var}" EQUAL 0)
      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
      SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
        "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
        "${OUTPUT}\n"  
        "Return value: ${${VAR}}\n"
        "Source file was:\n${SOURCE}\n")
    ENDIF("${result_var}" EQUAL 0)
  ENDIF("${VAR}" MATCHES "^${VAR}$")
ENDMACRO(CHECK_CXX_SOURCE_RUNS)


--- NEW FILE: COPYING-CMAKE-SCRIPTS ---
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products 
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--- NEW FILE: CMakeVCManifest.cmake ---

# Leave the first line of this file empty so this module will not be
# included in the documentation.

# This script is invoked from Windows-cl.cmake and passed the TARGET
# variable on the command line.

# Conditionally embed the manifest in the executable if it exists.
IF(EXISTS "${TARGET}.manifest")
  # Construct the manifest embedding command.
  SET(CMD
    mt ${CMAKE_CL_NOLOGO} /manifest ${TARGET}.manifest
    /outputresource:${TARGET}
    )

  # Run the embedding command.
  EXECUTE_PROCESS(COMMAND ${CMD}\;\#2 RESULT_VARIABLE RESULT)

  # Check whether the command failed.
  IF(NOT "${RESULT}" MATCHES "^0$")
    # The embedding failed remove the target and the manifest.
    FILE(REMOVE ${TARGET} ${TARGET}.manifest)

    # Describe the failure in a message.
    STRING(REGEX REPLACE ";" " " CMD "${CMD}")
    MESSAGE(FATAL_ERROR
      "Failed to embed manifest in ${TARGET} using command \"${CMD};#2\""
      )
  ENDIF(NOT "${RESULT}" MATCHES "^0$")
ENDIF(EXISTS "${TARGET}.manifest")

--- NEW FILE: CheckCXXCompilerFlag.cmake ---
# - Check whether the CXX compiler supports a given flag.
# CHECK_CXX_COMPILER_FLAG(FLAG VARIABLE)
#
#  FLAG - the compiler flag
#  VARIABLE - variable to store the result

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


INCLUDE(CheckCXXSourceCompiles)

MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
   SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
   SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
   CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT})
   SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_CXX_COMPILER_FLAG)


--- NEW FILE: CheckCCompilerFlag.cmake ---
# - Check whether the C compiler supports a given flag.
# CHECK_C_COMPILER_FLAG(FLAG VARIABLE)
#
#  FLAG - the compiler flag
#  VARIABLE - variable to store the result

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


INCLUDE(CheckCSourceCompiles)

MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
   SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
   SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
   CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT})
   SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_C_COMPILER_FLAG)


--- NEW FILE: FindLibXslt.cmake ---
# - Try to find LibXslt
# Once done this will define
#
#  LIBXSLT_FOUND - system has LibXslt
#  LIBXSLT_INCLUDE_DIR - the LibXslt include directory
#  LIBXSLT_LIBRARIES - Link these to LibXslt
#  LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
   # in cache already
   SET(LibXslt_FIND_QUIETLY TRUE)
ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)

IF (NOT WIN32)
   # use pkg-config to get the directories and then use these values
   # in the FIND_PATH() and FIND_LIBRARY() calls
   INCLUDE(UsePkgConfig)
   PKGCONFIG(libxslt _LibXsltIncDir _LibXsltLinkDir _LibXsltLinkFlags _LibXsltCflags)
   SET(LIBXSLT_DEFINITIONS ${_LibXsltCflags})
ENDIF (NOT WIN32)

FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h
    ${_LibXsltIncDir}
  )

FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
    PATHS
    ${_LibXsltLinkDir}
  )

IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
   SET(LIBXSLT_FOUND TRUE)
ELSE (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
   SET(LIBXSLT_FOUND FALSE)
ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  
IF (LIBXSLT_FOUND)
   IF (NOT LibXslt_FIND_QUIETLY)
      MESSAGE(STATUS "Found LibXslt: ${LIBXSLT_LIBRARIES}")
   ENDIF (NOT LibXslt_FIND_QUIETLY)
ELSE (LIBXSLT_FOUND)
   IF (LibXslt_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could NOT find LibXslt")
   ENDIF (LibXslt_FIND_REQUIRED)
ENDIF (LIBXSLT_FOUND)

MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES)




More information about the Cmake-commits mailing list