parent
09772af5e4
commit
d0eb81feeb
@ -0,0 +1,18 @@
|
|||||||
|
#=============================================================================
|
||||||
|
# CMake - Cross Platform Makefile Generator
|
||||||
|
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
|
# Loaded by .git/hooks/(pre-commit|commit-msg|prepare-commit-msg)
|
||||||
|
# during git commit after local hooks have been installed.
|
||||||
|
|
||||||
|
hooks_chain_pre_commit="Utilities/Git/pre-commit"
|
||||||
|
hooks_chain_commit_msg="Utilities/Git/commit-msg"
|
||||||
|
hooks_chain_prepare_commit_msg="Utilities/Git/prepare-commit-msg"
|
@ -0,0 +1,16 @@
|
|||||||
|
set(AM_SOURCES "@_moc_files@" )
|
||||||
|
set(AM_HEADERS "@_moc_headers@" )
|
||||||
|
set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@")
|
||||||
|
set(AM_MOC_DEFINITIONS "@_moc_defs@")
|
||||||
|
set(AM_MOC_INCLUDES "@_moc_incs@")
|
||||||
|
set(AM_MOC_OPTIONS "@_moc_options@")
|
||||||
|
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
|
||||||
|
set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
|
||||||
|
set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
|
||||||
|
set(AM_QT_MOC_EXECUTABLE "@QT_MOC_EXECUTABLE@")
|
||||||
|
set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
|
||||||
|
set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
|
||||||
|
set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" )
|
||||||
|
set(AM_Qt5Core_VERSION_MAJOR "@Qt5Core_VERSION_MAJOR@" )
|
||||||
|
set(AM_TARGET_NAME "@_moc_target_name@")
|
||||||
|
set(AM_RELAXED_MODE "@_moc_relaxed_mode@")
|
@ -0,0 +1,26 @@
|
|||||||
|
# This is a basic version file for the Config-mode of find_package().
|
||||||
|
# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file()
|
||||||
|
# to create a version-file which can be installed along a config.cmake file.
|
||||||
|
#
|
||||||
|
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||||
|
# the requested version string are exactly the same and it sets
|
||||||
|
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
|
||||||
|
# The variable CVF_VERSION must be set before calling configure_file().
|
||||||
|
|
||||||
|
set(PACKAGE_VERSION "@CVF_VERSION@")
|
||||||
|
|
||||||
|
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||||
|
else()
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||||
|
if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
|
||||||
|
set(PACKAGE_VERSION_EXACT TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||||
|
if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
|
||||||
|
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
|
||||||
|
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
|
endif()
|
@ -0,0 +1,41 @@
|
|||||||
|
# This is a basic version file for the Config-mode of find_package().
|
||||||
|
# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file()
|
||||||
|
# to create a version-file which can be installed along a config.cmake file.
|
||||||
|
#
|
||||||
|
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||||
|
# the requested version string are exactly the same and it sets
|
||||||
|
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
|
||||||
|
# but only if the requested major version is the same as the current one.
|
||||||
|
# The variable CVF_VERSION must be set before calling configure_file().
|
||||||
|
|
||||||
|
|
||||||
|
set(PACKAGE_VERSION "@CVF_VERSION@")
|
||||||
|
|
||||||
|
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||||
|
else()
|
||||||
|
|
||||||
|
if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.")
|
||||||
|
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||||
|
else()
|
||||||
|
set(CVF_VERSION_MAJOR "@CVF_VERSION@")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "${CVF_VERSION_MAJOR}")
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||||
|
else()
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
|
||||||
|
set(PACKAGE_VERSION_EXACT TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||||
|
if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
|
||||||
|
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
|
||||||
|
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
|
endif()
|
@ -0,0 +1,120 @@
|
|||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2009 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
# This file is included by CMakeFindEclipseCDT4.cmake and CMakeFindCodeBlocks.cmake
|
||||||
|
|
||||||
|
# The Eclipse and the CodeBlocks generators need to know the standard include path
|
||||||
|
# so that they can find the headers at runtime and parsing etc. works better
|
||||||
|
# This is done here by actually running gcc with the options so it prints its
|
||||||
|
# system include directories, which are parsed then and stored in the cache.
|
||||||
|
MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
|
||||||
|
SET(${_resultIncludeDirs})
|
||||||
|
SET(_gccOutput)
|
||||||
|
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
|
||||||
|
|
||||||
|
IF (${_lang} STREQUAL "c++")
|
||||||
|
SET(_compilerExecutable "${CMAKE_CXX_COMPILER}")
|
||||||
|
SET(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
|
||||||
|
ELSE ()
|
||||||
|
SET(_compilerExecutable "${CMAKE_C_COMPILER}")
|
||||||
|
SET(_arg1 "${CMAKE_C_COMPILER_ARG1}")
|
||||||
|
ENDIF ()
|
||||||
|
EXECUTE_PROCESS(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
|
||||||
|
ERROR_VARIABLE _gccOutput
|
||||||
|
OUTPUT_VARIABLE _gccStdout )
|
||||||
|
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
|
||||||
|
|
||||||
|
# First find the system include dirs:
|
||||||
|
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
|
||||||
|
|
||||||
|
# split the output into lines and then remove leading and trailing spaces from each of them:
|
||||||
|
STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
|
||||||
|
FOREACH(nextLine ${_includeLines})
|
||||||
|
STRING(STRIP "${nextLine}" _includePath)
|
||||||
|
LIST(APPEND ${_resultIncludeDirs} "${_includePath}")
|
||||||
|
ENDFOREACH(nextLine)
|
||||||
|
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
# now find the builtin macros:
|
||||||
|
STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
|
||||||
|
# A few example lines which the regexp below has to match properly:
|
||||||
|
# #define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||||
|
# #define __fastcall __attribute__((__fastcall__))
|
||||||
|
# #define FOO (23)
|
||||||
|
# #define __UINTMAX_TYPE__ long long unsigned int
|
||||||
|
# #define __UINTMAX_TYPE__ long long unsigned int
|
||||||
|
# #define __i386__ 1
|
||||||
|
|
||||||
|
FOREACH(nextLine ${_defineLines})
|
||||||
|
STRING(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
|
||||||
|
SET(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
|
||||||
|
STRING(STRIP "${CMAKE_MATCH_3}" _value)
|
||||||
|
#MESSAGE(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
|
||||||
|
|
||||||
|
LIST(APPEND ${_resultDefines} "${_name}")
|
||||||
|
IF(_value)
|
||||||
|
LIST(APPEND ${_resultDefines} "${_value}")
|
||||||
|
ELSE()
|
||||||
|
LIST(APPEND ${_resultDefines} " ")
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH(nextLine)
|
||||||
|
|
||||||
|
ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
|
||||||
|
|
||||||
|
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
|
||||||
|
# to "C" that way GCC's "search starts here" text is in English and we can grok it.
|
||||||
|
SET(_orig_lc_all $ENV{LC_ALL})
|
||||||
|
SET(_orig_lc_messages $ENV{LC_MESSAGES})
|
||||||
|
SET(_orig_lang $ENV{LANG})
|
||||||
|
IF(_orig_lc_all)
|
||||||
|
SET(ENV{LC_ALL} C)
|
||||||
|
ENDIF()
|
||||||
|
IF(_orig_lc_messages)
|
||||||
|
SET(ENV{LC_MESSAGES} C)
|
||||||
|
ENDIF()
|
||||||
|
IF(_orig_lang)
|
||||||
|
SET(ENV{LANG} C)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Now check for C, works for gcc and Intel compiler at least
|
||||||
|
IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
|
||||||
|
IF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
|
||||||
|
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines)
|
||||||
|
SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
|
||||||
|
SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
|
||||||
|
ENDIF ()
|
||||||
|
ENDIF ()
|
||||||
|
|
||||||
|
# And now the same for C++
|
||||||
|
IF (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
|
||||||
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
|
||||||
|
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines)
|
||||||
|
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
|
||||||
|
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
|
||||||
|
ENDIF ()
|
||||||
|
ENDIF ()
|
||||||
|
|
||||||
|
# Restore original LC_ALL, LC_MESSAGES, and LANG
|
||||||
|
IF(_orig_lc_all)
|
||||||
|
SET(ENV{LC_ALL} ${_orig_lc_all})
|
||||||
|
ENDIF()
|
||||||
|
IF(_orig_lc_messages)
|
||||||
|
SET(ENV{LC_MESSAGES} ${_orig_lc_messages})
|
||||||
|
ENDIF()
|
||||||
|
IF(_orig_lang)
|
||||||
|
SET(ENV{LANG} ${_orig_lang})
|
||||||
|
ENDIF()
|
@ -0,0 +1,187 @@
|
|||||||
|
# This file is executed by cmake when invoked with --find-package.
|
||||||
|
# It expects that the following variables are set using -D:
|
||||||
|
# NAME = name of the package
|
||||||
|
# COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc.
|
||||||
|
# LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM
|
||||||
|
# MODE = EXIST : only check for existance of the given package
|
||||||
|
# COMPILE : print the flags needed for compiling an object file which uses the given package
|
||||||
|
# LINK : print the flags needed for linking when using the given package
|
||||||
|
# QUIET = if TRUE, don't print anything
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2006-2011 Alexander Neundorf, <neundorf@kde.org>
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
if(NOT NAME)
|
||||||
|
message(FATAL_ERROR "Name of the package to be searched not specified. Set the CMake variable NAME, e.g. -DNAME=JPEG .")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT COMPILER_ID)
|
||||||
|
message(FATAL_ERROR "COMPILER_ID argument not specified. In doubt, use GNU.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT LANGUAGE)
|
||||||
|
message(FATAL_ERROR "LANGUAGE argument not specified. Use C, CXX or Fortran.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT MODE)
|
||||||
|
message(FATAL_ERROR "MODE argument not specified. Use either EXIST, COMPILE or LINK.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# require the current version. If we don't do this, Platforms/CYGWIN.cmake complains because
|
||||||
|
# it doesn't know whether it should set WIN32 or not:
|
||||||
|
cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} )
|
||||||
|
|
||||||
|
macro(ENABLE_LANGUAGE)
|
||||||
|
# disable the enable_language() command, otherwise --find-package breaks on Windows.
|
||||||
|
# On Windows, enable_language(RC) is called in the platform files unconditionally.
|
||||||
|
# But in --find-package mode, we don't want (and can't) enable any language.
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
include(CMakeDetermineSystem)
|
||||||
|
|
||||||
|
# short-cut some tests on Darwin, see Darwin-GNU.cmake:
|
||||||
|
if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin AND "${COMPILER_ID}" MATCHES GNU)
|
||||||
|
set(${CMAKE_${LANGUAGE}_HAS_ISYSROOT} 0 )
|
||||||
|
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Also load the system specific file, which sets up e.g. the search paths.
|
||||||
|
# This makes the FIND_XXX() calls work much better
|
||||||
|
include(CMakeSystemSpecificInformation)
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
|
||||||
|
# try to guess whether we have a 64bit system, if it has not been set
|
||||||
|
# from the outside
|
||||||
|
if(NOT CMAKE_SIZEOF_VOID_P)
|
||||||
|
set(CMAKE_SIZEOF_VOID_P 4)
|
||||||
|
if(EXISTS /usr/lib64)
|
||||||
|
set(CMAKE_SIZEOF_VOID_P 8)
|
||||||
|
else()
|
||||||
|
# use the file utility to check whether itself is 64 bit:
|
||||||
|
find_program(FILE_EXECUTABLE file)
|
||||||
|
if(FILE_EXECUTABLE)
|
||||||
|
execute_process(COMMAND "${FILE_EXECUTABLE}" "${FILE_EXECUTABLE}" OUTPUT_VARIABLE fileOutput ERROR_QUIET)
|
||||||
|
if("${fileOutput}" MATCHES "64-bit")
|
||||||
|
set(CMAKE_SIZEOF_VOID_P 8)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# guess Debian multiarch if it has not been set:
|
||||||
|
if(EXISTS /etc/debian_version)
|
||||||
|
if(NOT CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE )
|
||||||
|
file(GLOB filesInLib RELATIVE /lib /lib/*-linux-gnu* )
|
||||||
|
foreach(file ${filesInLib})
|
||||||
|
if("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
|
||||||
|
set(CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE ${file})
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_${LANGUAGE}_COMPILER "dummy")
|
||||||
|
set(CMAKE_${LANGUAGE}_COMPILER_ID "${COMPILER_ID}")
|
||||||
|
include(CMake${LANGUAGE}Information)
|
||||||
|
|
||||||
|
|
||||||
|
function(set_compile_flags_var _packageName)
|
||||||
|
string(TOUPPER "${_packageName}" PACKAGE_NAME)
|
||||||
|
# Check the following variables:
|
||||||
|
# FOO_INCLUDE_DIRS
|
||||||
|
# Foo_INCLUDE_DIRS
|
||||||
|
# FOO_INCLUDES
|
||||||
|
# Foo_INCLUDES
|
||||||
|
# FOO_INCLUDE_DIR
|
||||||
|
# Foo_INCLUDE_DIR
|
||||||
|
set(includes)
|
||||||
|
if(DEFINED ${_packageName}_INCLUDE_DIRS)
|
||||||
|
set(includes ${_packageName}_INCLUDE_DIRS)
|
||||||
|
elseif(DEFINED ${PACKAGE_NAME}_INCLUDE_DIRS)
|
||||||
|
set(includes ${PACKAGE_NAME}_INCLUDE_DIRS)
|
||||||
|
elseif(DEFINED ${_packageName}_INCLUDES)
|
||||||
|
set(includes ${_packageName}_INCLUDES)
|
||||||
|
elseif(DEFINED ${PACKAGE_NAME}_INCLUDES)
|
||||||
|
set(includes ${PACKAGE_NAME}_INCLUDES)
|
||||||
|
elseif(DEFINED ${_packageName}_INCLUDE_DIR)
|
||||||
|
set(includes ${_packageName}_INCLUDE_DIR)
|
||||||
|
elseif(DEFINED ${PACKAGE_NAME}_INCLUDE_DIR)
|
||||||
|
set(includes ${PACKAGE_NAME}_INCLUDE_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PACKAGE_INCLUDE_DIRS "${${includes}}" PARENT_SCOPE)
|
||||||
|
|
||||||
|
# Check the following variables:
|
||||||
|
# FOO_DEFINITIONS
|
||||||
|
# Foo_DEFINITIONS
|
||||||
|
set(definitions)
|
||||||
|
if(DEFINED ${_packageName}_DEFINITIONS)
|
||||||
|
set(definitions ${_packageName}_DEFINITIONS)
|
||||||
|
elseif(DEFINED ${PACKAGE_NAME}_DEFINITIONS)
|
||||||
|
set(definitions ${PACKAGE_NAME}_DEFINITIONS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PACKAGE_DEFINITIONS "${${definitions}}" )
|
||||||
|
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
function(set_link_flags_var _packageName)
|
||||||
|
string(TOUPPER "${_packageName}" PACKAGE_NAME)
|
||||||
|
# Check the following variables:
|
||||||
|
# FOO_LIBRARIES
|
||||||
|
# Foo_LIBRARIES
|
||||||
|
# FOO_LIBS
|
||||||
|
# Foo_LIBS
|
||||||
|
set(libs)
|
||||||
|
if(DEFINED ${_packageName}_LIBRARIES)
|
||||||
|
set(libs ${_packageName}_LIBRARIES)
|
||||||
|
elseif(DEFINED ${PACKAGE_NAME}_LIBRARIES)
|
||||||
|
set(libs ${PACKAGE_NAME}_LIBRARIES)
|
||||||
|
elseif(DEFINED ${_packageName}_LIBS)
|
||||||
|
set(libs ${_packageName}_LIBS)
|
||||||
|
elseif(DEFINED ${PACKAGE_NAME}_LIBS)
|
||||||
|
set(libs ${PACKAGE_NAME}_LIBS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PACKAGE_LIBRARIES "${${libs}}" PARENT_SCOPE )
|
||||||
|
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
find_package("${NAME}" QUIET)
|
||||||
|
|
||||||
|
set(PACKAGE_FOUND FALSE)
|
||||||
|
|
||||||
|
string(TOUPPER "${NAME}" UPPERCASE_NAME)
|
||||||
|
|
||||||
|
if(${NAME}_FOUND OR ${UPPERCASE_NAME}_FOUND)
|
||||||
|
set(PACKAGE_FOUND TRUE)
|
||||||
|
|
||||||
|
if("${MODE}" STREQUAL "EXIST")
|
||||||
|
# do nothing
|
||||||
|
elseif("${MODE}" STREQUAL "COMPILE")
|
||||||
|
set_compile_flags_var(${NAME})
|
||||||
|
elseif("${MODE}" STREQUAL "LINK")
|
||||||
|
set_link_flags_var(${NAME})
|
||||||
|
else("${MODE}" STREQUAL "LINK")
|
||||||
|
message(FATAL_ERROR "Invalid mode argument ${MODE} given.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PACKAGE_QUIET ${SILENT} )
|
@ -0,0 +1,61 @@
|
|||||||
|
# This module defines two macros:
|
||||||
|
# CMAKE_PUSH_CHECK_STATE()
|
||||||
|
# and
|
||||||
|
# CMAKE_POP_CHECK_STATE()
|
||||||
|
# These two macros can be used to save and restore the state of the variables
|
||||||
|
# CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES
|
||||||
|
# and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake,
|
||||||
|
# like e.g. check_function_exists() etc.
|
||||||
|
# The variable contents are pushed on a stack, pushing multiple times is supported.
|
||||||
|
# This is useful e.g. when executing such tests in a Find-module, where they have to be set,
|
||||||
|
# but after the Find-module has been executed they should have the same value
|
||||||
|
# as they had before.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# cmake_push_check_state()
|
||||||
|
# set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
|
||||||
|
# check_function_exists(...)
|
||||||
|
# cmake_pop_check_state()
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2006-2011 Alexander Neundorf, <neundorf@kde.org>
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
|
||||||
|
MACRO(CMAKE_PUSH_CHECK_STATE)
|
||||||
|
|
||||||
|
IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
|
||||||
|
SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
|
||||||
|
|
||||||
|
SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
|
||||||
|
SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
|
||||||
|
SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
|
SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
|
||||||
|
ENDMACRO(CMAKE_PUSH_CHECK_STATE)
|
||||||
|
|
||||||
|
MACRO(CMAKE_POP_CHECK_STATE)
|
||||||
|
|
||||||
|
# don't pop more than we pushed
|
||||||
|
IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
|
||||||
|
|
||||||
|
SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
|
||||||
|
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ENDMACRO(CMAKE_POP_CHECK_STATE)
|
@ -0,0 +1 @@
|
|||||||
|
VERSION=__WATCOMC__
|
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2007-2011 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
# Look for devenv as a build program. We need to use this to support
|
||||||
|
# Intel Fortran integration into VS. MSBuild can not be used for that case
|
||||||
|
# since Intel Fortran uses the older devenv file format.
|
||||||
|
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
||||||
|
NAMES devenv
|
||||||
|
HINTS
|
||||||
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory]
|
||||||
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup;Dbghelp_path]
|
||||||
|
"$ENV{ProgramFiles}/Microsoft Visual Studio 11.0/Common7/IDE"
|
||||||
|
"$ENV{ProgramFiles}/Microsoft Visual Studio11.0/Common7/IDE"
|
||||||
|
"$ENV{ProgramFiles}/Microsoft Visual Studio 11/Common7/IDE"
|
||||||
|
"$ENV{ProgramFiles}/Microsoft Visual Studio11/Common7/IDE"
|
||||||
|
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 11.0/Common7/IDE"
|
||||||
|
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio11.0/Common7/IDE"
|
||||||
|
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 11/Common7/IDE"
|
||||||
|
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio11/Common7/IDE"
|
||||||
|
"/Program Files/Microsoft Visual Studio 11.0/Common7/IDE/"
|
||||||
|
"/Program Files/Microsoft Visual Studio 11/Common7/IDE/"
|
||||||
|
)
|
||||||
|
|
||||||
|
# if devenv is not found, then use MSBuild.
|
||||||
|
# it is expected that if devenv is not found, then we are
|
||||||
|
# dealing with Visual Studio Express. VCExpress has random
|
||||||
|
# failures when being run as a command line build tool which
|
||||||
|
# causes the compiler checks and try-compile stuff to fail. MSbuild
|
||||||
|
# is a better choice for this. However, VCExpress does not support
|
||||||
|
# cross compiling needed for Win CE.
|
||||||
|
IF(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
||||||
|
NAMES MSBuild
|
||||||
|
HINTS
|
||||||
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
|
||||||
|
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
|
||||||
|
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
|
||||||
|
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
||||||
|
SET(MSVC11 1)
|
||||||
|
SET(MSVC_VERSION 1700)
|
@ -0,0 +1,42 @@
|
|||||||
|
# - Check if a symbol exists as a function, variable, or macro in C++
|
||||||
|
# CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
|
||||||
|
#
|
||||||
|
# Check that the <symbol> is available after including given header
|
||||||
|
# <files> and store the result in a <variable>. Specify the list
|
||||||
|
# of files in one argument as a semicolon-separated list.
|
||||||
|
# CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as opposed
|
||||||
|
# to CHECK_SYMBOL_EXISTS(), which works only for C.
|
||||||
|
#
|
||||||
|
# If the header files define the symbol as a macro it is considered
|
||||||
|
# available and assumed to work. If the header files declare the
|
||||||
|
# symbol as a function or variable then the symbol must also be
|
||||||
|
# available for linking. If the symbol is a type or enum value
|
||||||
|
# it will not be recognized (consider using CheckTypeSize or
|
||||||
|
# CheckCSourceCompiles).
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2003-2011 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
INCLUDE(CheckSymbolExists)
|
||||||
|
|
||||||
|
MACRO(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
|
||||||
|
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
|
||||||
|
ENDMACRO(CHECK_CXX_SYMBOL_EXISTS)
|
@ -1 +1,3 @@
|
|||||||
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
|
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
|
||||||
|
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "+source=fixed")
|
||||||
|
set(CMAKE_Fortran_FORMAT_FREE_FLAG "+source=free")
|
||||||
|
@ -1 +1,3 @@
|
|||||||
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
|
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
|
||||||
|
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
|
||||||
|
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
|
||||||
|
|
||||||
|
# no optimization in tcc:
|
||||||
|
SET (CMAKE_C_FLAGS_INIT "")
|
||||||
|
SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
|
||||||
|
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
|
||||||
|
SET (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
|
||||||
|
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
|
@ -0,0 +1,285 @@
|
|||||||
|
# - Functions to help assemble a standalone Qt4 executable.
|
||||||
|
# A collection of CMake utility functions useful for deploying
|
||||||
|
# Qt4 executables.
|
||||||
|
#
|
||||||
|
# The following functions are provided by this module:
|
||||||
|
# write_qt4_conf
|
||||||
|
# resolve_qt4_paths
|
||||||
|
# fixup_qt4_executable
|
||||||
|
# install_qt4_plugin_path
|
||||||
|
# install_qt4_plugin
|
||||||
|
# install_qt4_executable
|
||||||
|
# Requires CMake 2.6 or greater because it uses function and
|
||||||
|
# PARENT_SCOPE. Also depends on BundleUtilities.cmake.
|
||||||
|
#
|
||||||
|
# WRITE_QT4_CONF(<qt_conf_dir> <qt_conf_contents>)
|
||||||
|
# Writes a qt.conf file with the <qt_conf_contents> into <qt_conf_dir>.
|
||||||
|
#
|
||||||
|
# RESOLVE_QT4_PATHS(<paths_var> [<executable_path>])
|
||||||
|
# Loop through <paths_var> list and if any don't exist resolve them
|
||||||
|
# relative to the <executable_path> (if supplied) or the CMAKE_INSTALL_PREFIX.
|
||||||
|
#
|
||||||
|
# FIXUP_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
|
||||||
|
# Copies Qt plugins, writes a Qt configuration file (if needed) and fixes up a
|
||||||
|
# Qt4 executable using BundleUtilities so it is standalone and can be
|
||||||
|
# drag-and-drop copied to another machine as long as all of the system
|
||||||
|
# libraries are compatible.
|
||||||
|
#
|
||||||
|
# <executable> should point to the executable to be fixed-up.
|
||||||
|
#
|
||||||
|
# <qtplugins> should contain a list of the names or paths of any Qt plugins
|
||||||
|
# to be installed.
|
||||||
|
#
|
||||||
|
# <libs> will be passed to BundleUtilities and should be a list of any already
|
||||||
|
# installed plugins, libraries or executables to also be fixed-up.
|
||||||
|
#
|
||||||
|
# <dirs> will be passed to BundleUtilities and should contain and directories
|
||||||
|
# to be searched to find library dependencies.
|
||||||
|
#
|
||||||
|
# <plugins_dir> allows an custom plugins directory to be used.
|
||||||
|
#
|
||||||
|
# <request_qt_conf> will force a qt.conf file to be written even if not needed.
|
||||||
|
#
|
||||||
|
# INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var <plugins_dir> <component> <configurations>)
|
||||||
|
# Install (or copy) a resolved <plugin> to the default plugins directory
|
||||||
|
# (or <plugins_dir>) relative to <executable> and store the result in
|
||||||
|
# <installed_plugin_path_var>.
|
||||||
|
#
|
||||||
|
# If <copy> is set to TRUE then the plugins will be copied rather than
|
||||||
|
# installed. This is to allow this module to be used at CMake time rather than
|
||||||
|
# install time.
|
||||||
|
#
|
||||||
|
# If <component> is set then anything installed will use this COMPONENT.
|
||||||
|
#
|
||||||
|
# INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var <plugins_dir> <component>)
|
||||||
|
# Install (or copy) an unresolved <plugin> to the default plugins directory
|
||||||
|
# (or <plugins_dir>) relative to <executable> and store the result in
|
||||||
|
# <installed_plugin_path_var>. See documentation of INSTALL_QT4_PLUGIN_PATH.
|
||||||
|
#
|
||||||
|
# INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
|
||||||
|
# Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up
|
||||||
|
# a Qt4 executable using BundleUtilities so it is standalone and can be
|
||||||
|
# drag-and-drop copied to another machine as long as all of the system
|
||||||
|
# libraries are compatible. The executable will be fixed-up at install time.
|
||||||
|
# <component> is the COMPONENT used for bundle fixup and plugin installation.
|
||||||
|
# See documentation of FIXUP_QT4_BUNDLE.
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2011 Mike McQuaid <mike@mikemcquaid.com>
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
# The functions defined in this file depend on the fixup_bundle function
|
||||||
|
# (and others) found in BundleUtilities.cmake
|
||||||
|
|
||||||
|
include(BundleUtilities)
|
||||||
|
set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
|
||||||
|
function(write_qt4_conf qt_conf_dir qt_conf_contents)
|
||||||
|
set(qt_conf_path "${qt_conf_dir}/qt.conf")
|
||||||
|
message(STATUS "Writing ${qt_conf_path}")
|
||||||
|
file(WRITE "${qt_conf_path}" "${qt_conf_contents}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(resolve_qt4_paths paths_var)
|
||||||
|
set(executable_path ${ARGV1})
|
||||||
|
|
||||||
|
set(paths_resolved)
|
||||||
|
foreach(path ${${paths_var}})
|
||||||
|
if(EXISTS "${path}")
|
||||||
|
list(APPEND paths_resolved "${path}")
|
||||||
|
else()
|
||||||
|
if(${executable_path})
|
||||||
|
list(APPEND paths_resolved "${executable_path}/${path}")
|
||||||
|
else()
|
||||||
|
list(APPEND paths_resolved "\${CMAKE_INSTALL_PREFIX}/${path}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${paths_var} ${paths_resolved} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(fixup_qt4_executable executable)
|
||||||
|
set(qtplugins ${ARGV1})
|
||||||
|
set(libs ${ARGV2})
|
||||||
|
set(dirs ${ARGV3})
|
||||||
|
set(plugins_dir ${ARGV4})
|
||||||
|
set(request_qt_conf ${ARGV5})
|
||||||
|
|
||||||
|
message(STATUS "fixup_qt4_executable")
|
||||||
|
message(STATUS " executable='${executable}'")
|
||||||
|
message(STATUS " qtplugins='${qtplugins}'")
|
||||||
|
message(STATUS " libs='${libs}'")
|
||||||
|
message(STATUS " dirs='${dirs}'")
|
||||||
|
message(STATUS " plugins_dir='${plugins_dir}'")
|
||||||
|
message(STATUS " request_qt_conf='${request_qt_conf}'")
|
||||||
|
|
||||||
|
if(QT_LIBRARY_DIR)
|
||||||
|
list(APPEND dirs "${QT_LIBRARY_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
set(qt_conf_dir "${executable}/Contents/Resources")
|
||||||
|
set(executable_path "${executable}")
|
||||||
|
set(write_qt_conf TRUE)
|
||||||
|
else()
|
||||||
|
get_filename_component(executable_path "${executable}" PATH)
|
||||||
|
if(NOT executable_path)
|
||||||
|
set(executable_path ".")
|
||||||
|
endif()
|
||||||
|
set(qt_conf_dir "${executable_path}")
|
||||||
|
set(write_qt_conf ${request_qt_conf})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach(plugin ${qtplugins})
|
||||||
|
set(installed_plugin_path "")
|
||||||
|
install_qt4_plugin("${plugin}" "${plugins_dir}" "${executable}" 1 installed_plugin_path)
|
||||||
|
list(APPEND libs ${installed_plugin_path})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
foreach(lib ${libs})
|
||||||
|
if(NOT EXISTS "${lib}")
|
||||||
|
message(FATAL_ERROR "Library does not exist: ${lib}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
resolve_qt4_paths(libs "${executable_path}")
|
||||||
|
|
||||||
|
if(write_qt_conf)
|
||||||
|
set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}")
|
||||||
|
write_qt4_conf("${qt_conf_dir}" "${qt_conf_contents}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
fixup_bundle("${executable}" "${libs}" "${dirs}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(install_qt4_plugin_path plugin executable copy installed_plugin_path_var)
|
||||||
|
set(plugins_dir ${ARGV4})
|
||||||
|
set(component ${ARGV5})
|
||||||
|
set(configurations ${ARGV6})
|
||||||
|
if(EXISTS "${plugin}")
|
||||||
|
if(plugins_dir)
|
||||||
|
set(plugins_dir "${plugins_dir}")
|
||||||
|
else()
|
||||||
|
if(APPLE)
|
||||||
|
set(plugins_dir "PlugIns")
|
||||||
|
else()
|
||||||
|
set(plugins_dir "plugins")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(APPLE)
|
||||||
|
set(plugins_path "${executable}/Contents/${plugins_dir}")
|
||||||
|
else()
|
||||||
|
get_filename_component(executable_path "${executable}" PATH)
|
||||||
|
if(NOT executable_path)
|
||||||
|
set(executable_path ".")
|
||||||
|
endif()
|
||||||
|
set(plugins_path "${executable_path}/${plugins_dir}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(plugin_group "")
|
||||||
|
|
||||||
|
get_filename_component(plugin_path "${plugin}" PATH)
|
||||||
|
get_filename_component(plugin_parent_path "${plugin_path}" PATH)
|
||||||
|
get_filename_component(plugin_parent_dir_name "${plugin_parent_path}" NAME)
|
||||||
|
get_filename_component(plugin_name "${plugin}" NAME)
|
||||||
|
string(TOLOWER "${plugin_parent_dir_name}" plugin_parent_dir_name)
|
||||||
|
|
||||||
|
if("${plugin_parent_dir_name}" STREQUAL "plugins")
|
||||||
|
get_filename_component(plugin_group "${plugin_path}" NAME)
|
||||||
|
set(${plugin_group_var} "${plugin_group}")
|
||||||
|
endif()
|
||||||
|
set(plugins_path "${plugins_path}/${plugin_group}")
|
||||||
|
|
||||||
|
if(${copy})
|
||||||
|
file(MAKE_DIRECTORY "${plugins_path}")
|
||||||
|
file(COPY "${plugin}" DESTINATION "${plugins_path}")
|
||||||
|
else()
|
||||||
|
if(configurations AND (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
|
||||||
|
set(configurations CONFIGURATIONS ${configurations})
|
||||||
|
else()
|
||||||
|
unset(configurations)
|
||||||
|
endif()
|
||||||
|
install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component})
|
||||||
|
endif()
|
||||||
|
set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
|
||||||
|
set(plugins_dir ${ARGV4})
|
||||||
|
set(component ${ARGV5})
|
||||||
|
if(EXISTS "${plugin}")
|
||||||
|
install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}")
|
||||||
|
else()
|
||||||
|
if(QT_IS_STATIC)
|
||||||
|
string(TOUPPER "QT_${plugin}_LIBRARY" plugin_var)
|
||||||
|
else()
|
||||||
|
string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
|
||||||
|
endif()
|
||||||
|
set(plugin_release_var "${plugin_var}_RELEASE")
|
||||||
|
set(plugin_debug_var "${plugin_var}_DEBUG")
|
||||||
|
set(plugin_release "${${plugin_release_var}}")
|
||||||
|
set(plugin_debug "${${plugin_debug_var}}")
|
||||||
|
if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}")
|
||||||
|
message(WARNING "Qt plugin \"${plugin}\" not recognized or found.")
|
||||||
|
endif()
|
||||||
|
install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel")
|
||||||
|
install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Debug")
|
||||||
|
endif()
|
||||||
|
set(installed_plugin_path_var "${installed_plugin_path_var}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(install_qt4_executable executable)
|
||||||
|
set(qtplugins ${ARGV1})
|
||||||
|
set(libs ${ARGV2})
|
||||||
|
set(dirs ${ARGV3})
|
||||||
|
set(plugins_dir ${ARGV4})
|
||||||
|
set(request_qt_conf ${ARGV5})
|
||||||
|
set(component ${ARGV6})
|
||||||
|
if(QT_LIBRARY_DIR)
|
||||||
|
list(APPEND dirs "${QT_LIBRARY_DIR}")
|
||||||
|
endif()
|
||||||
|
if(component)
|
||||||
|
set(component COMPONENT ${component})
|
||||||
|
else()
|
||||||
|
unset(component)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_filename_component(executable_absolute "${executable}" ABSOLUTE)
|
||||||
|
if(EXISTS "${QT_QTCORE_LIBRARY_RELEASE}")
|
||||||
|
gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY_RELEASE}" qtcore_type)
|
||||||
|
elseif(EXISTS "${QT_QTCORE_LIBRARY_DEBUG}")
|
||||||
|
gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY_DEBUG}" qtcore_type)
|
||||||
|
endif()
|
||||||
|
if(qtcore_type STREQUAL "system")
|
||||||
|
set(qt_plugins_dir "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT qtplugins AND QT_LIBRARIES_PLUGINS)
|
||||||
|
set(qtplugins "${QT_LIBRARIES_PLUGINS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach(plugin ${qtplugins})
|
||||||
|
set(installed_plugin_paths "")
|
||||||
|
install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}")
|
||||||
|
list(APPEND libs ${installed_plugin_paths})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
resolve_qt4_paths(libs)
|
||||||
|
|
||||||
|
install(CODE
|
||||||
|
"INCLUDE(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\")
|
||||||
|
SET(BU_CHMOD_BUNDLE_ITEMS TRUE)
|
||||||
|
FIXUP_QT4_EXECUTABLE(\"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
|
||||||
|
${component}
|
||||||
|
)
|
||||||
|
endfunction()
|
@ -0,0 +1,377 @@
|
|||||||
|
# - Function for generation of export macros for libraries
|
||||||
|
# This module provides the function GENERATE_EXPORT_HEADER() and the
|
||||||
|
# accompanying ADD_COMPILER_EXPORT_FLAGS() function.
|
||||||
|
#
|
||||||
|
# The GENERATE_EXPORT_HEADER function can be used to generate a file suitable
|
||||||
|
# for preprocessor inclusion which contains EXPORT macros to be used in
|
||||||
|
# library classes.
|
||||||
|
#
|
||||||
|
# GENERATE_EXPORT_HEADER( LIBRARY_TARGET
|
||||||
|
# [BASE_NAME <base_name>]
|
||||||
|
# [EXPORT_MACRO_NAME <export_macro_name>]
|
||||||
|
# [EXPORT_FILE_NAME <export_file_name>]
|
||||||
|
# [DEPRECATED_MACRO_NAME <deprecated_macro_name>]
|
||||||
|
# [NO_EXPORT_MACRO_NAME <no_export_macro_name>]
|
||||||
|
# [STATIC_DEFINE <static_define>]
|
||||||
|
# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
|
||||||
|
# [DEFINE_NO_DEPRECATED]
|
||||||
|
# [PREFIX_NAME <prefix_name>]
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# ADD_COMPILER_EXPORT_FLAGS( [FATAL_WARNINGS] )
|
||||||
|
#
|
||||||
|
# By default GENERATE_EXPORT_HEADER() generates macro names in a file name
|
||||||
|
# determined by the name of the library. The ADD_COMPILER_EXPORT_FLAGS function
|
||||||
|
# adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on
|
||||||
|
# Windows which does not need extra compiler flags for exporting support. You
|
||||||
|
# may optionally pass a single argument to ADD_COMPILER_EXPORT_FLAGS that will
|
||||||
|
# be populated with the required CXX_FLAGS required to enable visibility support
|
||||||
|
# for the compiler/architecture in use.
|
||||||
|
#
|
||||||
|
# This means that in the simplest case, users of these functions will be
|
||||||
|
# equivalent to:
|
||||||
|
#
|
||||||
|
# add_compiler_export_flags()
|
||||||
|
# add_library(somelib someclass.cpp)
|
||||||
|
# generate_export_header(somelib)
|
||||||
|
# install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
|
||||||
|
# install(FILES
|
||||||
|
# someclass.h
|
||||||
|
# ${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# And in the ABI header files:
|
||||||
|
#
|
||||||
|
# #include "somelib_export.h"
|
||||||
|
# class SOMELIB_EXPORT SomeClass {
|
||||||
|
# ...
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# The CMake fragment will generate a file in the ${CMAKE_CURRENT_BUILD_DIR}
|
||||||
|
# called somelib_export.h containing the macros SOMELIB_EXPORT, SOMELIB_NO_EXPORT,
|
||||||
|
# SOMELIB_DEPRECATED, SOMELIB_DEPRECATED_EXPORT and SOMELIB_DEPRECATED_NO_EXPORT.
|
||||||
|
# The resulting file should be installed with other headers in the library.
|
||||||
|
#
|
||||||
|
# The BASE_NAME argument can be used to override the file name and the names
|
||||||
|
# used for the macros
|
||||||
|
#
|
||||||
|
# add_library(somelib someclass.cpp)
|
||||||
|
# generate_export_header(somelib
|
||||||
|
# BASE_NAME other_name
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# Generates a file called other_name_export.h containing the macros
|
||||||
|
# OTHER_NAME_EXPORT, OTHER_NAME_NO_EXPORT and OTHER_NAME_DEPRECATED etc.
|
||||||
|
#
|
||||||
|
# The BASE_NAME may be overridden by specifiying other options in the function.
|
||||||
|
# For example:
|
||||||
|
#
|
||||||
|
# add_library(somelib someclass.cpp)
|
||||||
|
# generate_export_header(somelib
|
||||||
|
# EXPORT_MACRO_NAME OTHER_NAME_EXPORT
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# creates the macro OTHER_NAME_EXPORT instead of SOMELIB_EXPORT, but other macros
|
||||||
|
# and the generated file name is as default.
|
||||||
|
#
|
||||||
|
# add_library(somelib someclass.cpp)
|
||||||
|
# generate_export_header(somelib
|
||||||
|
# DEPRECATED_MACRO_NAME KDE_DEPRECATED
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# creates the macro KDE_DEPRECATED instead of SOMELIB_DEPRECATED.
|
||||||
|
#
|
||||||
|
# If LIBRARY_TARGET is a static library, macros are defined without values.
|
||||||
|
#
|
||||||
|
# If the same sources are used to create both a shared and a static library, the
|
||||||
|
# uppercased symbol ${BASE_NAME}_STATIC_DEFINE should be used when building the
|
||||||
|
# static library
|
||||||
|
#
|
||||||
|
# add_library(shared_variant SHARED ${lib_SRCS})
|
||||||
|
# add_library(static_variant ${lib_SRCS})
|
||||||
|
# generate_export_header(shared_variant BASE_NAME libshared_and_static)
|
||||||
|
# set_target_properties(static_variant PROPERTIES
|
||||||
|
# COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
|
||||||
|
#
|
||||||
|
# This will cause the export macros to expand to nothing when building the
|
||||||
|
# static library.
|
||||||
|
#
|
||||||
|
# If DEFINE_NO_DEPRECATED is specified, then a macro ${BASE_NAME}_NO_DEPRECATED
|
||||||
|
# will be defined
|
||||||
|
# This macro can be used to remove deprecated code from preprocessor output.
|
||||||
|
#
|
||||||
|
# option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
|
||||||
|
# if (EXCLUDE_DEPRECATED)
|
||||||
|
# set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
|
||||||
|
# endif()
|
||||||
|
# generate_export_header(somelib ${NO_BUILD_DEPRECATED})
|
||||||
|
#
|
||||||
|
# And then in somelib:
|
||||||
|
#
|
||||||
|
# class SOMELIB_EXPORT SomeClass
|
||||||
|
# {
|
||||||
|
# public:
|
||||||
|
# #ifndef SOMELIB_NO_DEPRECATED
|
||||||
|
# SOMELIB_DEPRECATED void oldMethod();
|
||||||
|
# #endif
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# #ifndef SOMELIB_NO_DEPRECATED
|
||||||
|
# void SomeClass::oldMethod() { }
|
||||||
|
# #endif
|
||||||
|
#
|
||||||
|
# If PREFIX_NAME is specified, the argument will be used as a prefix to all
|
||||||
|
# generated macros.
|
||||||
|
#
|
||||||
|
# For example:
|
||||||
|
#
|
||||||
|
# generate_export_header(somelib PREFIX_NAME VTK_)
|
||||||
|
#
|
||||||
|
# Generates the macros VTK_SOMELIB_EXPORT etc.
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2011 Stephen Kelly <steveire@gmail.com>
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
|
# TODO: Install this macro separately?
|
||||||
|
macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
|
||||||
|
check_cxx_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; }
|
||||||
|
int main() { return somefunc();}" ${_RESULT}
|
||||||
|
# Some compilers do not fail with a bad flag
|
||||||
|
FAIL_REGEX "unrecognized .*option" # GNU
|
||||||
|
FAIL_REGEX "ignoring unknown option" # MSVC
|
||||||
|
FAIL_REGEX "warning D9002" # MSVC, any lang
|
||||||
|
FAIL_REGEX "[Uu]nknown option" # HP
|
||||||
|
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
|
||||||
|
FAIL_REGEX "command option .* is not recognized" # XL
|
||||||
|
)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(_test_compiler_hidden_visibility)
|
||||||
|
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
exec_program(${CMAKE_C_COMPILER} ARGS --version
|
||||||
|
OUTPUT_VARIABLE _gcc_version_info)
|
||||||
|
string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
|
||||||
|
_gcc_version "${_gcc_version_info}")
|
||||||
|
# gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
|
||||||
|
# patch level, handle this here:
|
||||||
|
if(NOT _gcc_version)
|
||||||
|
string(REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0"
|
||||||
|
_gcc_version "${_gcc_version_info}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${_gcc_version} VERSION_LESS "4.2")
|
||||||
|
set(GCC_TOO_OLD TRUE)
|
||||||
|
message(WARNING "GCC version older than 4.2")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
|
||||||
|
exec_program(${CMAKE_CXX_COMPILER} ARGS -V
|
||||||
|
OUTPUT_VARIABLE _intel_version_info)
|
||||||
|
string(REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1"
|
||||||
|
_intel_version "${_intel_version_info}")
|
||||||
|
|
||||||
|
if(${_intel_version} VERSION_LESS "12.0")
|
||||||
|
set(_INTEL_TOO_OLD TRUE)
|
||||||
|
message(WARNING "Intel compiler older than 12.0")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# Exclude XL here because it misinterprets -fvisibility=hidden even though
|
||||||
|
# the check_cxx_compiler_flag passes
|
||||||
|
# http://www.cdash.org/CDash/testDetails.php?test=109109951&build=1419259
|
||||||
|
if(NOT GCC_TOO_OLD
|
||||||
|
AND NOT _INTEL_TOO_OLD
|
||||||
|
AND NOT WIN32
|
||||||
|
AND NOT CYGWIN
|
||||||
|
AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL
|
||||||
|
AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI
|
||||||
|
AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES Watcom)
|
||||||
|
check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
|
||||||
|
check_cxx_compiler_flag(-fvisibility-inlines-hidden
|
||||||
|
COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
|
||||||
|
option(USE_COMPILER_HIDDEN_VISIBILITY
|
||||||
|
"Use HIDDEN visibility support if available." ON)
|
||||||
|
mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(_test_compiler_has_deprecated)
|
||||||
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES Borland
|
||||||
|
OR "${CMAKE_CXX_COMPILER_ID}" MATCHES HP
|
||||||
|
OR GCC_TOO_OLD
|
||||||
|
OR "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI
|
||||||
|
OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Watcom)
|
||||||
|
set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL
|
||||||
|
"Compiler support for a deprecated attribute")
|
||||||
|
else()
|
||||||
|
_check_cxx_compiler_attribute("__attribute__((__deprecated__))"
|
||||||
|
COMPILER_HAS_DEPRECATED_ATTR)
|
||||||
|
if(COMPILER_HAS_DEPRECATED_ATTR)
|
||||||
|
set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}"
|
||||||
|
CACHE INTERNAL "Compiler support for a deprecated attribute")
|
||||||
|
else()
|
||||||
|
_check_cxx_compiler_attribute("__declspec(deprecated)"
|
||||||
|
COMPILER_HAS_DEPRECATED)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
get_filename_component(_GENERATE_EXPORT_HEADER_MODULE_DIR
|
||||||
|
"${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
|
||||||
|
macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
|
||||||
|
set(DEFINE_DEPRECATED)
|
||||||
|
set(DEFINE_EXPORT)
|
||||||
|
set(DEFINE_IMPORT)
|
||||||
|
set(DEFINE_NO_EXPORT)
|
||||||
|
|
||||||
|
if (COMPILER_HAS_DEPRECATED_ATTR)
|
||||||
|
set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))")
|
||||||
|
elseif(COMPILER_HAS_DEPRECATED)
|
||||||
|
set(DEFINE_DEPRECATED "__declspec(deprecated)")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
|
||||||
|
|
||||||
|
if(NOT ${type} STREQUAL "STATIC_LIBRARY")
|
||||||
|
if(WIN32)
|
||||||
|
set(DEFINE_EXPORT "__declspec(dllexport)")
|
||||||
|
set(DEFINE_IMPORT "__declspec(dllimport)")
|
||||||
|
elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
|
||||||
|
set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))")
|
||||||
|
set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))")
|
||||||
|
set(DEFINE_NO_EXPORT "__attribute__((visibility(\"hidden\")))")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
|
||||||
|
# Option overrides
|
||||||
|
set(options DEFINE_NO_DEPRECATED)
|
||||||
|
set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
|
||||||
|
DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE
|
||||||
|
NO_DEPRECATED_MACRO_NAME)
|
||||||
|
set(multiValueArgs)
|
||||||
|
|
||||||
|
cmake_parse_arguments(_GEH "${options}" "${oneValueArgs}" "${multiValueArgs}"
|
||||||
|
${ARGN})
|
||||||
|
|
||||||
|
set(BASE_NAME "${TARGET_LIBRARY}")
|
||||||
|
|
||||||
|
if(_GEH_BASE_NAME)
|
||||||
|
set(BASE_NAME ${_GEH_BASE_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(TOUPPER ${BASE_NAME} BASE_NAME_UPPER)
|
||||||
|
string(TOLOWER ${BASE_NAME} BASE_NAME_LOWER)
|
||||||
|
|
||||||
|
# Default options
|
||||||
|
set(EXPORT_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_EXPORT")
|
||||||
|
set(NO_EXPORT_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_NO_EXPORT")
|
||||||
|
set(EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME_LOWER}_export.h")
|
||||||
|
set(DEPRECATED_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_DEPRECATED")
|
||||||
|
set(STATIC_DEFINE "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_STATIC_DEFINE")
|
||||||
|
set(NO_DEPRECATED_MACRO_NAME
|
||||||
|
"${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_NO_DEPRECATED")
|
||||||
|
|
||||||
|
if(_GEH_UNPARSED_ARGUMENTS)
|
||||||
|
message(FATAL_ERROR "Unknown keywords given to GENERATE_EXPORT_HEADER(): \"${_GEH_UNPARSED_ARGUMENTS}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(_GEH_EXPORT_MACRO_NAME)
|
||||||
|
set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME})
|
||||||
|
endif()
|
||||||
|
if(_GEH_EXPORT_FILE_NAME)
|
||||||
|
if(IS_ABSOLUTE _GEH_EXPORT_FILE_NAME)
|
||||||
|
set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME})
|
||||||
|
else()
|
||||||
|
set(EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${_GEH_EXPORT_FILE_NAME}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(_GEH_DEPRECATED_MACRO_NAME)
|
||||||
|
set(DEPRECATED_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_DEPRECATED_MACRO_NAME})
|
||||||
|
endif()
|
||||||
|
if(_GEH_NO_EXPORT_MACRO_NAME)
|
||||||
|
set(NO_EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_NO_EXPORT_MACRO_NAME})
|
||||||
|
endif()
|
||||||
|
if(_GEH_STATIC_DEFINE)
|
||||||
|
set(STATIC_DEFINE ${_GEH_PREFIX_NAME}${_GEH_STATIC_DEFINE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(_GEH_DEFINE_NO_DEPRECATED)
|
||||||
|
set(DEFINE_NO_DEPRECATED TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(_GEH_NO_DEPRECATED_MACRO_NAME)
|
||||||
|
set(NO_DEPRECATED_MACRO_NAME
|
||||||
|
${_GEH_PREFIX_NAME}${_GEH_NO_DEPRECATED_MACRO_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H")
|
||||||
|
|
||||||
|
get_target_property(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY} DEFINE_SYMBOL)
|
||||||
|
|
||||||
|
if(NOT EXPORT_IMPORT_CONDITION)
|
||||||
|
set(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY}_EXPORTS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
|
||||||
|
"${EXPORT_FILE_NAME}" @ONLY)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
function(GENERATE_EXPORT_HEADER TARGET_LIBRARY)
|
||||||
|
get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
|
||||||
|
if(${type} STREQUAL "MODULE")
|
||||||
|
message(WARNING "This macro should not be used with libraries of type MODULE")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT ${type} STREQUAL "STATIC_LIBRARY" AND NOT ${type} STREQUAL "SHARED_LIBRARY")
|
||||||
|
message(WARNING "This macro can only be used with libraries")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
_test_compiler_hidden_visibility()
|
||||||
|
_test_compiler_has_deprecated()
|
||||||
|
_do_set_macro_values(${TARGET_LIBRARY})
|
||||||
|
_do_generate_export_header(${TARGET_LIBRARY} ${ARGN})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(add_compiler_export_flags)
|
||||||
|
|
||||||
|
_test_compiler_hidden_visibility()
|
||||||
|
_test_compiler_has_deprecated()
|
||||||
|
|
||||||
|
if(NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY))
|
||||||
|
# Just return if there are no flags to add.
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set (EXTRA_FLAGS "-fvisibility=hidden")
|
||||||
|
|
||||||
|
if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
|
||||||
|
set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Either return the extra flags needed in the supplied argument, or to the
|
||||||
|
# CMAKE_CXX_FLAGS if no argument is supplied.
|
||||||
|
if(ARGV0)
|
||||||
|
set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
@ -0,0 +1,7 @@
|
|||||||
|
cmake_minimum_required (VERSION 2.8)
|
||||||
|
project(IntelFortranImplicit Fortran)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT output.cmake
|
||||||
|
COMMAND ${CMAKE_COMMAND} -P ${IntelFortranImplicit_SOURCE_DIR}/detect.cmake
|
||||||
|
)
|
||||||
|
add_library(FortranLib hello.f output.cmake)
|
@ -0,0 +1,9 @@
|
|||||||
|
# look at each path and try to find ifconsol.lib
|
||||||
|
set(LIB "$ENV{LIB}")
|
||||||
|
foreach(dir ${LIB})
|
||||||
|
file(TO_CMAKE_PATH "${dir}" dir)
|
||||||
|
if(EXISTS "${dir}/ifconsol.lib")
|
||||||
|
file(WRITE output.cmake "list(APPEND implicit_dirs \"${dir}\")\n")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
@ -0,0 +1 @@
|
|||||||
|
include(Platform/AIX-XL-Fortran)
|
@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
call "@CMAKE_GNUtoMS_BAT@"
|
||||||
|
lib /machine:"@CMAKE_GNUtoMS_ARCH@" %*
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue