Imported Upstream version 2.8.8

ci/unstable
Modestas Vainius 13 years ago
parent d0eb81feeb
commit 60ee04bd10

@ -270,7 +270,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR}) SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_ZLIB) ELSE(CMAKE_USE_SYSTEM_ZLIB)
SET(CMAKE_ZLIB_INCLUDES) SET(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
SET(CMAKE_ZLIB_LIBRARIES cmzlib) SET(CMAKE_ZLIB_LIBRARIES cmzlib)
ADD_SUBDIRECTORY(Utilities/cmzlib) ADD_SUBDIRECTORY(Utilities/cmzlib)
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
@ -336,13 +336,14 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS}) SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE) ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
SET(HAVE_LIBZ 1)
SET(HAVE_ZLIB_H 1)
SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
SET(ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES})
SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
SET(BUILD_ARCHIVE_WITHIN_CMAKE TRUE)
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC) ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
SET(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
SET(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
SET(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
SET(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
SET(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
ADD_SUBDIRECTORY(Utilities/cmlibarchive) ADD_SUBDIRECTORY(Utilities/cmlibarchive)
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
@ -424,7 +425,7 @@ ENDIF()
# The CMake version number. # The CMake version number.
SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8) SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 7) SET(CMake_VERSION_PATCH 8)
SET(CMake_VERSION_TWEAK 0) SET(CMake_VERSION_TWEAK 0)
#SET(CMake_VERSION_RC 2) #SET(CMake_VERSION_RC 2)
@ -630,7 +631,6 @@ INSTALL(
PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE WORLD_READ WORLD_EXECUTE
PATTERN "CVS" EXCLUDE
) )
#----------------------------------------------------------------------- #-----------------------------------------------------------------------

@ -1,3 +1,7 @@
SET(CTEST_CUSTOM_ERROR_MATCH
${CTEST_CUSTOM_ERROR_MATCH}
"ERROR:")
SET(CTEST_CUSTOM_WARNING_EXCEPTION SET(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION} ${CTEST_CUSTOM_WARNING_EXCEPTION}
"xtree.[0-9]+. : warning C4702: unreachable code" "xtree.[0-9]+. : warning C4702: unreachable code"
@ -36,14 +40,16 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*" "warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*"
"stl_deque.h:1051" "stl_deque.h:1051"
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)" "(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"(Lexer|Parser).*warning.*statement is unreachable"
"PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c"
"[Qq]t([Cc]ore|[Gg]ui).*warning.*conversion.*may alter its value" "[Qq]t([Cc]ore|[Gg]ui).*warning.*conversion.*may alter its value"
"Parser.cxx.*warning.*2111-D.*statement is unreachable"
"warning:.*is.*very unsafe.*consider using.*" "warning:.*is.*very unsafe.*consider using.*"
"warning:.*is.*misused, please use.*" "warning:.*is.*misused, please use.*"
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element" "CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
"cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast "cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast
"ld: warning: directory not found for option .-(F|L)" "ld: warning: directory not found for option .-(F|L)"
"warning.*This version of Mac OS X is unsupported" "warning.*This version of Mac OS X is unsupported"
"clang.*: warning: argument unused during compilation: .-g"
# Ignore clang's summary warning, assuming prior text has matched some # Ignore clang's summary warning, assuming prior text has matched some
# other warning expression: # other warning expression:

@ -1,3 +1,595 @@
Changes in CMake 2.8.8 (since 2.8.8-rc2)
----------------------------------------
Brad King (1):
CheckIncludeFiles: Shorten check description message
David Cole (3):
CPackNSIS: Rewrite variable documentation to make it more readable.
OS X: Use correct extra path when searching for applicaton bundles (#13066)
OS X: Mark find_program results as advanced
Eric NOULARD (1):
Fix some doc typo and add an undocumented var.
Kashif Rasul (1):
OS X: Use OSX_DEVELOPER_ROOT for app search path (#13066)
Rolf Eike Beer (1):
FindBoost: add support for 1.49 and 1.50
Changes in CMake 2.8.8-rc2 (since 2.8.8-rc1)
--------------------------------------------
Alex Neundorf (4):
make cmLocalGenerator::EscapeForCMake() static
automoc: fix #13018, proper cmake escaping to avoid false rebuilds
automoc: add define to test which caused bug #13018
fix #13054: support OBJECT libraries in Eclipse
Ben Boeckel (1):
Create granular targets for Ninja generators too
Brad King (6):
CTest.UpdateHG: Fix repo URL for leading slash
Always compile sources with known language
Classify known header file extensions as headers
VS: Add CMakeLists.txt re-run rules at start of generation
Test generated module .def files
Ninja: Fix module .def file path conversion
David Cole (2):
CMake: Clarify SUFFIX target property documentation.
Xcode: Pay attention to custom configuration types (#13082)
Peter Collingbourne (1):
Ninja: Substitute <OBJECT> and <CMAKE_C_COMPILER> in depfile flags
Rolf Eike Beer (2):
FILE: mention that TO_CMAKE_PATH also handles list delimiters
FIND_LIBRARY: document FIND_LIBRARY_USE_LIB64_PATHS
Sean McBride (1):
automoc: include <unistd.h> on Apple to get pathconf
Tom Hughes (1):
Override topdir from rpm command line seems necessary on Amazon linux.
Changes in CMake 2.8.8-rc1 (since 2.8.7)
----------------------------------------
Aaron C. Meadows (1):
Visual Studio: Allow setting Single Byte Character Set (#12189)
Alex Neundorf (34):
GNUInstallDirs: add support for Debian multiarch
FindRuby: fix usage of RUBY_VERSION_MAJOR (#12172)
FindRuby: add more possible library names (for ubuntu, #12172)
FindRuby.cmake: add more debug output
fix FeatureSummary for REQUIRED packages, they were reported as OPTIONAL
FindGetText: fix multiple targets with the same name problem (CMP0002)
fix #6976: FindX11 also searches for X11_Xxf86vm_LIB
GenerateExportHeader: use double quotes around _gcc_version
-remove trailing whitespace
-don't pull in CheckTypeSize.cmake from the cmake which is being built
bootstrap: move while() and endwhile() into the bootstrap build
Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES
find_package: print error if an invalid CONFIGS name is used
find_package: rename NoModule to UseFindModules
find_package: improve error message when no Find module is present
find_package: add MODULE mode to use only Find-modules
find_package: add CONFIG mode keyword alias for NO_MODULE
find_package: mention requested version number in error message
add CMakePackageConfigHelpers: configure_package_config_file()
wrap write_basic_config_version_file as write_basic_package_version_file()
find_package: error out if REQUIRED Config has not been found
write_basic_package_version_file(): improve documentation
write_basic_package_version_file: add ExactVersion mode
WriteBasicConfigVersionFile: add test for ExactVersion mode
find_package: allow <pkg>Config.cmake to set <pkg>_FOUND to FALSE
find_package: add test for setting Foo_FOUND to FALSE in a Config file
find_package: additional test for checking the error message
find_package: add OPTIONAL_COMPONENTS keyword
FPHSA(): add missing "]" to documentation
find_package: add documentation for OPTIONAL_COMPONENTS
FPHSA(): add HANDLE_COMPONENTS option
add macro check_required_components() to configure_package_config_file()
Eclipse: fix #13036, make version detection work with symlinks
guard eCos.cmake against multiple inclusion (#12987)
Alexandru Ciobanu (2):
CTest: Detect Xcode error "Command ... failed with exit code"
CTest: Match valgrind errors with "points to" (#12922)
Alexey Ozeritsky (1):
FindBLAS/FindLAPACK: Work with MKL version 10.3 (#12924, #12925)
Artur Kedzierski (1):
Add CURL_CA_BUNDLE option for SSL support (#12946)
Bill Hoffman (12):
Add CMakeAddFortranSubdirectory to use MinGW gfortran in VS
VSGNUFortran: Add special case for SunPro Fortran runtime library
VSGNUFortran: Disable test in special cases
CMakeAddFortranSubdirectory: Make IMPORTED targets GLOBAL
Use upgraded qt on linux build machine.
Teach CTest what a ninja error looks like.
Allow two cmake_add_fortran_subdirectory calls in the same project.
Add ability to include a file in a project via a cache variable.
Fix typo in error message, and remove redundent test.
Ninja: Add a cache option CMAKE_ENABLE_NINJA to enable the ninja generator.
Ninja: Fix for PDB files with spaces in the path.
Fix FindMPI for the intel compiler on linux by looking in implict directories.
Bjoern Ricks (1):
Fix crash if app bundle executeable couldn't be found
Brad King (138):
CheckCCompilerFlag: Generalize "but not for C" case (#12633)
complex: Remove ancient unused ComplexRelativePaths test
complex: Sync Tests/ComplexOneConfig with Tests/Complex
complex: Remove dynamic loader tests
complex: Move GeneratedFileStream test to CMakeLibTests
complex: Simplify test for single-character exe name
complex: Move cmSystemTools::UpperCase test to CMakeLibTests
complex: Remove test dependence on cmSystemTools
complex: Remove unused option to test CMakeLib
Intel: Fix Windows per-config Fortran flags (#12642)
libarchive: Remove our copy to make room for new import
libarchive: Add .gitattributes for indentation with tab
libarchive: Add README-CMake.txt
libarchive: Do not build subdirectories not in reduced snapshot
libarchive: Remove -Wall -Werror from build with GNU
libarchive: Build one static cmlibarchive for CMake
libarchive: Include cm_zlib.h to get zlib used by CMake
Handle libarchive API change in archive_read_data_block
Configure libarchive build within CMake
libarchive: Install COPYING with CMake documentation
libarchive: Port to OSF operating system
libarchive: Fix typo in CheckFileOffsetBits
libarchive: Implement custom lseek for Borland
libarchive: Declare mbstate_t and wcrtomb for Borland
libarchive: Cast constants to int64_t instead of using LL suffix
libarchive: Workaround case-insensitive symbols on Borland
libarchive: Clean up configuration within CMake build
libarchive: Cast mode constants to mode_t in case it is signed
libarchive: Fix Windows NT API usage in VS 6
libarchive: Suppress compiler warnings
libarchive: Fix var decl after statement in archive_string.c
libarchive: Do not use ST_NOATIME if not defined
libarchive: Check for 'struct statvfs' member 'f_iosize'
libarchive: Do not use MNT_NOATIME if not defined
libarchive: Use Apple copyfile.h API only if available
libarchive: Remove hard-coded build configuration
libarchive: Cleanup after ZLIB_WINAPI check
libarchive: Define _XOPEN_SOURCE=500 on HP-UX
libarchive: Include linux/types.h before linux/fiemap.h
libarchive: Rename isoent_rr_move_dir parameter isoent => curent
libarchive: Suppress PathScale compiler warnings
libarchive: Avoid bogus conversion warning from PGI compiler
libarchive: Set .gitattributes to allow trailing whitespace
libarchive: Update README-CMake.txt for new snapshot
libarchive: Restore CMake 2.6.3 as minimum version
bootstrap: Update copyright year in version report
bootstrap: Re-implement command line option processing
bootstrap: Forward options after '--' to cmake
VS10: Fix /pdb option vcxproj element name (#12328)
Add framework to detect compiler version with its id (#12408)
Detect GNU compiler version with its id (#6251)
Detect MSVC compiler version with its id
Detect Intel compiler version with its id (#11937)
Detect Borland compiler version with its id
Detect IBM XL compiler version with its id
Detect PGI compiler version with its id
Detect Clang compiler version with its id
Detect Watcom compiler version with its id
Detect SunPro compiler version with its id
Detect HP compiler version with its id
Document compiler version macro formats used for detection
Detect SGI MIPSpro compiler version with its id
ExternalProject: Fix git.cmd version detection
ExternalProject: Update copyright year
Include bzlib.h consistently across CMake build (#10950)
FindMPI: Append MPI C++ library correctly in non-compiler case (#12874)
Add infrastructure for CMake-only tests
Tolerate cycles in shared library link interfaces (#12647)
cmInstallCommand: Fix line length for style
cmake-mode.el: Indent after multiline argument (#12908)
Clarify IMPORTED_ target property documentation
Optionally allow IMPORTED targets to be globally visible
Add test covering imported target scope rules
VS: Simplify ;-separated attribute value parsing
Fix CXX/Fortran MODULE flags when enabled before C (#12929)
Remove unused test code
Allow directory names containing '=' and warn if necessary (#12934)
Add CheckLanguage module
CMakeAddFortranSubdirectory: Allow full paths to directories
CMakeAddFortranSubdirectory: Fix documentation format and typos
CMakeAddFortranSubdirectory: Find gfortran in PATH
CMakeAddFortranSubdirectory: Validate gfortran architecture
CMakeAddFortranSubdirectory: Always parse arguments
CMakeAddFortranSubdirectory: Add NO_EXTERNAL_INSTALL option
libarchive: Workaround mbsnrtowcs assertion failure on old glibc
Recognize OpenBSD versioned .so names (#12954)
try_compile: Use random executable file name (#12957)
Rename Modules/Platform/Windows-{Borland => Embarcadero}.cmake
Recognize Embarcadero compiler (#12604)
Factor cmInstallType out of cmTarget::TargetType
Add infrastructure for CMakeCommands tests
find_package: Reject mixed use of MODULE- and CONFIG-only options
find_package: Optionally warn when implicitly using Config mode
find_package: Test error and warning messages in failure cases
bootstrap: Convert MSYS paths to Windows format (#13001)
CTest.UpdateHG: Fix repo URL for local filesystem (#13001)
cmcurl: Do not hard-coded Windows check results for MinGW (#13001)
CheckSourceTree: Remove CVS checkout support (#13001)
Fix MSYS CVS local test repo path format (#13001)
find_package: Test that REQUIRED aborts processing correctly
Remove unused partial OBJECT_FILES property implementation
VS: Simplify object name computation
Hide Makefile local object info inside local generator
KWIML: Make test_INT robust to #define-d int#_t and INT#_C
Add stronger infrastructure for CMake-only tests
Use generalized RunCMake test infrastrucure for find_package test
Use generalized RunCMake test infrastrucure for build_command test
Document Fortran_MODULE_DIRECTORY as OUTPUT only (#13034)
Ninja: Constify use of cmCustomCommand
Ninja: Avoid using 'this' in member initializers
Write CMakeCache.txt atomically (#13040)
Add cmGeneratorTarget to represent a target during generation
Create a cmGeneratorTarget for each cmTarget during generation
Simplify cmMakefileTargetGenerator using cmGeneratorTarget
Simplify cmVisualStudio10TargetGenerator using cmGeneratorTarget
Pre-compute object file names before Makefile generation
Pre-compute object file names before VS project generation
Remove unused cmSourceGroup method
Rename/constify build-time config placeholder lookup
Pre-compute and store target object directory in cmGeneratorTarget
Add OBJECT_LIBRARY target type
Build object library targets in Makefiles
Build object library targets in VS
Add $<TARGET_OBJECTS:...> expression to use an object library
Test OBJECT library success cases
Test OBJECT library failure cases
Test OBJECT library language propagation
Test OBJECT library use without other sources
Document OBJECT library type in add_library command
Simplify cmNinjaTargetGenerator using cmGeneratorTarget
Pre-compute object file names before Ninja generation
Build object library targets in Ninja
Ninja: Honor $<TARGET_OBJECTS:...> source expressions
find_package: Test rejection of required+optional components
Simplify cmVisualStudio10TargetGenerator source classification
VS10: Fix external objects generated outside target (#13047)
Fix ObjectLibrary test on Watcom
KWIML: Avoid conflict with C++11 user-defined literals
Christian Andersson (1):
FindPythonLibs: Search for single-user installs on Windows
Christopher Sean Morrison (1):
cmake-mode.el: Make indentation case-insensitive (#12995)
Clinton Stimpson (14):
GetPrerequisites: Add support for @rpath on Mac OS X.
GetPrerequisites: Add support for @rpath on Mac OS X.
GetPrerequisites: Add test for @rpath support.
Fix new BundleUtilities test failure on Mac 10.4.x
Fix BundleUtilities test failure with space in build path.
cmake-gui: Improve interrupt granularity to fix bug 12649.
FindQt4: clarify warning message about incorrect Qt installation.
FindQt4: Add include directories for lupdate.
Fix paths/hints for finding qtmain.
DragNDrop: Fix problem with relocated files in Xcode 4.3
Add test for DeployQt4.cmake
Fix for Qt4Deploy on some test machines.
Remove QtGui dependency in Qt4Deploy test and verify QtSql existance.
DeployQt4: Add path to Qt dlls on Windows.
Daniel Nelson (1):
CPack Add top level directory in component install for Archive Generators
David Cole (33):
Begin post-2.8.7 development
Release: Increase timeout for slow-testing cygwin build
Update dashmacmini2 release script to use Qt 4.6.3
Update dashmacmini2 release script to use Qt 4.8.0
Tests: Update drop site value for the Trilinos contract test
Update version of Qt for dashmacmini5 produced release binaries
CTestCustom: Suppress clang warning on the dashboard
CMake: Eliminate cmMakefile::IncludeDirectories
Remove cmMakefile::GetIncludeDirectories
Make search paths ordered and unique
Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES
Update the documentation regarding INCLUDE_DIRECTORIES.
Fix compiler error reported on older Borland dashboard.
Fix compiler warning reported on older Borland dashboard.
Fix shadowed variable warning on dashboard results
Remove trailing white space
Use correct "requires" line in cygwin setup hint file
VS6: Avoid _MBCS define when _SBCS is defined (#12189)
VS6: Avoid SBCS test on VS6 (#12189)
Suppress warnings occurring on the dashboards using the PGI compiler.
CPack: Fix retry logic when calls to hdiutil fail
Ninja: CMake: Adapt Ninja generator for per-target include dirs
Ninja: Add friend struct so it can access the private ConvertToNinjaPath.
Xcode: Detect new default locations of Xcode 4.3 bits and pieces (#12621)
CPack: Use real path to PackageMaker to find its version file (#12621)
Xcode: Re-factor code into GetObjectsNormalDirectory method
Xcode: Re-factor some existing methods into "FromPath" variants
Add a default source group for object files.
Allow txt files as ExtraSources in object library targets
Pre-compute object file names before Xcode generation
Build object library targets in Xcode
Xcode: Honor $<TARGET_OBJECTS:...> source expressions
Tests: Relax restrictions on version variable contents
Deborah Pickett (1):
CPackRPM flag direcories with %dir in the generated spec file
Droscy (1):
FindCxxTest: Add support for CxxTest 4 (#13022)
Eric NOULARD (41):
Document undocumented (but existing) cpack options (fix #0010134)
Enhance bash completion file for cmake and ctest
Do not add the content of a file if it's a symlink.
CPackArchive restore default behavior and provide new variable.
CPackNSIS fix #0012935 switch from LOG_WARNING to avoid final error.
CPack begin the implementation of --help-command* and --help-variables*
Implement simple CMake script comment markup language.
CPack Documentation extraction from CMake script begins to work
Update bash completion file in order to handle new CPack doc options.
Suppress unused var, beautify code, avoid 1 extra newline.
Fix potential bad memory access, thanks to Eike
Calm down compiler warning about unused var
Really avoid compiler warning about unused vars
Fix another compiler warning due to a typo
Make the load of script documentation more efficient and dynamic.
Example of builtin variable documentation (i.e. only used in C++ source code).
Add missing section markup for CPackComponent
Create getDocumentedModulesListInDir which may be used in other context.
Fix non existent std::string::clear on VS6
Avoid discovering system infos for documentation. Adding some path is enough.
Dynamically add documentation section specified in documented script.
Add structured documentation for NSIS
Add structure documentation for CPack Bundle generator
Suppress unecessary (now empty) doc sections
Correct copy/paste section name mistake
Put CPack DMG and PackageMaker doc in separate files
More documentation concerning CPack Components
Fix typo in end markup
Try to fix compile error on Win32-vs70
Do not build RPM if path of the build tree contains space
Fix layout of the CPack Bundle documentation
Fix CPack Drag and Drop generator documentation layout.
Review and update CPack variable documentation.
Update CPackConfig template.
Provide template for CPack Cygwin generator specific variables.
Update CPack PackageMaker variable doc layout
Typo: Add missing ##end for ##module
Fix some typos in CPACK_SET_DESTDIR doc
Add some missing CPACK_NSIS_xxx doc and move some to common CPack section.
CPack STGZ put execute permission on all packages files (component case)
Handle CPACK_MONOLITHIC_INSTALL in some rare use cases.
Eugene Golushkov (1):
VS: Add support for WinRT project properties (#12930)
James Bigler (1):
Added support for curand, cusparse, npp, nvcuenc and nvcuvid libraries.
Jason Erb (1):
FindwxWidgets: Add webview library (#12636)
LibArchive Upstream (2):
libarchive 3.0.1-r3950 (reduced)
libarchive 3.0.2-r4051 (reduced)
Matthias Kretz (1):
Improve checks for Open64 and g++ incompatible flags (#12119)
Mattias Helsing (1):
CPack: Fix NSIS handling of privileged users (#12923)
Michael Wild (1):
GenerateExportHeader: Fix wrong use of IS_ABSOLUTE (#12645)
Mike McQuaid (5):
Don't use QT_LIBRARIES_PLUGINS by default.
Fix mismatched arguments.
Fix bad plugin paths.
Ensure libs are passed to BundleUtilities.
Fix plugin installation issues.
Modestas Vainius (3):
various typo and formatting fixes in manual pages (#12975)
KWIML: Teach ABI.h that MIPS is biendian
Tests: Escape metachars before embedding paths into the regex (#12999)
Nicolas Despres (5):
ccmake: Factor clear line.
ccmake: Extend clear line.
java: Factor jar output path.
java: Add CMAKE_JAVA_TARGET_OUTPUT_DIR optional variable.
java: Add CMAKE_JAVA_JAR_ENTRY_POINT optional variable.
Peter Collingbourne (19):
Add cmSystemTools::TrimWhitespace function
Add executable with exports flag support to cmLocalGenerator::GetTargetFlags
Provide dependency file flags to generator
Ninja: Add the Ninja generator
Ninja: Fix a 79-col violation
Ninja: Remove some default arguments
Ninja: Appease various compilers
Ninja: Partially revert "win fixes: escape back slash/colon, use cd. as cmd.exe nop"
Ninja: Identifier encoding rules for ' ' and ':'
Ninja: Backslash rules for Windows
Ninja: Shell encode paths used in "cd" commands
Ninja: Shell encode various CMake invocations
Ninja: Shell encode the command used in custom commands
Ninja: Import library support for Windows
Ninja: Add a missed license header
Ninja: Use cmSystemTools::ExpandListArgument to split compile/link commands
Ninja: Remove an unnecessary variable
Ninja: add support for OBJECT_OUTPUTS, fix PrecompiledHeader test case
Ninja: shell escape $(CMAKE_SOURCE_DIR) and $(CMAKE_BINARY_DIR)
Peter Kuemmel (12):
Find VC Express during default generator selection (#12917)
Ninja: win fixes: escape back slash/colon, use cd. as cmd.exe nop
Ninja: don't define MSVC_IDE when using the ninja generator
Ninja: also build ninja support on Windows
Ninja: add some hacks for Windows
Ninja: disable unfinished Windows ninja support
Ninja: mark the Windows specific hacks with a comment only
Ninja: windows msvc: create for each target a .pdb file
Ninja: ensure the output dir exists at compile time
Ninja: add .def file support
Ninja: add /DEF: flag to linker call
Ninja: Fix <OBJECT_DIR> substitution
Philip Lowman (5):
FindProtobuf: Merge patch that allows extra import dirs
FindProtobuf: Update documentation comment for 2.8.8
Findosg: New modules for osgQt and osgPresentation
FindALSA: Fix incorrect include path detection
FindALSA: Fix version detection after last commit
Rolf Eike Beer (95):
remove reference to CVS directory when installing files
CheckSymbolExists: force the compiler to keep the referenced symbol
add a test for Check{,CXX}SymbolExists
FindOpenSSL: improve version number handling
FindOpenSSL: only try to parse opensslv.h if it exists
FindOpenSSL: also parse version number define with uppercase letters
GenerateExportHeader test: add newlines before end of file
add a test that loops through most Find* modules
AllFindModules test: keep complete output
AllFindModules test: also check Qt3 modules if Qt4 is not found
FindPythonInterp: make version selectable
FindPythonInterp: fix version parsing
LoadCommand test: cleanup
FindThreads: Try pthreads with no special option first (#11333)
fix uninitialized var in if(NOT foo bar STREQUAL "foo bar")
use pkg_check_modules() quiet in other modules
FindLibXml2: support version selection
FindGnuTLS: partly support version selection
FindGit: support version number
FindCups: major overhaul
FindEXPAT: support version number
FindCURL: support version selection
FindFLEX: fix version parsing for old flex versions
FindFLEX: fix version parsing when the executable is quoted
FindJasper: find debug libraries
FindJasper: support version number
FindBZip2: add support for version checking
FindBZip2: add support for debug libraries (#12867)
FindImageMagick: make use of more FPHSA features
FindPNG: support version selection
FindRuby: do not blindly set version to 1.8.0
FindTclsh: support version selection
SelectLibraryConfigurations: do not output identical configurations
FindLua51: add version support
FindTIFF: support version selection
FindCURL: detect version number also for older versions
FindLibXml2: detect version when PkgConfig is not used
FindPostgreSQL: support version selection
FindOpenSSL: properly parse the hex version components
FindBISON: add a version expression for GNU Bison 1.x
FindPythonInterp: try harder to get a version number
FindJasper: fix library name
FindGnuplot: add version selection
FindALSA: support version selection
FindGettext: support version selection
CheckCXXCompilerFlag test: make it a CMakeOnly test
CMakeOnly.AllFindModules: clean up the Qt3/Qt4 code
CMakeOnly.AllFindModules: always check FindQt
CMakeOnly.AllFindModules: suppress two modules from testing
CMakeOnly.AllFindModules: require version for some modules
CheckIncludeFiles: fix status output
FindPerl{,Libs}: move version detection into FindPerl
FindLibArchive: support version selection
FindX11: also search for Xmu (#12447)
detect "pgfortran" as PGI Fortran compiler (#12425)
FindSDL*: use FPHSA (#12467)
AllFindModules test: do not enforce GNUPLOT version
FindPerlLibs: properly detect libperl on Windows (#12224)
CTest: mark all gcov covered files as covered
FindGLUT: honor REQUIRED (#12466)
FindRuby: clean up querying variables from Ruby
FindLibXslt: support version selection
Tests: document where to put tests
FindPkgConfig: support version selection of pkg-config itself
fix the same typos as found by Debian in other places, too
Find_library(): allow searching for versioned shared objects
FindFreetype: support version selection
AllFindModules test: expect more modules to have a version number available
FindOpenMP: do not fail if only C or CXX is enabled (#11910)
FindOpenMP: try the most likely flags first
FindOpenMP: simplify check for enabled languages
UseSWIG: clean up string compares
FindPython{Interp,Libs}: document Python_ADDITIONAL_VERSIONS as input
FindPythonLibs: make the version selection work as for PythonInterp
FindPythonLibs: get the exact version of the found library (#3080)
FindPythonLibs: put debug libraries into PYTHON_LIBRARIES
FindPythonLibs: stop scanning when libraries are found
Check{C,CXX}CompilerFlag: detect ICC error messages
GenerateExportHeader: remove unneeded code
GenerateExportHeader: improve compiler identification
FindOpenSceneGraph: give every message() with an explicit level
FindHSPELL: set HSPELL_VERSION_STRING
FindImageMagick: fix fail if no components were given
FindPythonInterp: rework the version detection
document when version detection will not work
AllFindModules test: once again expand version checking
improve error message on a stray "endwhile()"
add testcases for while()/endwhile() errors
reflect that the QtAutomoc depends on QtGui
FindQt3: fix warning when Qt3 is not found
FindQt3: fix version extraction for versions with letters
FindQt3: let FPHSA handle the version selection
FindQt3: fix detection of Qt3 include directory
AllFindModules test: do not require TCLSH version
add test for get_property() errors
Stephen Kelly (13):
Fix typos arguement -> argument.
Exit the loop when we have determined the language.
Add whitespace after '.' in CMAKE_SKIP_RPATH docs.
Fix documented function signature to match reality.
Add default initializers for WIN32_EXECUTABLE and MACOSX_BUNDLE
Add an option to skip RPATH during installation.
Refactor GetIncludeFlags to take includes instead of fetching them
Make it safe to call this method without creating duplicates.
Remove include flags memoization.
Add API to get the ordered includes for a target.
Keep the INCLUDE_DIRECTORIES target property up to date.
Extract and use the INCLUDE_DIRECTORIES target properties.
Fix some typos in the docs comments.
Yury G. Kudryashov (23):
FindDoxygen: add DOXYGEN_VERSION variable
cmInstallCommand: Fix indentation error
cmInstallCommand: Remove duplicated sentence from docs
FindPkgConfig: respect REQUIRED (#12620)
FindPackageHandleStandardArgs: fix documentation
Remove unused file cmake.1
Fix typo in documentation
Drop if(...) check because condition is always true
CMakeFindPackageMode: fix 32/64bit detection if 'file' is a symlink
Run vim spellcheck on some files
cmPropertyDefinition::IsChained is const
Add 'const' qualifier to some cmCommand members
doxygen: cmPropertyDefinition
doxygen: Improve API docs of GetRealDependency
doxygen: Use proper syntax to document enum
doxygen: Small fixes in cmake.h apidocs
doxygen: fix some comments in cmPolicies.h
doxygen: remove a few comments
doxygen: review cmake.h
doxygen: MathCommand is not about string operators
Rename UsedCommands to FinalPassCommands
Remove UnionsAvailable member from 2 classes
Remove cmExprParserHelper::SetLineFile()
Changes in CMake 2.8.7 (since 2.8.7-rc2) Changes in CMake 2.8.7 (since 2.8.7-rc2)
-------------------------------------------- --------------------------------------------
None None

@ -51,13 +51,20 @@ _cmake()
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0 return 0
;; ;;
# FIXME: don't know how to handle multi words completion
# or more precisely word that contains space in them like "Unix Makefiles"
# -G)
# local running=$(for x in `cmake --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d"=" -f 1 | grep -v "^ "`; do echo \"${x}\" ; done )
# COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
# return 0
# ;;
--help-command) --help-command)
local running=$(for x in `cmake --help-command-list`; do echo ${x} ; done ) local running=$(for x in `cmake --help-command-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0 return 0
;; ;;
--help-module) --help-module)
local running=$(for x in `cmake --help-module-list`; do echo ${x} ; done ) local running=$(for x in `cmake --help-module-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0 return 0
;; ;;
@ -67,12 +74,12 @@ _cmake()
return 0 return 0
;; ;;
--help-property) --help-property)
local running=$(for x in `cmake --help-property-list`; do echo ${x} ; done ) local running=$(for x in `cmake --help-property-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0 return 0
;; ;;
--help-variable) --help-variable)
local running=$(for x in `cmake --help-variable-list`; do echo ${x} ; done ) local running=$(for x in `cmake --help-variable-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0 return 0
;; ;;
@ -123,19 +130,29 @@ _cpack()
COMPREPLY=( $(compgen -f ${cur}) ) COMPREPLY=( $(compgen -f ${cur}) )
return 0 return 0
;; ;;
--help-variable)
local running=$(for x in `cpack --help-variable-list | grep -v "cpack version" `; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
--help-command)
local running=$(for x in `cpack --help-command-list | grep -v "cpack version" `; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
*) *)
;; ;;
esac esac
# #
# Complete the option (Level 0 - right after cmake) # Complete the option (Level 0 - right after cpack)
# #
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
} && } &&
complete -F _cpack -o default cpack complete -F _cpack -o default cpack
# #
# cmake command # ctest command
# #
# have ctest && # have ctest &&
_ctest() _ctest()
@ -156,11 +173,11 @@ _ctest()
# #
case "${prev}" in case "${prev}" in
--help-command) --help-command)
local running=$(for x in `ctest --help-command-list`; do echo ${x} ; done ) local running=$(for x in `ctest --help-command-list | grep -v "ctest version" `; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0 return 0
;; ;;
-R) -R|-E)
local running=$(for x in `ctest -N 2> /dev/null | grep "^ Test" | cut -d: -f 2`; do echo ${x} ; done ) local running=$(for x in `ctest -N 2> /dev/null | grep "^ Test" | cut -d: -f 2`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0 return 0

@ -68,9 +68,9 @@ set the path with these commands:
"\\|" "[ \t\r\n]" "\\|" "[ \t\r\n]"
"\\)*")) "\\)*"))
(defconst cmake-regex-block-open (defconst cmake-regex-block-open
"^\\(IF\\|MACRO\\|FOREACH\\|ELSE\\|ELSEIF\\|WHILE\\|FUNCTION\\)$") "^\\([iI][fF]\\|[mM][aA][cC][rR][oO]\\|[fF][oO][rR][eE][aA][cC][hH]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[wW][hH][iI][lL][eE]\\|[fF][uU][nN][cC][tT][iI][oO][nN]\\)$")
(defconst cmake-regex-block-close (defconst cmake-regex-block-close
"^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\|ELSEIF\\|ENDWHILE\\|ENDFUNCTION\\)[ \t]*(") "^[ \t]*\\([eE][nN][dD][iI][fF]\\|[eE][nN][dD][fF][oO][rR][eE][aA][cC][hH]\\|[eE][nN][dD][mM][aA][cC][rR][oO]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[eE][nN][dD][wW][hH][iI][lL][eE]\\|[eE][nN][dD][fF][uU][nN][cC][tT][iI][oO][nN]\\)[ \t]*(")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -99,6 +99,7 @@ set the path with these commands:
(setq region (buffer-substring-no-properties (point) point-start)) (setq region (buffer-substring-no-properties (point) point-start))
(while (and (not (bobp)) (while (and (not (bobp))
(or (looking-at cmake-regex-blank) (or (looking-at cmake-regex-blank)
(cmake-line-starts-inside-string)
(not (and (string-match cmake-regex-indented region) (not (and (string-match cmake-regex-indented region)
(= (length region) (match-end 0)))))) (= (length region) (match-end 0))))))
(forward-line -1) (forward-line -1)

@ -1,9 +1,9 @@
set(AM_SOURCES "@_moc_files@" ) set(AM_SOURCES @_moc_files@ )
set(AM_HEADERS "@_moc_headers@" ) set(AM_HEADERS @_moc_headers@ )
set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@") set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
set(AM_MOC_DEFINITIONS "@_moc_defs@") set(AM_MOC_DEFINITIONS @_moc_defs@)
set(AM_MOC_INCLUDES "@_moc_incs@") set(AM_MOC_INCLUDES @_moc_incs@)
set(AM_MOC_OPTIONS "@_moc_options@") set(AM_MOC_OPTIONS @_moc_options@)
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/") set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
@ -12,5 +12,5 @@ set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/") set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" ) set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" )
set(AM_Qt5Core_VERSION_MAJOR "@Qt5Core_VERSION_MAJOR@" ) set(AM_Qt5Core_VERSION_MAJOR "@Qt5Core_VERSION_MAJOR@" )
set(AM_TARGET_NAME "@_moc_target_name@") set(AM_TARGET_NAME @_moc_target_name@)
set(AM_RELAXED_MODE "@_moc_relaxed_mode@") set(AM_RELAXED_MODE "@_moc_relaxed_mode@")

@ -0,0 +1,42 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() 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 equal to the requested version.
# The tweak version component is ignored.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "@CVF_VERSION@")
if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version
set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
else()
set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@")
endif()
if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version
set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
else()
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
endif()
if("${REQUESTED_VERSION_NO_TWEAK}" STREQUAL "${CVF_VERSION_NO_TWEAK}")
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()
# 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,206 @@
# - Use MinGW gfortran from VS if a fortran compiler is not found.
# The 'add_fortran_subdirectory' function adds a subdirectory
# to a project that contains a fortran only sub-project. The module
# will check the current compiler and see if it can support fortran.
# If no fortran compiler is found and the compiler is MSVC, then
# this module will find the MinGW gfortran. It will then use
# an external project to build with the MinGW tools. It will also
# create imported targets for the libraries created. This will only
# work if the fortran code is built into a dll, so BUILD_SHARED_LIBS
# is turned on in the project. In addition the CMAKE_GNUtoMS option
# is set to on, so that the MS .lib files are created.
# Usage is as follows:
# cmake_add_fortran_subdirectory(
# <subdir> # name of subdirectory
# PROJECT <project_name> # project name in subdir top CMakeLists.txt
# ARCHIVE_DIR <dir> # dir where project places .lib files
# RUNTIME_DIR <dir> # dir where project places .dll files
# LIBRARIES <lib>... # names of library targets to import
# LINK_LIBRARIES # link interface libraries for LIBRARIES
# [LINK_LIBS <lib> <dep>...]...
# CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
# NO_EXTERNAL_INSTALL # skip installation of external project
# )
# Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with respect
# to the build directory corresponding to the source directory in which the
# function is invoked.
#
# Limitations:
#
# NO_EXTERNAL_INSTALL is required for forward compatibility with a
# future version that supports installation of the external project
# binaries during "make install".
#=============================================================================
# Copyright 2011-2012 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.)
set(_MS_MINGW_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
include(CheckLanguage)
include(ExternalProject)
include(CMakeParseArguments)
function(_setup_mingw_config_and_build source_dir build_dir)
# Look for a MinGW gfortran.
find_program(MINGW_GFORTRAN
NAMES gfortran
PATHS
c:/MinGW/bin
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
)
if(NOT MINGW_GFORTRAN)
message(FATAL_ERROR
"gfortran not found, please install MinGW with the gfortran option."
"Or set the cache variable MINGW_GFORTRAN to the full path. "
" This is required to build")
endif()
# Validate the MinGW gfortran we found.
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_mingw_target "Target:.*64.*mingw")
else()
set(_mingw_target "Target:.*mingw32")
endif()
execute_process(COMMAND "${MINGW_GFORTRAN}" -v
ERROR_VARIABLE out ERROR_STRIP_TRAILING_WHITESPACE)
if(NOT "${out}" MATCHES "${_mingw_target}")
string(REPLACE "\n" "\n " out " ${out}")
message(FATAL_ERROR
"MINGW_GFORTRAN is set to\n"
" ${MINGW_GFORTRAN}\n"
"which is not a MinGW gfortran for this architecture. "
"The output from -v does not match \"${_mingw_target}\":\n"
"${out}\n"
"Set MINGW_GFORTRAN to a proper MinGW gfortran for this architecture."
)
endif()
# Configure scripts to run MinGW tools with the proper PATH.
get_filename_component(MINGW_PATH ${MINGW_GFORTRAN} PATH)
file(TO_NATIVE_PATH "${MINGW_PATH}" MINGW_PATH)
string(REPLACE "\\" "\\\\" MINGW_PATH "${MINGW_PATH}")
configure_file(
${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/config_mingw.cmake.in
${build_dir}/config_mingw.cmake
@ONLY)
configure_file(
${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/build_mingw.cmake.in
${build_dir}/build_mingw.cmake
@ONLY)
endfunction()
function(_add_fortran_library_link_interface library depend_library)
set_target_properties(${library} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "${depend_library}")
endfunction()
function(cmake_add_fortran_subdirectory subdir)
# Parse arguments to function
set(options NO_EXTERNAL_INSTALL)
set(oneValueArgs PROJECT ARCHIVE_DIR RUNTIME_DIR)
set(multiValueArgs LIBRARIES LINK_LIBRARIES CMAKE_COMMAND_LINE)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ARGS_NO_EXTERNAL_INSTALL)
message(FATAL_ERROR
"Option NO_EXTERNAL_INSTALL is required (for forward compatibility) "
"but was not given."
)
endif()
# if we are not using MSVC without fortran support
# then just use the usual add_subdirectory to build
# the fortran library
check_language(Fortran)
if(NOT (MSVC AND (NOT CMAKE_Fortran_COMPILER)))
add_subdirectory(${subdir})
return()
endif()
# if we have MSVC without Intel fortran then setup
# external projects to build with mingw fortran
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
set(project_name "${ARGS_PROJECT}")
set(library_dir "${ARGS_ARCHIVE_DIR}")
set(binary_dir "${ARGS_RUNTIME_DIR}")
set(libraries ${ARGS_LIBRARIES})
# use the same directory that add_subdirectory would have used
set(build_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
foreach(dir_var library_dir binary_dir)
if(NOT IS_ABSOLUTE "${${dir_var}}")
get_filename_component(${dir_var}
"${CMAKE_CURRENT_BINARY_DIR}/${${dir_var}}" ABSOLUTE)
endif()
endforeach()
# create build and configure wrapper scripts
_setup_mingw_config_and_build("${source_dir}" "${build_dir}")
# create the external project
externalproject_add(${project_name}_build
SOURCE_DIR ${source_dir}
BINARY_DIR ${build_dir}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-P ${build_dir}/config_mingw.cmake
BUILD_COMMAND ${CMAKE_COMMAND}
-P ${build_dir}/build_mingw.cmake
INSTALL_COMMAND ""
)
# make the external project always run make with each build
externalproject_add_step(${project_name}_build forcebuild
COMMAND ${CMAKE_COMMAND}
-E remove
${CMAKE_CURRENT_BUILD_DIR}/${project_name}-prefix/src/${project_name}-stamp/${project_name}-build
DEPENDEES configure
DEPENDERS build
ALWAYS 1
)
# create imported targets for all libraries
foreach(lib ${libraries})
add_library(${lib} SHARED IMPORTED GLOBAL)
set_property(TARGET ${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(${lib} PROPERTIES
IMPORTED_IMPLIB_NOCONFIG "${library_dir}/lib${lib}.lib"
IMPORTED_LOCATION_NOCONFIG "${binary_dir}/lib${lib}.dll"
)
add_dependencies(${lib} ${project_name}_build)
endforeach()
# now setup link libraries for targets
set(start FALSE)
set(target)
foreach(lib ${ARGS_LINK_LIBRARIES})
if("${lib}" STREQUAL "LINK_LIBS")
set(start TRUE)
else()
if(start)
if(DEFINED target)
# process current target and target_libs
_add_fortran_library_link_interface(${target} "${target_libs}")
# zero out target and target_libs
set(target)
set(target_libs)
endif()
# save the current target and set start to FALSE
set(target ${lib})
set(start FALSE)
else()
# append the lib to target_libs
list(APPEND target_libs "${lib}")
endif()
endif()
endforeach()
# process anything that is left in target and target_libs
if(DEFINED target)
_add_fortran_library_link_interface(${target} "${target_libs}")
endif()
endfunction()

@ -0,0 +1,2 @@
set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
execute_process(COMMAND "@CMAKE_COMMAND@" --build . )

@ -0,0 +1,9 @@
set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
set(CMAKE_COMMAND_LINE "@ARGS_CMAKE_COMMAND_LINE@")
execute_process(
COMMAND "@CMAKE_COMMAND@" "-GMinGW Makefiles"
-DCMAKE_Fortran_COMPILER:PATH=@MINGW_GFORTRAN@
-DBUILD_SHARED_LIBS=ON
-DCMAKE_GNUtoMS=ON
${CMAKE_COMMAND_LINE}
"@source_dir@")

@ -1,6 +1,7 @@
SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@") SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@") SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@") SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@") SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
@SET_MSVC_C_ARCHITECTURE_ID@ @SET_MSVC_C_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@") SET(CMAKE_AR "@CMAKE_AR@")

@ -2,27 +2,68 @@
# error "A C++ compiler has been selected for C." # error "A C++ compiler has been selected for C."
#endif #endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__18CXX) #if defined(__18CXX)
# define ID_VOID_MAIN # define ID_VOID_MAIN
#endif #endif
#if defined(__INTEL_COMPILER) || defined(__ICC) #if defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel" # define COMPILER_ID "Intel"
/* __INTEL_COMPILER = VRP */
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
#elif defined(__clang__) #elif defined(__clang__)
# define COMPILER_ID "Clang" # define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__) #elif defined(__BORLANDC__)
# define COMPILER_ID "Borland" # define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
# define COMPILER_ID "Watcom" # define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
#elif defined(__SUNPRO_C) #elif defined(__SUNPRO_C)
# define COMPILER_ID "SunPro" # define COMPILER_ID "SunPro"
# if __SUNPRO_C >= 0x5100
/* __SUNPRO_C = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
# else
/* __SUNPRO_C = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
# endif
#elif defined(__HP_cc) #elif defined(__HP_cc)
# define COMPILER_ID "HP" # define COMPILER_ID "HP"
/* __HP_cc = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
#elif defined(__DECC) #elif defined(__DECC)
# define COMPILER_ID "Compaq" # define COMPILER_ID "Compaq"
@ -30,14 +71,25 @@
#elif defined(__IBMC__) #elif defined(__IBMC__)
# if defined(__COMPILER_VER__) # if defined(__COMPILER_VER__)
# define COMPILER_ID "zOS" # define COMPILER_ID "zOS"
# elif __IBMC__ >= 800 # else
# if __IBMC__ >= 800
# define COMPILER_ID "XL" # define COMPILER_ID "XL"
# else # else
# define COMPILER_ID "VisualAge" # define COMPILER_ID "VisualAge"
# endif
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
# endif # endif
#elif defined(__PGI) #elif defined(__PGI)
# define COMPILER_ID "PGI" # define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__PATHSCALE__) #elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale" # define COMPILER_ID "PathScale"
@ -56,9 +108,29 @@
#elif defined(__GNUC__) #elif defined(__GNUC__)
# define COMPILER_ID "GNU" # define COMPILER_ID "GNU"
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# define COMPILER_ID "MSVC" # define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
@ -78,6 +150,17 @@
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro" # define COMPILER_ID "MIPSpro"
# if defined(_SGI_COMPILER_VERSION)
/* _SGI_COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
# else
/* _COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
# endif
/* This compiler is either not known or is too old to define an /* This compiler is either not known or is too old to define an
identification macro. Try to identify the platform and guess that identification macro. Try to identify the platform and guess that
@ -112,6 +195,9 @@ int main(int argc, char* argv[])
require += info_compiler[argc]; require += info_compiler[argc];
require += info_platform[argc]; require += info_platform[argc];
require += info_arch[argc]; require += info_arch[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
(void)argv; (void)argv;
return require; return require;
} }

@ -1,6 +1,7 @@
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@") SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
@SET_MSVC_CXX_ARCHITECTURE_ID@ @SET_MSVC_CXX_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@") SET(CMAKE_AR "@CMAKE_AR@")

@ -5,26 +5,67 @@
# error "A C compiler has been selected for C++." # error "A C compiler has been selected for C++."
#endif #endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__COMO__) #if defined(__COMO__)
# define COMPILER_ID "Comeau" # define COMPILER_ID "Comeau"
#elif defined(__INTEL_COMPILER) || defined(__ICC) #elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel" # define COMPILER_ID "Intel"
/* __INTEL_COMPILER = VRP */
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
#elif defined(__clang__) #elif defined(__clang__)
# define COMPILER_ID "Clang" # define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__) #elif defined(__BORLANDC__)
# define COMPILER_ID "Borland" # define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
# define COMPILER_ID "Watcom" # define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
#elif defined(__SUNPRO_CC) #elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro" # define COMPILER_ID "SunPro"
# if __SUNPRO_CC >= 0x5100
/* __SUNPRO_CC = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# endif
#elif defined(__HP_aCC) #elif defined(__HP_aCC)
# define COMPILER_ID "HP" # define COMPILER_ID "HP"
/* __HP_aCC = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX) #elif defined(__DECCXX)
# define COMPILER_ID "Compaq" # define COMPILER_ID "Compaq"
@ -32,14 +73,25 @@
#elif defined(__IBMCPP__) #elif defined(__IBMCPP__)
# if defined(__COMPILER_VER__) # if defined(__COMPILER_VER__)
# define COMPILER_ID "zOS" # define COMPILER_ID "zOS"
# elif __IBMCPP__ >= 800 # else
# if __IBMCPP__ >= 800
# define COMPILER_ID "XL" # define COMPILER_ID "XL"
# else # else
# define COMPILER_ID "VisualAge" # define COMPILER_ID "VisualAge"
# endif
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
# endif # endif
#elif defined(__PGI) #elif defined(__PGI)
# define COMPILER_ID "PGI" # define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__PATHSCALE__) #elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale" # define COMPILER_ID "PathScale"
@ -55,9 +107,29 @@
#elif defined(__GNUC__) #elif defined(__GNUC__)
# define COMPILER_ID "GNU" # define COMPILER_ID "GNU"
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# define COMPILER_ID "MSVC" # define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
@ -66,6 +138,17 @@
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro" # define COMPILER_ID "MIPSpro"
# if defined(_SGI_COMPILER_VERSION)
/* _SGI_COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
# else
/* _COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
# endif
/* This compiler is either not known or is too old to define an /* This compiler is either not known or is too old to define an
identification macro. Try to identify the platform and guess that identification macro. Try to identify the platform and guess that
@ -96,6 +179,9 @@ int main(int argc, char* argv[])
int require = 0; int require = 0;
require += info_compiler[argc]; require += info_compiler[argc];
require += info_platform[argc]; require += info_platform[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
(void)argv; (void)argv;
return require; return require;
} }

@ -93,12 +93,6 @@ IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
ENDIF() ENDIF()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
# Create a set of shared library variable specific to C++ # Create a set of shared library variable specific to C++
# For 90% of the systems, these are the same flags as the C versions # For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version # so if these are not set just copy the flags from the c version
@ -158,6 +152,14 @@ IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C}) SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
# repeat for modules # repeat for modules
IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})

@ -55,8 +55,13 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Display the final identification result. # Display the final identification result.
IF(CMAKE_${lang}_COMPILER_ID) IF(CMAKE_${lang}_COMPILER_ID)
IF(CMAKE_${lang}_COMPILER_VERSION)
SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
ELSE()
SET(_version "")
ENDIF()
MESSAGE(STATUS "The ${lang} compiler identification is " MESSAGE(STATUS "The ${lang} compiler identification is "
"${CMAKE_${lang}_COMPILER_ID}") "${CMAKE_${lang}_COMPILER_ID}${_version}")
ELSE(CMAKE_${lang}_COMPILER_ID) ELSE(CMAKE_${lang}_COMPILER_ID)
MESSAGE(STATUS "The ${lang} compiler identification is unknown") MESSAGE(STATUS "The ${lang} compiler identification is unknown")
ENDIF(CMAKE_${lang}_COMPILER_ID) ENDIF(CMAKE_${lang}_COMPILER_ID)
@ -65,6 +70,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE) PARENT_SCOPE)
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID) ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@ -177,9 +183,10 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
IF(NOT CMAKE_${lang}_COMPILER_ID) IF(NOT CMAKE_${lang}_COMPILER_ID)
# Read the compiler identification string from the executable file. # Read the compiler identification string from the executable file.
SET(COMPILER_ID) SET(COMPILER_ID)
SET(COMPILER_VERSION)
SET(PLATFORM_ID) SET(PLATFORM_ID)
FILE(STRINGS ${file} FILE(STRINGS ${file}
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 3 REGEX "INFO:") CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
SET(HAVE_COMPILER_TWICE 0) SET(HAVE_COMPILER_TWICE 0)
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
@ -197,6 +204,11 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1" STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
ARCHITECTURE_ID "${info}") ARCHITECTURE_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
STRING(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
STRING(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
STRING(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
ENDFOREACH(info) ENDFOREACH(info)
# Check if a valid compiler and platform were found. # Check if a valid compiler and platform were found.
@ -204,6 +216,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}") SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}") SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}") SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE) ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
# Check the compiler identification string. # Check the compiler identification string.
@ -251,6 +264,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE) PARENT_SCOPE)
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE) SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang) ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)

@ -50,7 +50,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
# fort77: native F77 compiler under HP-UX (and some older Crays) # fort77: native F77 compiler under HP-UX (and some older Crays)
# frt: Fujitsu F77 compiler # frt: Fujitsu F77 compiler
# pathf90/pathf95/pathf2003: PathScale Fortran compiler # pathf90/pathf95/pathf2003: PathScale Fortran compiler
# pgf77/pgf90/pgf95: Portland Group F77/F90/F95 compilers # pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
# lf95: Lahey-Fujitsu F95 compiler # lf95: Lahey-Fujitsu F95 compiler
# fl32: Microsoft Fortran 77 "PowerStation" compiler # fl32: Microsoft Fortran 77 "PowerStation" compiler
@ -64,8 +64,8 @@ IF(NOT CMAKE_Fortran_COMPILER)
# then 77 or older compilers, gnu is always last in the group, # then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default. # so if you paid for a compiler it is picked by default.
SET(CMAKE_Fortran_COMPILER_LIST SET(CMAKE_Fortran_COMPILER_LIST
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77 fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
frt pgf77 xlf fl32 af77 g77 f77 frt pgf77 xlf fl32 af77 g77 f77
) )
@ -73,7 +73,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77) SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc) SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77) SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgf90 pgf77) SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90) SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
SET(_Fortran_COMPILER_NAMES_XL xlf) SET(_Fortran_COMPILER_NAMES_XL xlf)
SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf) SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)

@ -0,0 +1,129 @@
# CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
# [CONFIGURATION <config>] )
#
# CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
# all imported targets contained in this list with their actual file paths
# of the referenced libraries on disk, including the libraries from their
# link interfaces.
# If a CONFIGURATION is given, it uses the respective configuration of the
# imported targets if it exists. If no CONFIGURATION is given, it uses
# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
# ${CMAKE_BUILD_TYPE}.
# This macro is used by all Check*.cmake files which use
# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that
# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
#=============================================================================
# Copyright 2012 Kitware, Inc.
# Copyright 2009-2012 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.)
include(CMakeParseArguments)
function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
set(options )
set(oneValueArgs CONFIGURATION )
set(multiValueArgs LIBRARIES )
cmake_parse_arguments(CEIT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(CEIT_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to CMAKE_EXPAND_IMPORTED_TARGETS(): \"${CEIT_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT CEIT_CONFIGURATION)
if(CMAKE_CONFIGURATION_TYPES)
list(GET CMAKE_CONFIGURATION_TYPES 0 CEIT_CONFIGURATION)
else()
set(CEIT_CONFIGURATION ${CMAKE_BUILD_TYPE})
endif()
endif()
# handle imported library targets
set(_CCSR_REQ_LIBS ${CEIT_LIBRARIES})
set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
set(_CCSR_LOOP_COUNTER 0)
while(_CHECK_FOR_IMPORTED_TARGETS)
math(EXPR _CCSR_LOOP_COUNTER "${_CCSR_LOOP_COUNTER} + 1 ")
set(_CCSR_NEW_REQ_LIBS )
set(_CHECK_FOR_IMPORTED_TARGETS FALSE)
foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
if (_importedConfigs)
# message(STATUS "Detected imported target ${_CURRENT_LIB}")
# Ok, so this is an imported target.
# First we get the imported configurations.
# Then we get the location of the actual library on disk of the first configuration.
# then we'll get its link interface libraries property,
# iterate through it and replace all imported targets we find there
# with there actual location.
# guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
if ("${_CCSR_LOOP_COUNTER}" LESS 100)
set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
# else ("${_CCSR_LOOP_COUNTER}" LESS 1)
# message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
endif ("${_CCSR_LOOP_COUNTER}" LESS 100)
# if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION},
# use it, otherwise simply use the first one:
list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
if("${_configIndexToUse}" EQUAL -1)
set(_configIndexToUse 0)
endif("${_configIndexToUse}" EQUAL -1)
list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" IMPORTED_LINK_INTERFACE_LIBRARIES_${_importedConfigToUse} )
list(APPEND _CCSR_NEW_REQ_LIBS "${_importedLocation}")
# message(STATUS "Appending lib ${_CURRENT_LIB} as ${_importedLocation}")
if(_linkInterfaceLibs)
foreach(_currentLinkInterfaceLib ${_linkInterfaceLibs})
# message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
if(_currentLinkInterfaceLib)
list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
endif(_currentLinkInterfaceLib)
endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}")
endif(_linkInterfaceLibs)
else(_importedConfigs)
# "Normal" libraries are just used as they are.
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
endif(_importedConfigs)
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
endwhile(_CHECK_FOR_IMPORTED_TARGETS)
# Finally we iterate once more over all libraries. This loop only removes
# all remaining imported target names (there shouldn't be any left anyway).
set(_CCSR_NEW_REQ_LIBS )
foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
if (NOT _importedConfigs)
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "final: appending ${_CURRENT_LIB}")
else (NOT _importedConfigs)
# message(STATUS "final: skipping ${_CURRENT_LIB}")
endif (NOT _importedConfigs)
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
# message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)
endfunction()

@ -20,7 +20,9 @@ FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable"
FUNCTION(_FIND_ECLIPSE_VERSION) FUNCTION(_FIND_ECLIPSE_VERSION)
# This code is in a function so the variables used here have only local scope # This code is in a function so the variables used here have only local scope
IF(CMAKE_ECLIPSE_EXECUTABLE) IF(CMAKE_ECLIPSE_EXECUTABLE)
GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${CMAKE_ECLIPSE_EXECUTABLE}" PATH) # use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036)
GET_FILENAME_COMPONENT(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*") FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+") IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1}) SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1})

@ -71,7 +71,8 @@ if(UNIX)
# use the file utility to check whether itself is 64 bit: # use the file utility to check whether itself is 64 bit:
find_program(FILE_EXECUTABLE file) find_program(FILE_EXECUTABLE file)
if(FILE_EXECUTABLE) if(FILE_EXECUTABLE)
execute_process(COMMAND "${FILE_EXECUTABLE}" "${FILE_EXECUTABLE}" OUTPUT_VARIABLE fileOutput ERROR_QUIET) get_filename_component(FILE_ABSPATH "${FILE_EXECUTABLE}" ABSOLUTE)
execute_process(COMMAND "${FILE_ABSPATH}" "${FILE_ABSPATH}" OUTPUT_VARIABLE fileOutput ERROR_QUIET)
if("${fileOutput}" MATCHES "64-bit") if("${fileOutput}" MATCHES "64-bit")
set(CMAKE_SIZEOF_VOID_P 8) set(CMAKE_SIZEOF_VOID_P 8)
endif() endif()

@ -109,6 +109,14 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG}) SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF() ENDIF()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
# repeat for modules # repeat for modules
IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS) IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})

@ -39,6 +39,8 @@ SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
"If set, runtime paths are not added when using shared libraries.") "If set, runtime paths are not added when using shared libraries.")
SET (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
"If set, runtime paths are not added when installing shared libraries, but are added when building.")
SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.") SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
@ -168,5 +170,6 @@ ENDIF(CMAKE_HOST_UNIX)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
CMAKE_SKIP_RPATH CMAKE_SKIP_RPATH
CMAKE_SKIP_INSTALL_RPATH
CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE
) )

@ -0,0 +1,17 @@
#=============================================================================
# Copyright 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.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM ninja
DOC "Program used to build from build.ninja files.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)

@ -0,0 +1,227 @@
# - CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VERSION_FILE()
#
# CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
# [PATH_VARS <var1> <var2> ... <varN>]
# [NO_SET_AND_CHECK_MACRO]
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
#
# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake
# file for installing a project or library. It helps making the resulting package
# relocatable by avoiding hardcoded paths in the installed Config.cmake file.
#
# In a FooConfig.cmake file there may be code like this to make the
# install destinations know to the using project:
# set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
# set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
# set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
# ...logic to determine installedPrefix from the own location...
# set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
# All 4 options shown above are not sufficient, since the first 3 hardcode
# the absolute directory locations, and the 4th case works only if the logic
# to determine the installedPrefix is correct, and if CONFIG_INSTALL_DIR contains
# a relative path, which in general cannot be guaranteed.
# This has the effect that the resulting FooConfig.cmake file would work poorly
# under Windows and OSX, where users are used to choose the install location
# of a binary package at install time, independent from how CMAKE_INSTALL_PREFIX
# was set at build/cmake time.
#
# Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly, it makes the
# resulting FooConfig.cmake file relocatable.
# Usage:
# 1. write a FooConfig.cmake.in file as you are used to
# 2. insert a line containing only the string "@PACKAGE_INIT@"
# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
# (this must be after the @PACKAGE_INIT@ line)
# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
#
# The <input> and <output> arguments are the input and output file, the same way
# as in CONFIGURE_FILE().
#
# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
# file will be installed to. This can either be a relative or absolute path, both work.
#
# The variables <var1> to <varN> given as PATH_VARS are the variables which contain
# install destinations. For each of them the macro will create a helper variable
# PACKAGE_<var...>. These helper variables must be used
# in the FooConfig.cmake.in file for setting the installed location. They are calculated
# by CONFIGURE_PACKAGE_CONFIG_FILE() so that they are always relative to the
# installed location of the package. This works both for relative and also for absolute locations.
# For absolute locations it works only if the absolute location is a subdirectory
# of CMAKE_INSTALL_PREFIX.
#
# By default configure_package_config_file() also generates two helper macros,
# set_and_check() and check_required_components() into the FooConfig.cmake file.
#
# set_and_check() should be used instead of the normal set()
# command for setting directories and file locations. Additionally to setting the
# variable it also checks that the referenced file or directory actually exists
# and fails with a FATAL_ERROR otherwise. This makes sure that the created
# FooConfig.cmake file does not contain wrong references.
# When using the NO_SET_AND_CHECK_MACRO, this macro is not generated into the
# FooConfig.cmake file.
#
# check_required_components(<package_name>) should be called at the end of the
# FooConfig.cmake file if the package supports components.
# This macro checks whether all requested, non-optional components have been found,
# and if this is not the case, sets the Foo_FOUND variable to FALSE, so that the package
# is considered to be not found.
# It does that by testing the Foo_<Component>_FOUND variables for all requested
# required components.
# When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro is not generated
# into the FooConfig.cmake file.
#
# For an example see below the documentation for WRITE_BASIC_PACKAGE_VERSION_FILE().
#
#
# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
#
# Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
# See the documentation of FIND_PACKAGE() for details on this.
# filename is the output filename, it should be in the build tree.
# major.minor.patch is the version number of the project to be installed
# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
# will be considered compatible if it is newer or exactly the same as the requested version.
# This mode should be used for packages which are fully backward compatible,
# also across major versions.
# If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion
# in that the major version number must be the same as requested, e.g. version 2.0 will
# not be considered compatible if 1.0 is requested.
# This mode should be used for packages which guarantee backward compatibility within the
# same major version.
# If ExactVersion is used, then the package is only considered compatible if the requested
# version matches exactly its own version number (not considering the tweak version).
# For example, version 1.2.3 of a package is only considered compatible to requested version 1.2.3.
# This mode is for packages without compatibility guarantees.
# If your project has more elaborated version matching rules, you will need to write your
# own custom ConfigVersion.cmake file instead of using this macro.
#
# Internally, this macro executes configure_file() to create the resulting
# version file. Depending on the COMPATIBLITY, either the file
# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
# is used. Please note that these two files are internal to CMake and you should
# not call configure_file() on them yourself, but they can be used as starting
# point to create more sophisticted custom ConfigVersion.cmake files.
#
#
# Example using both configure_package_config_file() and write_basic_package_version_file():
# CMakeLists.txt:
# set(INCLUDE_INSTALL_DIR include/ ... CACHE )
# set(LIB_INSTALL_DIR lib/ ... CACHE )
# set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
# ...
# include(CMakePackageConfigHelpers)
# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
# VERSION 1.2.3
# COMPATIBILITY SameMajorVersion )
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
# DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
#
# With a FooConfig.cmake.in:
# set(FOO_VERSION x.y.z)
# ...
# @PACKAGE_INIT@
# ...
# set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
# set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
#
# check_required_components(Foo)
#=============================================================================
# Copyright 2012 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.)
include(CMakeParseArguments)
include(WriteBasicConfigVersionFile)
macro(WRITE_BASIC_PACKAGE_VERSION_FILE)
write_basic_config_version_file(${ARGN})
endmacro()
function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
set(oneValueArgs INSTALL_DESTINATION )
set(multiValueArgs PATH_VARS )
cmake_parse_arguments(CCF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(CCF_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE(): \"${CCF_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT CCF_INSTALL_DESTINATION)
message(FATAL_ERROR "No INSTALL_DESTINATION given to CONFIGURE_PACKAGE_CONFIG_FILE()")
endif()
if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
set(absInstallDir "${CCF_INSTALL_DESTINATION}")
else()
set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
endif()
file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" )
foreach(var ${CCF_PATH_VARS})
if(NOT DEFINED ${var})
message(FATAL_ERROR "Variable ${var} does not exist")
else()
if(IS_ABSOLUTE "${${var}}")
string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
PACKAGE_${var} "${${var}}")
else()
set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}")
endif()
endif()
endforeach()
set(PACKAGE_INIT "
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
")
if(NOT CCF_NO_SET_AND_CHECK_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT}
macro(set_and_check _var _file)
set(\${_var} \"\${_file}\")
if(NOT EXISTS \"\${_file}\")
message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\")
endif()
endmacro()
")
endif()
if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO)
set(PACKAGE_INIT "${PACKAGE_INIT}
macro(check_required_components _NAME)
foreach(comp \${\${_NAME}_FIND_COMPONENTS})
if(NOT \${_NAME}_\${comp}_FOUND)
if(\${_NAME}_FIND_REQUIRED_\${comp})
set(\${_NAME}_FOUND FALSE)
endif()
endif()
endforeach(comp)
endmacro()
")
endif()
set(PACKAGE_INIT "${PACKAGE_INIT}
####################################################################################")
configure_file("${_inputFile}" "${_outputFile}" @ONLY)
endfunction()

@ -105,6 +105,46 @@
# define ARCHITECTURE_ID "" # define ARCHITECTURE_ID ""
#endif #endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number components. */
#ifdef COMPILER_VERSION_MAJOR
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from /* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the because some compilers will just produce instructions to fill the

@ -1,5 +1,7 @@
# - Build binary and source package installers ##section Variables common to all CPack generators
# ##end
##module
# - Build binary and source package installers.
# The CPack module generates binary and source installers in a variety # The CPack module generates binary and source installers in a variety
# of formats using the cpack program. Inclusion of the CPack module # of formats using the cpack program. Inclusion of the CPack module
# adds two new targets to the resulting makefiles, package and # adds two new targets to the resulting makefiles, package and
@ -48,174 +50,216 @@
# Before including this CPack module in your CMakeLists.txt file, # Before including this CPack module in your CMakeLists.txt file,
# there are a variety of variables that can be set to customize # there are a variety of variables that can be set to customize
# the resulting installers. The most commonly-used variables are: # the resulting installers. The most commonly-used variables are:
##end
# #
##variable
# CPACK_PACKAGE_NAME - The name of the package (or application). If # CPACK_PACKAGE_NAME - The name of the package (or application). If
# not specified, defaults to the project name. # not specified, defaults to the project name.
##end
# #
# CPACK_PACKAGE_VENDOR - The name of the package vendor (e.g., ##variable
# CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g.,
# "Kitware"). # "Kitware").
##end
# #
##variable
# CPACK_PACKAGE_VERSION_MAJOR - Package major Version # CPACK_PACKAGE_VERSION_MAJOR - Package major Version
##end
# #
##variable
# CPACK_PACKAGE_VERSION_MINOR - Package minor Version # CPACK_PACKAGE_VERSION_MINOR - Package minor Version
##end
# #
##variable
# CPACK_PACKAGE_VERSION_PATCH - Package patch Version # CPACK_PACKAGE_VERSION_PATCH - Package patch Version
##end
# #
##variable
# CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the # CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
# project. Used, for example, the introduction screen of a # project. Used, for example, the introduction screen of a
# CPack-generated Windows installer to describe the project. # CPack-generated Windows installer to describe the project.
##end
# #
##variable
# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the # CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
# project (only a few words). # project (only a few words).
##end
# #
##variable
# CPACK_PACKAGE_FILE_NAME - The name of the package file to generate, # CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
# not including the extension. For example, cmake-2.6.1-Linux-i686. # not including the extension. For example, cmake-2.6.1-Linux-i686.
# The default value is
# ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}.
##end
# #
##variable
# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the # CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
# target system, e.g., "CMake 2.5". # target system. This may be used by some CPack generators
# # like NSIS to create an installation directory e.g., "CMake 2.5"
# CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per # below the installation prefix. All installed element will be
# generator after setting CPACK_GENERATOR to the actual generator # put inside this directory.
# being used. Allows per-generator setting of CPACK_* variables at ##end
#
##variable
# CPACK_PACKAGE_ICON - A branding image that will be displayed inside
# the installer (used by GUI installers).
##end
#
##variable
# CPACK_PROJECT_CONFIG_FILE - CPack-time project CPack configuration
# file. This file included at cpack time, once per
# generator after CPack has set CPACK_GENERATOR to the actual generator
# being used. It allows per-generator setting of CPACK_* variables at
# cpack time. # cpack time.
# ##end
# CPACK_RESOURCE_FILE_LICENSE - License file for the project, which #
# will typically be displayed to the user (often with an explicit ##variable
# "Accept" button, for graphical installers) prior to installation. # CPACK_RESOURCE_FILE_LICENSE - License to be embedded in the installer. It
# # will typically be displayed to the user by the produced installer
# CPACK_RESOURCE_FILE_README - ReadMe file for the project, which # (often with an explicit "Accept" button, for graphical installers)
# typically describes in some detail # prior to installation. This license file is NOT added to installed
# # file but is used by some CPack generators like NSIS. If you want
# CPACK_RESOURCE_FILE_WELCOME - Welcome file for the project, which # to install a license file (may be the same as this one)
# welcomes users to this installer. Typically used in the graphical # along with your project you must add an appropriate CMake INSTALL
# installers on Windows and Mac OS X. # command in your CMakeLists.txt.
# ##end
#
##variable
# CPACK_RESOURCE_FILE_README - ReadMe file to be embedded in the installer. It
# typically describes in some detail the purpose of the project
# during the installation. Not all CPack generators uses
# this file.
##end
#
##variable
# CPACK_RESOURCE_FILE_WELCOME - Welcome file to be embedded in the
# installer. It welcomes users to this installer.
# Typically used in the graphical installers on Windows and Mac OS X.
##end
#
##variable
# CPACK_MONOLITHIC_INSTALL - Disables the component-based # CPACK_MONOLITHIC_INSTALL - Disables the component-based
# installation mechanism, so that all components are always installed. # installation mechanism. When set the component specification is ignored
# # and all installed items are put in a single "MONOLITHIC" package.
# Some CPack generators do monolithic packaging by default and
# may be asked to do component packaging by setting
# CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE.
##end
#
##variable
# CPACK_GENERATOR - List of CPack generators to use. If not # CPACK_GENERATOR - List of CPack generators to use. If not
# specified, CPack will create a set of options (e.g., # specified, CPack will create a set of options CPACK_BINARY_<GENNAME> (e.g.,
# CPACK_BINARY_NSIS) allowing the user to enable/disable individual # CPACK_BINARY_NSIS) allowing the user to enable/disable individual
# generators. # generators. This variable may be used on the command line
# # as well as in:
# CPACK_OUTPUT_CONFIG_FILE - The name of the CPack configuration file #
# for binary installers that will be generated by the CPack # cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree
# module. Defaults to CPackConfig.cmake. ##end
# #
# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables along ##variable
# with a text label, to be used to create Start Menu shortcuts on # CPACK_OUTPUT_CONFIG_FILE - The name of the CPack binary configuration
# Windows. For example, setting this to the list ccmake;CMake will # file. This file is the CPack configuration generated by the CPack module
# for binary installers. Defaults to CPackConfig.cmake.
##end
#
##variable
# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables and associated
# text label to be used to create Start Menu shortcuts. For example,
# setting this to the list ccmake;CMake will
# create a shortcut named "CMake" that will execute the installed # create a shortcut named "CMake" that will execute the installed
# executable ccmake. # executable ccmake. Not all CPack generators use it (at least NSIS and
# OSXX11 do).
##end
# #
##variable
# CPACK_STRIP_FILES - List of files to be stripped. Starting with # CPACK_STRIP_FILES - List of files to be stripped. Starting with
# CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which # CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
# enables stripping of all files (a list of files evaluates to TRUE # enables stripping of all files (a list of files evaluates to TRUE
# in CMake, so this change is compatible). # in CMake, so this change is compatible).
##end
# #
# The following CPack variables are specific to source packages, and # The following CPack variables are specific to source packages, and
# will not affect binary packages: # will not affect binary packages:
# #
# CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package, ##variable
# e.g., cmake-2.6.1 # CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package. For
# example cmake-2.6.1.
##end
# #
##variable
# CPACK_SOURCE_STRIP_FILES - List of files in the source tree that # CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
# will be stripped. Starting with CMake 2.6.0 # will be stripped. Starting with CMake 2.6.0
# CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables # CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
# stripping of all files (a list of files evaluates to TRUE in CMake, # stripping of all files (a list of files evaluates to TRUE in CMake,
# so this change is compatible). # so this change is compatible).
##end
# #
##variable
# CPACK_SOURCE_GENERATOR - List of generators used for the source # CPACK_SOURCE_GENERATOR - List of generators used for the source
# packages. As with CPACK_GENERATOR, if this is not specified then # packages. As with CPACK_GENERATOR, if this is not specified then
# CPack will create a set of options (e.g., CPACK_SOURCE_ZIP) # CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
# allowing users to select which packages will be generated. # allowing users to select which packages will be generated.
##end
# #
# CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack ##variable
# configuration file for source installers that will be generated by # CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack source
# the CPack module. Defaults to CPackSourceConfig.cmake. # configuration file. This file is the CPack configuration generated by the
# CPack module for source installers. Defaults to CPackSourceConfig.cmake.
##end
# #
##variable
# CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree # CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
# that won't be packaged when building a source package. This is a # that won't be packaged when building a source package. This is a
# list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.* # list of regular expression patterns (that must be properly escaped),
# # e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
# The following variables are specific to the DragNDrop installers ##end
# built on Mac OS X:
#
# CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
# image. Defaults to CPACK_PACKAGE_FILE_NAME.
#
# CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
# (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
# bzip2-compressed). Refer to hdiutil(1) for more information on
# other available formats.
#
# CPACK_DMG_DS_STORE - Path to a custom .DS_Store file which e.g.
# can be used to specify the Finder window position/geometry and
# layout (such as hidden toolbars, placement of the icons etc.).
# This file has to be generated by the Finder (either manually or
# through OSA-script) using a normal folder from which the .DS_Store
# file can then be extracted.
#
# CPACK_DMG_BACKGROUND_IMAGE - Path to an image file which is to be
# used as the background for the Finder Window when the disk image
# is opened. By default no background image is set. The background
# image is applied after applying the custom .DS_Store file.
#
# CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
# operate on disk image files on Mac OS X. This variable can be used
# to override the automatically detected command (or specify its
# location if the auto-detection fails to find it.)
#
# CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
# extended attributes on files and directories on Mac OS X. This
# variable can be used to override the automatically detected
# command (or specify its location if the auto-detection fails to
# find it.)
#
# CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
# resources on Mac OS X. This variable can be used to override the
# automatically detected command (or specify its location if the
# auto-detection fails to find it.)
#
# The following variable is specific to installers build on Mac OS X
# using PackageMaker:
#
# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
# resulting PackageMaker archive should be compatible
# with. Different versions of Mac OS X support different
# features. For example, CPack can only build component-based
# installers for Mac OS X 10.4 or newer, and can only build
# installers that download component son-the-fly for Mac OS X 10.5
# or newer. If left blank, this value will be set to the minimum
# version of Mac OS X that supports the requested features. Set this
# variable to some value (e.g., 10.4) only if you want to guarantee
# that your installer will work on that version of Mac OS X, and
# don't mind missing extra features available in the installer
# shipping with later versions of Mac OS X.
# #
# The following variables are for advanced uses of CPack: # The following variables are for advanced uses of CPack:
# #
##variable
# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the # CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
# project is CMake project. Defaults to the value of CMAKE_GENERATOR; # project is CMake project. Defaults to the value of CMAKE_GENERATOR
# few users will want to change this setting. # few users will want to change this setting.
##end
# #
##variable
# CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify # CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
# what project to install. The four values are: Build directory, # what project to install. The four values are: Build directory,
# Project Name, Project Component, Directory. If omitted, CPack will # Project Name, Project Component, Directory. If omitted, CPack will
# build an installer that installers everything. # build an installer that installers everything.
##end
# #
##variable
# CPACK_SYSTEM_NAME - System name, defaults to the value of # CPACK_SYSTEM_NAME - System name, defaults to the value of
# ${CMAKE_SYSTEM_NAME}. # ${CMAKE_SYSTEM_NAME}.
##end
# #
##variable
# CPACK_PACKAGE_VERSION - Package full version, used internally. By # CPACK_PACKAGE_VERSION - Package full version, used internally. By
# default, this is built from CPACK_PACKAGE_VERSION_MAJOR, # default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
# CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH. # CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
##end
# #
##variable
# CPACK_TOPLEVEL_TAG - Directory for the installed files. # CPACK_TOPLEVEL_TAG - Directory for the installed files.
##end
# #
##variable
# CPACK_INSTALL_COMMANDS - Extra commands to install components. # CPACK_INSTALL_COMMANDS - Extra commands to install components.
##end
# #
##variable
# CPACK_INSTALLED_DIRECTORIES - Extra directories to install. # CPACK_INSTALLED_DIRECTORIES - Extra directories to install.
##end
#
##variable
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
# installing this project. This is only used
# by installer for Windows.
##end
##variable
# CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create.
##end
# #
#============================================================================= #=============================================================================
@ -259,7 +303,7 @@ MACRO(cpack_set_if_not_set name value)
ENDIF(NOT DEFINED "${name}") ENDIF(NOT DEFINED "${name}")
ENDMACRO(cpack_set_if_not_set) ENDMACRO(cpack_set_if_not_set)
# Macro to encode variables for the configuration file # cpack_encode_variables - Macro to encode variables for the configuration file
# find any variable that starts with CPACK and create a variable # find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for # _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then # each cpack variable. _CPACK_OTHER_VARIABLES_ is then
@ -350,6 +394,12 @@ macro(cpack_optional_append _list _cond _item)
endif(${_cond}) endif(${_cond})
endmacro(cpack_optional_append _list _cond _item) endmacro(cpack_optional_append _list _cond _item)
##variable
# CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The
# CPack.cmake module generates (when CPACK_GENERATOR is not set)
# a set of CMake options (see CMake option command) which may then be used to
# select the CPack generator(s) to be used when launching the package target.
##end
# Provide options to choose generators # Provide options to choose generators
# we might check here if the required tools for the generates exist # we might check here if the required tools for the generates exist
# and set the defaults according to the results # and set the defaults according to the results

@ -1,25 +1,36 @@
##section Variables specific to CPack Bundle generator
##end
##module
# - CPack Bundle generator (Mac OS X) specific options # - CPack Bundle generator (Mac OS X) specific options
# #
# Installers built on Mac OS X using the Bundle generator use the # Installers built on Mac OS X using the Bundle generator use the
# aforementioned DragNDrop variables, plus the following Bundle-specific # aforementioned DragNDrop (CPACK_DMG_xxx) variables, plus
# parameters: # the following Bundle-specific parameters (CPACK_BUNDLE_xxx).
##end
# #
##variable
# CPACK_BUNDLE_NAME - The name of the generated bundle. This # CPACK_BUNDLE_NAME - The name of the generated bundle. This
# appears in the OSX finder as the bundle name. Required. # appears in the OSX finder as the bundle name. Required.
##end
# #
##variable
# CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used # CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
# as the Info.plist for the generated bundle. This assumes that # for the generated bundle. This assumes that the caller has generated
# the caller has generated or specified their own Info.plist file. # or specified their own Info.plist file. Required.
# Required. ##end
# #
# CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as ##variable
# the icon for the generated bundle. This is the icon that appears # CPACK_BUNDLE_ICON - Path to an OSX icon file that will be used as
# in the OSX finder for the bundle, and in the OSX dock when the # the icon for the generated bundle. This is the icon that appears in the
# bundle is opened. Required. # OSX finder for the bundle, and in the OSX dock when the bundle is opened.
# Required.
##end
# #
# CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that ##variable
# will be run whenever an end-user double-clicks the generated bundle # CPACK_BUNDLE_STARTUP_COMMAND - Path to a startup script. This is a path to
# in the OSX Finder. Optional. # an executable or script that will be run whenever an end-user double-clicks
# the generated bundle in the OSX Finder. Optional.
##end
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.

@ -1,3 +1,6 @@
##section Variables concerning CPack Components
##end
##module
# - Build binary and source package installers # - Build binary and source package installers
# #
# The CPackComponent module is the module which handles # The CPackComponent module is the module which handles
@ -20,7 +23,54 @@
# components are identified by the COMPONENT argument of CMake's # components are identified by the COMPONENT argument of CMake's
# INSTALL commands, and should be further described by the following # INSTALL commands, and should be further described by the following
# CPack commands: # CPack commands:
# ##end
#
##variable
# CPACK_COMPONENTS_ALL - The list of component to install.
#
# The default value of this variable is computed by CPack
# and contains all components defined by the project. The
# user may set it to only include the specified components.
##end
#
##variable
# CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
# CPack generator <GENNAME>.
#
# Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
# default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
# One can change the default behavior by setting this variable to 0/1 or OFF/ON.
##end
##variable
# CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
# component-aware CPack generators.
#
# Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
# packages files when asked for component packaging. They group the component
# differently depending on the value of this variable:
# - ONE_PER_GROUP (default): creates one package file per component group
# - ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
# - IGNORE : creates one package per component, i.e. IGNORE component group
# One can specify different grouping for different CPack generator by using
# a CPACK_PROJECT_CONFIG_FILE.
##end
##variable
# CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
##end
##variable
# CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
##end
##variable
# CPACK_COMPONENT_<compName>_GROUP - The group of a component.
##end
##variable
# CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
# on which this component depends.
##end
##variable
# CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
##end
##macro
# cpack_add_component - Describes a CPack installation component # cpack_add_component - Describes a CPack installation component
# named by the COMPONENT argument to a CMake INSTALL command. # named by the COMPONENT argument to a CMake INSTALL command.
# #
@ -90,7 +140,9 @@
# create a file with some name based on CPACK_PACKAGE_FILE_NAME and # create a file with some name based on CPACK_PACKAGE_FILE_NAME and
# the name of the component. See cpack_configure_downloads for more # the name of the component. See cpack_configure_downloads for more
# information. # information.
##end
# #
##macro
# cpack_add_component_group - Describes a group of related CPack # cpack_add_component_group - Describes a group of related CPack
# installation components. # installation components.
# #
@ -134,7 +186,9 @@
# #
# BOLD_TITLE indicates that the group title should appear in bold, # BOLD_TITLE indicates that the group title should appear in bold,
# to call the user's attention to the group. # to call the user's attention to the group.
##end
# #
##macro
# cpack_add_install_type - Add a new installation type containing a # cpack_add_install_type - Add a new installation type containing a
# set of predefined component selections to the graphical installer. # set of predefined component selections to the graphical installer.
# #
@ -153,7 +207,9 @@
# DISPLAY_NAME is the displayed name of the install type, which will # DISPLAY_NAME is the displayed name of the install type, which will
# typically show up in a drop-down box within a graphical # typically show up in a drop-down box within a graphical
# installer. This value can be any string. # installer. This value can be any string.
##end
# #
##macro
# cpack_configure_downloads - Configure CPack to download selected # cpack_configure_downloads - Configure CPack to download selected
# components on-the-fly as part of the installation process. # components on-the-fly as part of the installation process.
# #
@ -203,6 +259,7 @@
# that can be called from Windows' Add/Remove Programs dialog (via the # that can be called from Windows' Add/Remove Programs dialog (via the
# "Modify" button) to change the set of installed components. NO_ADD_REMOVE # "Modify" button) to change the set of installed components. NO_ADD_REMOVE
# turns off this behavior. This option is ignored on Mac OS X. # turns off this behavior. This option is ignored on Mac OS X.
##endmacro
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.

@ -0,0 +1,33 @@
##section Variables specific to CPack Cygwin generator
##end
##module
# - Cygwin CPack generator (Cygwin).
# The following variable is specific to installers build on
# and/or for Cygwin:
##end
#
##variable
# CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
# FIXME: This documentation is incomplete.
##end
##variable
# CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
# FIXME: This documentation is incomplete.
##end
##variable
# CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
# FIXME: This documentation is incomplete.
##end
#=============================================================================
# Copyright 2006-2012 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.)

@ -0,0 +1,70 @@
##section Variables specific to CPack DragNDrop generator
##end
##module
# - DragNDrop CPack generator (Mac OS X).
# The following variables are specific to the DragNDrop installers
# built on Mac OS X:
##end
#
##variable
# CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
# image. Defaults to CPACK_PACKAGE_FILE_NAME.
##end
#
##variable
# CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
# (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
# bzip2-compressed). Refer to hdiutil(1) for more information on
# other available formats.
##end
#
##variable
# CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
# file e.g. can be used to specify the Finder window
# position/geometry and layout (such as hidden toolbars, placement of the
# icons etc.). This file has to be generated by the Finder (either manually or
# through OSA-script) using a normal folder from which the .DS_Store
# file can then be extracted.
##end
#
##variable
# CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
# file will be used as the background for the Finder Window when the disk
# image is opened. By default no background image is set. The background
# image is applied after applying the custom .DS_Store file.
##end
#
##variable
# CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
# operate on disk image files on Mac OS X. This variable can be used
# to override the automatically detected command (or specify its
# location if the auto-detection fails to find it.)
##end
#
##variable
# CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
# extended attributes on files and directories on Mac OS X. This
# variable can be used to override the automatically detected
# command (or specify its location if the auto-detection fails to
# find it.)
##end
#
##variable
# CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
# resources on Mac OS X. This variable can be used to override the
# automatically detected command (or specify its location if the
# auto-detection fails to find it.)
##end
#=============================================================================
# Copyright 2006-2012 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.)

@ -1,3 +1,6 @@
##section Variables specific to CPack Debian (DEB) generator
##end
##module
# - The builtin (binary) CPack Deb generator (Unix only) # - The builtin (binary) CPack Deb generator (Unix only)
# CPackDeb may be used to create Deb package using CPack. # CPackDeb may be used to create Deb package using CPack.
# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables # CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
@ -11,43 +14,63 @@
# the wiki: # the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
# However as a handy reminder here comes the list of specific variables: # However as a handy reminder here comes the list of specific variables:
##end
# #
##variable
# CPACK_DEBIAN_PACKAGE_NAME # CPACK_DEBIAN_PACKAGE_NAME
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_NAME (lower case) # Default : CPACK_PACKAGE_NAME (lower case)
# The debian package summary # The debian package summary
##end
##variable
# CPACK_DEBIAN_PACKAGE_VERSION # CPACK_DEBIAN_PACKAGE_VERSION
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_VERSION # Default : CPACK_PACKAGE_VERSION
# The debian package version # The debian package version
##end
##variable
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE # CPACK_DEBIAN_PACKAGE_ARCHITECTURE
# Mandatory : YES # Mandatory : YES
# Default : Output of dpkg --print-architecture (or i386 if dpkg is not found) # Default : Output of dpkg --print-architecture (or i386 if dpkg is not found)
# The debian package architecture # The debian package architecture
##end
##variable
# CPACK_DEBIAN_PACKAGE_DEPENDS # CPACK_DEBIAN_PACKAGE_DEPENDS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set deb dependencies. # May be used to set deb dependencies.
##end
##variable
# CPACK_DEBIAN_PACKAGE_MAINTAINER # CPACK_DEBIAN_PACKAGE_MAINTAINER
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_CONTACT # Default : CPACK_PACKAGE_CONTACT
# The debian package maintainer # The debian package maintainer
##end
##variable
# CPACK_DEBIAN_PACKAGE_DESCRIPTION # CPACK_DEBIAN_PACKAGE_DESCRIPTION
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY # Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
# The debian package description # The debian package description
##end
##variable
# CPACK_DEBIAN_PACKAGE_SECTION # CPACK_DEBIAN_PACKAGE_SECTION
# Mandatory : YES # Mandatory : YES
# Default : 'devel' # Default : 'devel'
# The debian package section # The debian package section
##end
##variable
# CPACK_DEBIAN_PACKAGE_PRIORITY # CPACK_DEBIAN_PACKAGE_PRIORITY
# Mandatory : YES # Mandatory : YES
# Default : 'optional' # Default : 'optional'
# The debian package priority # The debian package priority
##end
##variable
# CPACK_DEBIAN_PACKAGE_HOMEPAGE # CPACK_DEBIAN_PACKAGE_HOMEPAGE
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# The URL of the web site for this package # The URL of the web site for this package
##end
##variable
# CPACK_DEBIAN_PACKAGE_SHLIBDEPS # CPACK_DEBIAN_PACKAGE_SHLIBDEPS
# Mandatory : NO # Mandatory : NO
# Default : OFF # Default : OFF
@ -57,11 +80,15 @@
# if you use this feature, because if you don't dpkg-shlibdeps # if you use this feature, because if you don't dpkg-shlibdeps
# may fail to find your own shared libs. # may fail to find your own shared libs.
# See http://www.cmake.org/Wiki/CMake_RPATH_handling. # See http://www.cmake.org/Wiki/CMake_RPATH_handling.
##end
##variable
# CPACK_DEBIAN_PACKAGE_DEBUG # CPACK_DEBIAN_PACKAGE_DEBUG
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be set when invoking cpack in order to trace debug information # May be set when invoking cpack in order to trace debug information
# during CPackDeb run. # during CPackDeb run.
##end
##variable
# CPACK_DEBIAN_PACKAGE_PREDEPENDS # CPACK_DEBIAN_PACKAGE_PREDEPENDS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
@ -69,12 +96,16 @@
# This field is like Depends, except that it also forces dpkg to complete installation of # This field is like Depends, except that it also forces dpkg to complete installation of
# the packages named before even starting the installation of the package which declares # the packages named before even starting the installation of the package which declares
# the pre-dependency. # the pre-dependency.
##end
##variable
# CPACK_DEBIAN_PACKAGE_ENHANCES # CPACK_DEBIAN_PACKAGE_ENHANCES
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# This field is similar to Suggests but works in the opposite direction. # This field is similar to Suggests but works in the opposite direction.
# It is used to declare that a package can enhance the functionality of another package. # It is used to declare that a package can enhance the functionality of another package.
##end
##variable
# CPACK_DEBIAN_PACKAGE_BREAKS # CPACK_DEBIAN_PACKAGE_BREAKS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
@ -82,23 +113,30 @@
# When one binary package declares that it breaks another, dpkg will refuse to allow the # When one binary package declares that it breaks another, dpkg will refuse to allow the
# package which declares Breaks be installed unless the broken package is deconfigured first, # package which declares Breaks be installed unless the broken package is deconfigured first,
# and it will refuse to allow the broken package to be reconfigured. # and it will refuse to allow the broken package to be reconfigured.
##end
##variable
# CPACK_DEBIAN_PACKAGE_CONFLICTS # CPACK_DEBIAN_PACKAGE_CONFLICTS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# When one binary package declares a conflict with another using a Conflicts field, # When one binary package declares a conflict with another using a Conflicts field,
# dpkg will refuse to allow them to be installed on the system at the same time. # dpkg will refuse to allow them to be installed on the system at the same time.
##end
##variable
# CPACK_DEBIAN_PACKAGE_PROVIDES # CPACK_DEBIAN_PACKAGE_PROVIDES
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# A virtual package is one which appears in the Provides control field of another package. # A virtual package is one which appears in the Provides control field of another package.
##end
##variable
# CPACK_DEBIAN_PACKAGE_REPLACES # CPACK_DEBIAN_PACKAGE_REPLACES
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# Packages can declare in their control file that they should overwrite # Packages can declare in their control file that they should overwrite
# files in certain other packages, or completely replace other packages. # files in certain other packages, or completely replace other packages.
##end
#============================================================================= #=============================================================================
# Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2009 Kitware, Inc.

@ -1,70 +1,118 @@
##section Variables specific to CPack NSIS generator
##end
##module
# - CPack NSIS generator specific options # - CPack NSIS generator specific options
# #
# The following variables are specific to the graphical installers built # The following variables are specific to the graphical installers built
# on Windows using the Nullsoft Installation System. # on Windows using the Nullsoft Installation System.
##end
# #
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when ##variable
# installing this project.
#
# CPACK_NSIS_INSTALL_ROOT - The default installation directory presented # CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
# to the end user by the NSIS installer is under this root dir. The full # to the end user by the NSIS installer is under this root dir. The full
# directory presented to the end user is: # directory presented to the end user is:
# ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY} # ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
##end
# #
# CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated ##variable
# CPACK_NSIS_MUI_ICON - An icon filename.
# The name of a *.ico file used as the main icon for the generated
# install program. # install program.
##end
# #
# CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated ##variable
# CPACK_NSIS_MUI_UNIICON - An icon filename.
# The name of a *.ico file used as the main icon for the generated
# uninstall program. # uninstall program.
##end
# #
# CPACK_PACKAGE_ICON - A branding image that will be displayed inside ##variable
# the installer. # CPACK_NSIS_INSTALLER_MUI_ICON_CODE - undocumented.
##end
# #
##variable
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will # CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
# be added to the install Section. # be added to the install Section.
##end
# #
##variable
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will # CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
# be added to the uninstall Section. # be added to the uninstall Section.
##end
# #
##variable
# CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the # CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
# NSIS SetCompressor command. # NSIS SetCompressor command.
##end
# #
# CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page ##variable
# CPACK_NSIS_MODIFY_PATH - Modify PATH toggle.
# If this is set to "ON", then an extra page
# will appear in the installer that will allow the user to choose # will appear in the installer that will allow the user to choose
# whether the program directory should be added to the system PATH # whether the program directory should be added to the system PATH
# variable. # variable.
##end
# #
##variable
# CPACK_NSIS_DISPLAY_NAME - The display name string that appears in # CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
# the Windows Add/Remove Program control panel # the Windows Add/Remove Program control panel
##end
# #
##variable
# CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the # CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
# installer. # installer.
##end
# #
##variable
# CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that # CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
# contains the installer icon. # contains the installer icon.
##end
# #
##variable
# CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in # CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
# installing your application. # installing your application.
##end
# #
##variable
# CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more # CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
# information about your application. # information about your application.
##end
# #
##variable
# CPACK_NSIS_CONTACT - Contact information for questions and comments # CPACK_NSIS_CONTACT - Contact information for questions and comments
# about the installation process. # about the installation process.
##end
# #
##variable
# CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for # CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
# creating start menu shortcuts. # creating start menu shortcuts.
##end
# #
##variable
# CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to # CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
# uninstall start menu shortcuts. # uninstall start menu shortcuts.
##end
# #
##variable
# CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links # CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
# assumes that they are in 'bin' unless this variable is set. # assumes that they are in 'bin' unless this variable is set.
# For example, you would set this to 'exec' if your executables are # For example, you would set this to 'exec' if your executables are
# in an exec directory. # in an exec directory.
##end
# #
##variable
# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option # CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
# to run on the finish page of the NSIS installer. # to run on the finish page of the NSIS installer.
##end
##variable
# CPACK_NSIS_MENU_LINKS - Specify links in [application] menu.
# This should contain a list of pair "link" "link name". The link
# may be an URL or a path relative to installation prefix.
# Like:
# set(CPACK_NSIS_MENU_LINKS
# "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
# "http://www.cmake.org" "CMake Web Site")
##end
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.

@ -0,0 +1,35 @@
##section Variables specific to CPack PackageMaker generator
##end
##module
# - PackageMaker CPack generator (Mac OS X).
# The following variable is specific to installers build on Mac OS X
# using PackageMaker:
##end
#
##variable
# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
# resulting PackageMaker archive should be compatible with. Different
# versions of Mac OS X support different
# features. For example, CPack can only build component-based
# installers for Mac OS X 10.4 or newer, and can only build
# installers that download component son-the-fly for Mac OS X 10.5
# or newer. If left blank, this value will be set to the minimum
# version of Mac OS X that supports the requested features. Set this
# variable to some value (e.g., 10.4) only if you want to guarantee
# that your installer will work on that version of Mac OS X, and
# don't mind missing extra features available in the installer
# shipping with later versions of Mac OS X.
##end
#=============================================================================
# Copyright 2006-2012 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.)

@ -1,3 +1,6 @@
##section Variables specific to CPack RPM generator
##end
##module
# - The builtin (binary) CPack RPM generator (Unix only) # - The builtin (binary) CPack RPM generator (Unix only)
# CPackRPM may be used to create RPM package using CPack. # CPackRPM may be used to create RPM package using CPack.
# CPackRPM is a CPack generator thus it uses the CPACK_XXX variables # CPackRPM is a CPack generator thus it uses the CPACK_XXX variables
@ -15,52 +18,67 @@
# You'll find a detailed usage of CPackRPM on the wiki: # You'll find a detailed usage of CPackRPM on the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
# However as a handy reminder here comes the list of specific variables: # However as a handy reminder here comes the list of specific variables:
##end
# #
# CPACK_RPM_PACKAGE_SUMMARY ##variable
# CPACK_RPM_PACKAGE_SUMMARY - The RPM package summary.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY # Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
# The RPM package summary ##end
# CPACK_RPM_PACKAGE_NAME ##variable
# CPACK_RPM_PACKAGE_NAME - The RPM package name.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_NAME # Default : CPACK_PACKAGE_NAME
# The RPM package name ##end
# CPACK_RPM_PACKAGE_VERSION ##variable
# CPACK_RPM_PACKAGE_VERSION - The RPM package version.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_VERSION # Default : CPACK_PACKAGE_VERSION
# The RPM package version ##end
# CPACK_RPM_PACKAGE_ARCHITECTURE ##variable
# CPACK_RPM_PACKAGE_ARCHITECTURE - The RPM package architecture.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# The RPM package architecture. This may be set to "noarch" if you # This may be set to "noarch" if you
# know you are building a noarch package. # know you are building a noarch package.
# CPACK_RPM_PACKAGE_RELEASE ##end
##variable
# CPACK_RPM_PACKAGE_RELEASE - The RPM package release.
# Mandatory : YES # Mandatory : YES
# Default : 1 # Default : 1
# The RPM package release. This is the numbering of the RPM package # This is the numbering of the RPM package
# itself, i.e. the version of the packaging and not the version of the # itself, i.e. the version of the packaging and not the version of the
# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default # content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
# value if the previous packaging was buggy and/or you want to put here # value if the previous packaging was buggy and/or you want to put here
# a fancy Linux distro specific numbering. # a fancy Linux distro specific numbering.
# CPACK_RPM_PACKAGE_LICENSE ##end
##variable
# CPACK_RPM_PACKAGE_LICENSE - The RPM package license policy.
# Mandatory : YES # Mandatory : YES
# Default : "unknown" # Default : "unknown"
# The RPM package license policy. ##end
# CPACK_RPM_PACKAGE_GROUP ##variable
# CPACK_RPM_PACKAGE_GROUP - The RPM package group.
# Mandatory : YES # Mandatory : YES
# Default : "unknown" # Default : "unknown"
# The RPM package group. ##end
# CPACK_RPM_PACKAGE_VENDOR ##variable
# CPACK_RPM_PACKAGE_VENDOR - The RPM package vendor.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_VENDOR if set or "unknown" # Default : CPACK_PACKAGE_VENDOR if set or "unknown"
# The RPM package vendor. ##end
# CPACK_RPM_PACKAGE_URL ##variable
# CPACK_RPM_PACKAGE_URL - The projects URL.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# The projects URL. ##end
# CPACK_RPM_PACKAGE_DESCRIPTION ##variable
# CPACK_RPM_PACKAGE_DESCRIPTION - RPM package description.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available" # Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
# CPACK_RPM_COMPRESSION_TYPE ##end
##variable
# CPACK_RPM_COMPRESSION_TYPE - RPM compression type.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to override RPM compression type to be used # May be used to override RPM compression type to be used
@ -68,7 +86,9 @@
# to lzma or xz compression whereas older cannot use such RPM. # to lzma or xz compression whereas older cannot use such RPM.
# Using this one can enforce compression type to be used. # Using this one can enforce compression type to be used.
# Possible value are: lzma, xz, bzip2 and gzip. # Possible value are: lzma, xz, bzip2 and gzip.
# CPACK_RPM_PACKAGE_REQUIRES ##end
##variable
# CPACK_RPM_PACKAGE_REQUIRES - RPM spec requires field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set RPM dependencies (requires). # May be used to set RPM dependencies (requires).
@ -77,22 +97,30 @@
# set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8") # set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
# The required package list of an RPM file could be printed with # The required package list of an RPM file could be printed with
# rpm -qp --requires file.rpm # rpm -qp --requires file.rpm
# CPACK_RPM_PACKAGE_SUGGESTS ##end
##variable
# CPACK_RPM_PACKAGE_SUGGESTS - RPM spec suggest field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set weak RPM dependencies (suggests). # May be used to set weak RPM dependencies (suggests).
# Note that you must enclose the complete requires string between quotes. # Note that you must enclose the complete requires string between quotes.
# CPACK_RPM_PACKAGE_PROVIDES ##end
##variable
# CPACK_RPM_PACKAGE_PROVIDES - RPM spec provides field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set RPM dependencies (provides). # May be used to set RPM dependencies (provides).
# The provided package list of an RPM file could be printed with # The provided package list of an RPM file could be printed with
# rpm -qp --provides file.rpm # rpm -qp --provides file.rpm
# CPACK_RPM_PACKAGE_OBSOLETES ##end
##variable
# CPACK_RPM_PACKAGE_OBSOLETES - RPM spec obsoletes field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set RPM packages that are obsoleted by this one. # May be used to set RPM packages that are obsoleted by this one.
# CPACK_RPM_PACKAGE_RELOCATABLE ##end
##variable
# CPACK_RPM_PACKAGE_RELOCATABLE - build a relocatable RPM.
# Mandatory : NO # Mandatory : NO
# Default : CPACK_PACKAGE_RELOCATABLE # Default : CPACK_PACKAGE_RELOCATABLE
# If this variable is set to TRUE or ON CPackRPM will try # If this variable is set to TRUE or ON CPackRPM will try
@ -103,7 +131,9 @@
# If CPACK_SET_DESTDIR is set then you will get a warning message # If CPACK_SET_DESTDIR is set then you will get a warning message
# but if there is file installed with absolute path you'll get # but if there is file installed with absolute path you'll get
# unexpected behavior. # unexpected behavior.
# CPACK_RPM_SPEC_INSTALL_POST [deprecated] ##end
##variable
# CPACK_RPM_SPEC_INSTALL_POST - [deprecated].
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# This way of specifying post-install script is deprecated use # This way of specifying post-install script is deprecated use
@ -111,23 +141,31 @@
# May be used to set an RPM post-install command inside the spec file. # May be used to set an RPM post-install command inside the spec file.
# For example setting it to "/bin/true" may be used to prevent # For example setting it to "/bin/true" may be used to prevent
# rpmbuild to strip binaries. # rpmbuild to strip binaries.
# CPACK_RPM_SPEC_MORE_DEFINE ##end
##variable
# CPACK_RPM_SPEC_MORE_DEFINE - RPM extended spec definitions lines.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to add any %define lines to the generated spec file. # May be used to add any %define lines to the generated spec file.
# CPACK_RPM_PACKAGE_DEBUG ##end
##variable
# CPACK_RPM_PACKAGE_DEBUG - Toggle CPackRPM debug output.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be set when invoking cpack in order to trace debug information # May be set when invoking cpack in order to trace debug information
# during CPack RPM run. For example you may launch CPack like this # during CPack RPM run. For example you may launch CPack like this
# cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM # cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
# CPACK_RPM_USER_BINARY_SPECFILE ##end
##variable
# CPACK_RPM_USER_BINARY_SPECFILE - A user provided spec file.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be set by the user in order to specify a USER binary spec file # May be set by the user in order to specify a USER binary spec file
# to be used by CPackRPM instead of generating the file. # to be used by CPackRPM instead of generating the file.
# The specified file will be processed by CONFIGURE_FILE( @ONLY). # The specified file will be processed by CONFIGURE_FILE( @ONLY).
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE ##end
##variable
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# If set CPack will generate a template for USER specified binary # If set CPack will generate a template for USER specified binary
@ -135,6 +173,8 @@
# cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM # cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
# The user may then use this file in order to hand-craft is own # The user may then use this file in order to hand-craft is own
# binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE. # binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE.
##end
##variable
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE # CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
# Mandatory : NO # Mandatory : NO
@ -143,11 +183,13 @@
# The refered script file(s) will be read and directly # The refered script file(s) will be read and directly
# put after the %pre or %preun section # put after the %pre or %preun section
# If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for # If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
# each component can be overriden with # each component can be overridden with
# CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE and # CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE and
# CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE # CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE
# One may verify which scriptlet has been included with # One may verify which scriptlet has been included with
# rpm -qp --scripts package.rpm # rpm -qp --scripts package.rpm
##end
##variable
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE # CPACK_RPM_POST_INSTALL_SCRIPT_FILE
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
# Mandatory : NO # Mandatory : NO
@ -156,26 +198,31 @@
# The refered script file(s) will be read and directly # The refered script file(s) will be read and directly
# put after the %post or %postun section # put after the %post or %postun section
# If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for # If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
# each component can be overriden with # each component can be overridden with
# CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE and # CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE and
# CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE # CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE
# One may verify which scriptlet has been included with # One may verify which scriptlet has been included with
# rpm -qp --scripts package.rpm # rpm -qp --scripts package.rpm
##end
##variable
# CPACK_RPM_USER_FILELIST # CPACK_RPM_USER_FILELIST
# CPACK_RPM_<COMPONENT>_USER_FILELIST # CPACK_RPM_<COMPONENT>_USER_FILELIST
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to explicitely specify %(<directive>) file line # May be used to explicitly specify %(<directive>) file line
# in the spec file. Like %config(noreplace) or any other directive # in the spec file. Like %config(noreplace) or any other directive
# that be found in the %files section. Since CPackRPM is generating # that be found in the %files section. Since CPackRPM is generating
# the list of files (and directories) the user specified files of # the list of files (and directories) the user specified files of
# the CPACK_RPM_<COMPONENT>_USER_FILELIST list will be removed from the generated list. # the CPACK_RPM_<COMPONENT>_USER_FILELIST list will be removed from the generated list.
# CPACK_RPM_CHANGELOG_FILE ##end
##variable
# CPACK_RPM_CHANGELOG_FILE - RPM changelog file.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to embed a changelog in the spec file. # May be used to embed a changelog in the spec file.
# The refered file will be read and directly put after the %changelog # The refered file will be read and directly put after the %changelog
# section. # section.
##end
#============================================================================= #=============================================================================
# Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2009 Kitware, Inc.
@ -714,6 +761,25 @@ else()
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
# Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir
# This is necessary to avoid duplicate files since rpmbuild do
# recursion on its own when encountering a pathname which is a directory
# which is not flagged as %dir
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
string(REPLACE "\n" ";" CPACK_RPM_INSTALL_FILES_LIST
"${CPACK_RPM_INSTALL_FILES_LIST}")
string(REPLACE "\"" "" CPACK_RPM_INSTALL_FILES_LIST
"${CPACK_RPM_INSTALL_FILES_LIST}")
set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
if(IS_DIRECTORY "${WDIR}/${F}")
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}%dir \"${F}\"\n")
else()
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endif()
endforeach(F)
set(CPACK_RPM_INSTALL_FILES_LIST "")
# The name of the final spec file to be used by rpmbuild # The name of the final spec file to be used by rpmbuild
SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec") SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
@ -833,6 +899,7 @@ IF(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE # Now call rpmbuild using the SPECFILE
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND "${RPMBUILD_EXECUTABLE}" -bb COMMAND "${RPMBUILD_EXECUTABLE}" -bb
--define "_topdir ${CPACK_RPM_DIRECTORY}"
--buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
"${CPACK_RPM_BINARY_SPECFILE}" "${CPACK_RPM_BINARY_SPECFILE}"
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"

@ -69,7 +69,7 @@ IF(NOT _CTEST_TARGETS_ADDED)
ENDFOREACH(mode) ENDFOREACH(mode)
# For Makefile generators add more granular targets. # For Makefile generators add more granular targets.
IF("${CMAKE_GENERATOR}" MATCHES Make) IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
# Make targets for Experimental builds # Make targets for Experimental builds
FOREACH(mode Nightly Experimental Continuous) FOREACH(mode Nightly Experimental Continuous)
FOREACH(testtype FOREACH(testtype
@ -83,7 +83,7 @@ IF(NOT _CTEST_TARGETS_ADDED)
SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
ENDFOREACH(testtype) ENDFOREACH(testtype)
ENDFOREACH(mode) ENDFOREACH(mode)
ENDIF("${CMAKE_GENERATOR}" MATCHES Make) ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
# If requested, add an alias that is the equivalent of the built-in "test" # If requested, add an alias that is the equivalent of the built-in "test"
# or "RUN_TESTS" target: # or "RUN_TESTS" target:

@ -7,8 +7,9 @@
# that can modify the build. # that can modify the build.
#============================================================================= #=============================================================================
# Copyright 2006-2010 Kitware, Inc. # Copyright 2006-2011 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2011 Matthias Kretz <kretz@kde.org>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -27,15 +28,16 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT} CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
# Some compilers do not fail with a bad flag # Some compilers do not fail with a bad flag
FAIL_REGEX "warning: command line option .* is valid for .* but not for C" FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
# Apple gcc
FAIL_REGEX "unrecognized .*option" # GNU FAIL_REGEX "unrecognized .*option" # GNU
FAIL_REGEX "unknown .*option" # Clang FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "ignoring unknown option" # MSVC
FAIL_REGEX "warning D9002" # MSVC, any lang FAIL_REGEX "warning D9002" # MSVC, any lang
FAIL_REGEX "option .*not supported" # Intel
FAIL_REGEX "[Uu]nknown option" # HP FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "WARNING: unknown flag:" # Open64
) )
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_C_COMPILER_FLAG) ENDMACRO (CHECK_C_COMPILER_FLAG)

@ -24,6 +24,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR) MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(_FAIL_REGEX) SET(_FAIL_REGEX)
@ -40,8 +43,10 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

@ -24,13 +24,18 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR) MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

@ -9,6 +9,7 @@
#============================================================================= #=============================================================================
# Copyright 2006-2010 Kitware, Inc. # Copyright 2006-2010 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2011 Matthias Kretz <kretz@kde.org>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -27,15 +28,18 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT} CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
# Some compilers do not fail with a bad flag # Some compilers do not fail with a bad flag
FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
FAIL_REGEX "unrecognized .*option" # GNU FAIL_REGEX "unrecognized .*option" # GNU
FAIL_REGEX "unknown .*option" # Clang FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "ignoring unknown option" # MSVC
FAIL_REGEX "warning D9002" # MSVC, any lang FAIL_REGEX "warning D9002" # MSVC, any lang
FAIL_REGEX "option .*not supported" # Intel
FAIL_REGEX "[Uu]nknown option" # HP FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "not supported in this configuration; ignored" # AIX FAIL_REGEX "not supported in this configuration; ignored" # AIX
FAIL_REGEX "File with unknown suffix passed to linker" # PGI FAIL_REGEX "File with unknown suffix passed to linker" # PGI
FAIL_REGEX "WARNING: unknown flag:" # Open64
) )
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_CXX_COMPILER_FLAG) ENDMACRO (CHECK_CXX_COMPILER_FLAG)

@ -24,6 +24,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(_FAIL_REGEX) SET(_FAIL_REGEX)
@ -41,8 +44,10 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

@ -24,13 +24,18 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR) MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

@ -22,12 +22,17 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
if(NOT DEFINED ${VARIABLE}) if(NOT DEFINED ${VARIABLE})
message(STATUS "Looking for Fortran ${FUNCTION}") message(STATUS "Looking for Fortran ${FUNCTION}")
if(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES)

@ -27,14 +27,19 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$") IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
MESSAGE(STATUS "Looking for ${FUNCTION}") MESSAGE(STATUS "Looking for ${FUNCTION}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

@ -13,7 +13,7 @@
# CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_INCLUDES = list of include directories
#============================================================================= #=============================================================================
# Copyright 2003-2009 Kitware, Inc. # Copyright 2003-2012 Kitware, Inc.
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -44,7 +44,17 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE) "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE)
MESSAGE(STATUS "Looking for include files ${VARIABLE}") SET(_INCLUDE ${INCLUDE}) # remove empty elements
IF("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
LIST(LENGTH _INCLUDE _INCLUDE_LEN)
SET(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
ELSEIF("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
SET(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
ELSE()
SET(_description "include file ${_INCLUDE}")
ENDIF()
MESSAGE(STATUS "Looking for ${_description}")
TRY_COMPILE(${VARIABLE} TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
@ -54,15 +64,15 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE}) IF(${VARIABLE})
MESSAGE(STATUS "Looking for include files ${VARIABLE} - found") MESSAGE(STATUS "Looking for ${_description} - found")
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${VARIABLE}") SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist passed with the following output:\n" "exist passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
ELSE(${VARIABLE}) ELSE(${VARIABLE})
MESSAGE(STATUS "Looking for include files ${VARIABLE} - not found.") MESSAGE(STATUS "Looking for ${_description} - not found.")
SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${VARIABLE}") SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist failed with the following output:\n" "exist failed with the following output:\n"

@ -0,0 +1,65 @@
# - Check if a language can be enabled
# Usage:
# check_language(<lang>)
# where <lang> is a language that may be passed to enable_language()
# such as "Fortran". If CMAKE_<lang>_COMPILER is already defined the
# check does nothing. Otherwise it tries enabling the language in a
# test project. The result is cached in CMAKE_<lang>_COMPILER as the
# compiler that was found, or NOTFOUND if the language cannot be enabled.
#
# Example:
# check_language(Fortran)
# if(CMAKE_Fortran_COMPILER)
# enable_language(Fortran)
# else()
# message(STATUS "No Fortran support")
# endif()
#=============================================================================
# Copyright 2009-2012 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.)
macro(check_language lang)
if(NOT DEFINED CMAKE_${lang}_COMPILER)
set(_desc "Looking for a ${lang} compiler")
message(STATUS ${_desc})
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang})
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/CMakeLists.txt"
"cmake_minimum_required(VERSION 2.8)
project(Check${lang} ${lang})
file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
\"set(CMAKE_${lang}_COMPILER \\\"\${CMAKE_${lang}_COMPILER}\\\")\\n\"
)
")
execute_process(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}
COMMAND ${CMAKE_COMMAND} . -G ${CMAKE_GENERATOR}
OUTPUT_VARIABLE output
ERROR_VARIABLE output
RESULT_VARIABLE result
)
include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/result.cmake OPTIONAL)
if(CMAKE_${lang}_COMPILER AND "${result}" STREQUAL "0")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"${_desc} passed with the following output:\n"
"${output}\n")
else()
set(CMAKE_${lang}_COMPILER NOTFOUND)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${_desc} failed with the following output:\n"
"${output}\n")
endif()
message(STATUS "${_desc} - ${CMAKE_${lang}_COMPILER}")
set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE FILEPATH "${lang} compiler")
mark_as_advanced(CMAKE_${lang}_COMPILER)
endif()
endmacro()

@ -26,6 +26,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$") IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
@ -33,8 +36,10 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY}) SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_LIBRARY_EXISTS_LIBRARIES SET(CHECK_LIBRARY_EXISTS_LIBRARIES
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES}) ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES})
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_COMPILE(${VARIABLE} TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}

@ -34,8 +34,11 @@
# License text for the above reference.) # License text for the above reference.)
# #
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE) function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$") if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
@ -43,8 +46,10 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
if (CMAKE_REQUIRED_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_PROTOTYPE_DEFINITION_LIBS set(CHECK_PROTOTYPE_DEFINITION_LIBS
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_PROTOTYPE_DEFINITION_LIBS) set(CHECK_PROTOTYPE_DEFINITION_LIBS)
endif(CMAKE_REQUIRED_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES)

@ -35,6 +35,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
ENDMACRO(CHECK_SYMBOL_EXISTS) ENDMACRO(CHECK_SYMBOL_EXISTS)
@ -44,8 +47,10 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_SYMBOL_EXISTS_LIBS SET(CHECK_SYMBOL_EXISTS_LIBS
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_SYMBOL_EXISTS_LIBS) SET(CHECK_SYMBOL_EXISTS_LIBS)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)
@ -60,7 +65,7 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
ENDFOREACH(FILE) ENDFOREACH(FILE)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT SET(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n#ifndef ${SYMBOL}\n cmakeRequireSymbol(0,&${SYMBOL});\n#endif\n return 0;\n}\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n")
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${SOURCEFILE}" @ONLY IMMEDIATE) "${SOURCEFILE}" @ONLY IMMEDIATE)

@ -47,6 +47,7 @@
# License text for the above reference.) # License text for the above reference.)
include(CheckIncludeFile) include(CheckIncludeFile)
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
cmake_policy(PUSH) cmake_policy(PUSH)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR) cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
@ -76,6 +77,10 @@ function(__check_type_size_impl type var map builtin)
endforeach() endforeach()
# Perform the check. # Perform the check.
# this one translates potentially used imported library targets to their files on disk
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c) set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin) set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY) configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
@ -84,7 +89,7 @@ function(__check_type_size_impl type var map builtin)
CMAKE_FLAGS CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}" "-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}"
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}" "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}"
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE output OUTPUT_VARIABLE output
COPY_FILE ${bin} COPY_FILE ${bin}
) )

@ -26,14 +26,19 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE) MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$") IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_VARIABLE_DEFINITIONS SET(MACRO_CHECK_VARIABLE_DEFINITIONS
"-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}") "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
MESSAGE(STATUS "Looking for ${VAR}") MESSAGE(STATUS "Looking for ${VAR}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES) SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

@ -24,6 +24,18 @@ macro(__compiler_gnu lang)
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
# Older versions of gcc (< 4.5) contain a bug causing them to report a missing
# header file as a warning if depfiles are enabled, causing check_header_file
# tests to always succeed. Work around this by disabling dependency tracking
# in try_compile mode.
GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES)
# distcc does not transform -o to -MT when invoking the preprocessor
# internally, as it ought to. Work around this bug by setting -MT here
# even though it isn't strictly necessary.
set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MT <OBJECT> -MF <DEPFILE>")
endif()
# Initial configuration flags. # Initial configuration flags.
set(CMAKE_${lang}_FLAGS_INIT "") set(CMAKE_${lang}_FLAGS_INIT "")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")

@ -82,6 +82,7 @@
include(BundleUtilities) include(BundleUtilities)
set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}") set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
set(DeployQt4_apple_plugins_dir "PlugIns")
function(write_qt4_conf qt_conf_dir qt_conf_contents) function(write_qt4_conf qt_conf_dir qt_conf_contents)
set(qt_conf_path "${qt_conf_dir}/qt.conf") set(qt_conf_path "${qt_conf_dir}/qt.conf")
@ -125,11 +126,17 @@ function(fixup_qt4_executable executable)
if(QT_LIBRARY_DIR) if(QT_LIBRARY_DIR)
list(APPEND dirs "${QT_LIBRARY_DIR}") list(APPEND dirs "${QT_LIBRARY_DIR}")
endif() endif()
if(QT_BINARY_DIR)
list(APPEND dirs "${QT_BINARY_DIR}")
endif()
if(APPLE) if(APPLE)
set(qt_conf_dir "${executable}/Contents/Resources") set(qt_conf_dir "${executable}/Contents/Resources")
set(executable_path "${executable}") set(executable_path "${executable}")
set(write_qt_conf TRUE) set(write_qt_conf TRUE)
if(NOT plugins_dir)
set(plugins_dir "${DeployQt4_apple_plugins_dir}")
endif()
else() else()
get_filename_component(executable_path "${executable}" PATH) get_filename_component(executable_path "${executable}" PATH)
if(NOT executable_path) if(NOT executable_path)
@ -141,7 +148,7 @@ function(fixup_qt4_executable executable)
foreach(plugin ${qtplugins}) foreach(plugin ${qtplugins})
set(installed_plugin_path "") set(installed_plugin_path "")
install_qt4_plugin("${plugin}" "${plugins_dir}" "${executable}" 1 installed_plugin_path) install_qt4_plugin("${plugin}" "${executable}" 1 installed_plugin_path)
list(APPEND libs ${installed_plugin_path}) list(APPEND libs ${installed_plugin_path})
endforeach() endforeach()
@ -166,23 +173,19 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va
set(component ${ARGV5}) set(component ${ARGV5})
set(configurations ${ARGV6}) set(configurations ${ARGV6})
if(EXISTS "${plugin}") if(EXISTS "${plugin}")
if(plugins_dir)
set(plugins_dir "${plugins_dir}")
else()
if(APPLE) if(APPLE)
set(plugins_dir "PlugIns") if(NOT plugins_dir)
else() set(plugins_dir "${DeployQt4_apple_plugins_dir}")
set(plugins_dir "plugins")
endif()
endif() endif()
if(APPLE)
set(plugins_path "${executable}/Contents/${plugins_dir}") set(plugins_path "${executable}/Contents/${plugins_dir}")
else() else()
get_filename_component(executable_path "${executable}" PATH) get_filename_component(plugins_path "${executable}" PATH)
if(NOT executable_path) if(NOT plugins_path)
set(executable_path ".") set(plugins_path ".")
endif()
if(plugins_dir)
set(plugins_path "${plugins_path}/${plugins_dir}")
endif() endif()
set(plugins_path "${executable_path}/${plugins_dir}")
endif() endif()
set(plugin_group "") set(plugin_group "")
@ -210,7 +213,7 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va
endif() endif()
install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component}) install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component})
endif() endif()
set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE) set(${installed_plugin_path_var} "${plugins_path}/${plugin_name}" PARENT_SCOPE)
endif() endif()
endfunction() endfunction()
@ -219,12 +222,8 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
set(component ${ARGV5}) set(component ${ARGV5})
if(EXISTS "${plugin}") if(EXISTS "${plugin}")
install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") 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() else()
string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
endif()
set(plugin_release_var "${plugin_var}_RELEASE") set(plugin_release_var "${plugin_var}_RELEASE")
set(plugin_debug_var "${plugin_var}_DEBUG") set(plugin_debug_var "${plugin_var}_DEBUG")
set(plugin_release "${${plugin_release_var}}") set(plugin_release "${${plugin_release_var}}")
@ -232,10 +231,24 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") 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.") message(WARNING "Qt plugin \"${plugin}\" not recognized or found.")
endif() endif()
install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") if(NOT EXISTS "${${plugin_debug_var}}")
install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Debug") set(plugin_debug "${plugin_release}")
endif()
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}_release" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel")
install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}_debug" "${plugins_dir}" "${component}" "Debug")
if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
set(${installed_plugin_path_var} ${${installed_plugin_path_var}_debug})
else()
set(${installed_plugin_path_var} ${${installed_plugin_path_var}_release})
endif()
else()
install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}")
endif()
endif() endif()
set(installed_plugin_path_var "${installed_plugin_path_var}" PARENT_SCOPE) set(${installed_plugin_path_var} ${${installed_plugin_path_var}} PARENT_SCOPE)
endfunction() endfunction()
function(install_qt4_executable executable) function(install_qt4_executable executable)
@ -248,6 +261,9 @@ function(install_qt4_executable executable)
if(QT_LIBRARY_DIR) if(QT_LIBRARY_DIR)
list(APPEND dirs "${QT_LIBRARY_DIR}") list(APPEND dirs "${QT_LIBRARY_DIR}")
endif() endif()
if(QT_BINARY_DIR)
list(APPEND dirs "${QT_BINARY_DIR}")
endif()
if(component) if(component)
set(component COMPONENT ${component}) set(component COMPONENT ${component})
else() else()
@ -264,15 +280,15 @@ function(install_qt4_executable executable)
set(qt_plugins_dir "") set(qt_plugins_dir "")
endif() endif()
if(NOT qtplugins AND QT_LIBRARIES_PLUGINS) if(QT_IS_STATIC)
set(qtplugins "${QT_LIBRARIES_PLUGINS}") message(WARNING "Qt built statically: not installing plugins.")
endif() else()
foreach(plugin ${qtplugins}) foreach(plugin ${qtplugins})
set(installed_plugin_paths "") set(installed_plugin_paths "")
install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}") install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}")
list(APPEND libs ${installed_plugin_paths}) list(APPEND libs ${installed_plugin_paths})
endforeach() endforeach()
endif()
resolve_qt4_paths(libs) resolve_qt4_paths(libs)

@ -144,7 +144,7 @@
# set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) # set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
#============================================================================= #=============================================================================
# Copyright 2008-2009 Kitware, Inc. # Copyright 2008-2012 Kitware, Inc.
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -833,6 +833,12 @@ function(ExternalProject_Add_StepTargets name)
foreach(step ${steps}) foreach(step ${steps})
add_custom_target(${name}-${step} add_custom_target(${name}-${step}
DEPENDS ${stamp_dir}${cfgdir}/${name}-${step}) DEPENDS ${stamp_dir}${cfgdir}/${name}-${step})
# Depend on other external projects (target-level).
get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
foreach(arg IN LISTS deps)
add_dependencies(${name}-${step} ${arg})
endforeach()
endforeach() endforeach()
endfunction(ExternalProject_Add_StepTargets) endfunction(ExternalProject_Add_StepTargets)
@ -954,6 +960,7 @@ function(_ep_get_git_version git_EXECUTABLE git_version_var)
execute_process( execute_process(
COMMAND "${git_EXECUTABLE}" --version COMMAND "${git_EXECUTABLE}" --version
OUTPUT_VARIABLE ov OUTPUT_VARIABLE ov
ERROR_VARIABLE ev
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}") string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}")
@ -1450,9 +1457,18 @@ function(ExternalProject_Add name)
# depends on the 'done' mark so that it rebuilds when this project # depends on the 'done' mark so that it rebuilds when this project
# rebuilds. It is important that 'done' is not the output of any # rebuilds. It is important that 'done' is not the output of any
# custom command so that CMake does not propagate build rules to # custom command so that CMake does not propagate build rules to
# other external project targets. # other external project targets, which may cause problems during
# parallel builds. However, the Ninja generator needs to see the entire
# dependency graph, and can cope with custom commands belonging to
# multiple targets, so we add the 'done' mark as an output for Ninja only.
set(complete_outputs ${cmf_dir}${cfgdir}/${name}-complete)
if(${CMAKE_GENERATOR} MATCHES "Ninja")
set(complete_outputs
${complete_outputs} ${stamp_dir}${cfgdir}/${name}-done)
endif()
add_custom_command( add_custom_command(
OUTPUT ${cmf_dir}${cfgdir}/${name}-complete OUTPUT ${complete_outputs}
COMMENT "Completed '${name}'" COMMENT "Completed '${name}'"
COMMAND ${CMAKE_COMMAND} -E make_directory ${cmf_dir}${cfgdir} COMMAND ${CMAKE_COMMAND} -E make_directory ${cmf_dir}${cfgdir}
COMMAND ${CMAKE_COMMAND} -E touch ${cmf_dir}${cfgdir}/${name}-complete COMMAND ${CMAKE_COMMAND} -E touch ${cmf_dir}${cfgdir}/${name}-complete

@ -8,11 +8,12 @@
# #
# ALSA_INCLUDE_DIR - where to find asoundlib.h, etc. # ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
# ALSA_LIBRARY - the asound library # ALSA_LIBRARY - the asound library
# ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8)
# #
#============================================================================= #=============================================================================
# Copyright 2009 Kitware, Inc. # Copyright 2009-2011 Kitware, Inc.
# Copyright 2009 Philip Lowman <philip@yhbt.com> # Copyright 2009-2011 Philip Lowman <philip@yhbt.com>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -24,8 +25,7 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
find_path(ALSA_INCLUDE_DIR NAMES asoundlib.h find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
PATH_SUFFIXES alsa
DOC "The ALSA (asound) include directory" DOC "The ALSA (asound) include directory"
) )
@ -33,10 +33,19 @@ find_library(ALSA_LIBRARY NAMES asound
DOC "The ALSA (asound) library" DOC "The ALSA (asound) library"
) )
if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
file(STRINGS "${ALSA_INCLUDE_DIR}/alsa/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"")
string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}")
unset(alsa_version_str)
endif()
# handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA DEFAULT_MSG ALSA_LIBRARY ALSA_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR
VERSION_VAR ALSA_VERSION_STRING)
if(ALSA_FOUND) if(ALSA_FOUND)
set( ALSA_LIBRARIES ${ALSA_LIBRARY} ) set( ALSA_LIBRARIES ${ALSA_LIBRARY} )

@ -75,8 +75,9 @@ IF(BISON_EXECUTABLE)
ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]") ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]")
STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1" STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
BISON_VERSION "${BISON_version_output}") BISON_VERSION "${BISON_version_output}")
ELSE() ELSEIF("${BISON_version_output}" MATCHES "^GNU Bison ")
SET(BISON_VERSION "unknown") STRING(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2"
BISON_VERSION "${BISON_version_output}")
ENDIF() ENDIF()
ENDIF() ENDIF()

@ -23,6 +23,7 @@
########## ##########
### List of vendors (BLA_VENDOR) valid in this module ### List of vendors (BLA_VENDOR) valid in this module
## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model), ## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model),
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic ## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
# C/CXX should be enabled to use Intel mkl # C/CXX should be enabled to use Intel mkl
@ -85,6 +86,7 @@ if (NOT _libdir)
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH) set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
endif () endif ()
endif () endif ()
foreach(_library ${_list}) foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library}) set(_combined_name ${_combined_name}_${_library})
@ -115,7 +117,7 @@ foreach(_library ${_list})
endforeach(_library ${_list}) endforeach(_library ${_list})
if(_libraries_work) if(_libraries_work)
# Test this combination of libraries. # Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads}) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread})
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
if (_CHECK_FORTRAN) if (_CHECK_FORTRAN)
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
@ -460,117 +462,99 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
if (WIN32)
set(BLAS_SEARCH_LIBS "")
if(BLA_F95) if(BLA_F95)
if(NOT BLAS95_LIBRARIES) set(BLAS_mkl_SEARCH_SYMBOL SGEMM)
check_fortran_libraries( set(_LIBRARIES BLAS95_LIBRARIES)
BLAS95_LIBRARIES if (WIN32)
BLAS list(APPEND BLAS_SEARCH_LIBS
sgemm "mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40")
""
"mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40"
""
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
SGEMM
""
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
""
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
else (WIN32) else (WIN32)
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
if(BLA_F95) list(APPEND BLAS_SEARCH_LIBS
if(NOT BLAS95_LIBRARIES) "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
check_fortran_libraries( endif ()
BLAS95_LIBRARIES
BLAS
sgemm
""
"mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_intel;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT}"
"${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
if(BLA_F95) # old version
if(NOT BLAS95_LIBRARIES) list(APPEND BLAS_SEARCH_LIBS
check_fortran_libraries( "mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
BLAS95_LIBRARIES
BLAS # mkl >= 10.3
sgemm if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
"" list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide" "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core")
"${CMAKE_THREAD_LIBS_INIT};${LM}" set(LM "${LM};-lgomp")
) else ()
endif(NOT BLAS95_LIBRARIES) list(APPEND BLAS_SEARCH_LIBS
else(BLA_F95) "mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
if(NOT BLAS_LIBRARIES) endif ()
check_fortran_libraries( endif ()
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
endif (WIN32) endif (WIN32)
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core")
endif ()
else (BLA_F95)
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
set(_LIBRARIES BLAS_LIBRARIES)
if (WIN32)
list(APPEND BLAS_SEARCH_LIBS
"mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40")
else (WIN32)
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel mkl_intel_thread mkl_core guide")
endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core guide")
# mkl >= 10.3
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_gnu_thread mkl_core")
set(LM "${LM};-lgomp")
else ()
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
endif ()
endif ()
#older vesions of intel mkl libs #older vesions of intel mkl libs
# BLAS in intel mkl library? (shared) if (BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES) list(APPEND BLAS_SEARCH_LIBS
check_fortran_libraries( "mkl")
BLAS_LIBRARIES list(APPEND BLAS_SEARCH_LIBS
BLAS "mkl_ia32")
sgemm list(APPEND BLAS_SEARCH_LIBS
"" "mkl_em64t")
"mkl;guide" endif ()
"${CMAKE_THREAD_LIBS_INIT};${LM}" endif (WIN32)
) if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
endif(NOT BLAS_LIBRARIES) list(APPEND BLAS_SEARCH_LIBS
#BLAS in intel mkl library? (static, 32bit) "mkl_intel_lp64 mkl_sequential mkl_core")
if(NOT BLAS_LIBRARIES) endif ()
check_fortran_libraries( endif (BLA_F95)
BLAS_LIBRARIES
BLAS foreach (IT ${BLAS_SEARCH_LIBS})
sgemm string(REPLACE " " ";" SEARCH_LIBS ${IT})
"" if (${_LIBRARIES})
"mkl_ia32;guide" else ()
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
#BLAS in intel mkl library? (static, em64t 64bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries( check_fortran_libraries(
BLAS_LIBRARIES ${_LIBRARIES}
BLAS BLAS
sgemm ${BLAS_mkl_SEARCH_SYMBOL}
"" ""
"mkl_em64t;guide" "${SEARCH_LIBS}"
"${CMAKE_THREAD_LIBS_INIT};${LM}" "${CMAKE_THREAD_LIBS_INIT};${LM}"
) )
endif(NOT BLAS_LIBRARIES) endif ()
endforeach ()
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")

@ -5,10 +5,12 @@
# BZIP2_INCLUDE_DIR - the BZip2 include directory # BZIP2_INCLUDE_DIR - the BZip2 include directory
# BZIP2_LIBRARIES - Link these to use BZip2 # BZIP2_LIBRARIES - Link these to use BZip2
# BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_ # BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
# BZIP2_VERSION_STRING - the version of BZip2 found (since CMake 2.8.8)
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2012 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -22,17 +24,29 @@
FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ) FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 ) IF (NOT BZIP2_LIBRARIES)
FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 )
FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d )
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(BZIP2)
ENDIF (NOT BZIP2_LIBRARIES)
IF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
FILE(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
STRING(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
ENDIF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 DEFAULT_MSG BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR
VERSION_VAR BZIP2_VERSION_STRING)
IF (BZIP2_FOUND) IF (BZIP2_FOUND)
INCLUDE(CheckLibraryExists) INCLUDE(CheckLibraryExists)
CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARIES} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX) CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
ENDIF (BZIP2_FOUND) ENDIF (BZIP2_FOUND)
MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES) MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR)

@ -65,7 +65,8 @@
# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, # 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0, # 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0,
# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0, # 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0,
# 1.45, 1.45.0, 1.46, 1.46.0, 1.46.1, 1.47, 1.47.0, 1.48, 1.48.0 # 1.45, 1.45.0, 1.46, 1.46.0, 1.46.1, 1.47, 1.47.0, 1.48, 1.48.0,
# 1.49, 1.49.0, 1.50, 1.50.0
# #
# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should # NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
# add both 1.x and 1.x.0 as shown above. Official Boost include directories # add both 1.x and 1.x.0 as shown above. Official Boost include directories
@ -449,7 +450,7 @@ else(Boost_FIND_VERSION_EXACT)
# The user has not requested an exact version. Among known # The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request. # versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
"1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
"1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"

@ -216,6 +216,18 @@
# CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS # CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
# implementation (alterative to: # implementation (alterative to:
# CUDA_ADD_CUBLAS_TO_TARGET macro). # CUDA_ADD_CUBLAS_TO_TARGET macro).
# CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
# Only available for CUDA version 3.2+.
# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
# Only available for CUDA version 3.2+.
# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library.
# Only available for CUDA version 4.0+.
# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
# Only available for CUDA version 3.2+.
# Windows only.
# CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
# Only available for CUDA version 3.2+.
# Windows only.
# #
# #
# James Bigler, NVIDIA Corp (nvidia.com - jbigler) # James Bigler, NVIDIA Corp (nvidia.com - jbigler)
@ -430,6 +442,11 @@ if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
unset(CUDA_cublasemu_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE)
unset(CUDA_cufft_LIBRARY CACHE) unset(CUDA_cufft_LIBRARY CACHE)
unset(CUDA_cufftemu_LIBRARY CACHE) unset(CUDA_cufftemu_LIBRARY CACHE)
unset(CUDA_curand_LIBRARY CACHE)
unset(CUDA_cusparse_LIBRARY CACHE)
unset(CUDA_npp_LIBRARY CACHE)
unset(CUDA_nvcuvenc_LIBRARY CACHE)
unset(CUDA_nvcuvid_LIBRARY CACHE)
endif() endif()
if(NOT "${CUDA_SDK_ROOT_DIR}" STREQUAL "${CUDA_SDK_ROOT_DIR_INTERNAL}") if(NOT "${CUDA_SDK_ROOT_DIR}" STREQUAL "${CUDA_SDK_ROOT_DIR_INTERNAL}")
@ -600,7 +617,7 @@ if(CUDA_VERSION VERSION_GREATER "3.0")
endif() endif()
endif() endif()
# Search for cufft and cublas libraries. # Search for additional CUDA toolkit libraries.
if(CUDA_VERSION VERSION_LESS "3.1") if(CUDA_VERSION VERSION_LESS "3.1")
# Emulation libraries aren't available in version 3.1 onward. # Emulation libraries aren't available in version 3.1 onward.
find_cuda_helper_libs(cufftemu) find_cuda_helper_libs(cufftemu)
@ -608,6 +625,18 @@ if(CUDA_VERSION VERSION_LESS "3.1")
endif() endif()
find_cuda_helper_libs(cufft) find_cuda_helper_libs(cufft)
find_cuda_helper_libs(cublas) find_cuda_helper_libs(cublas)
if(NOT CUDA_VERSION VERSION_LESS "3.2")
# cusparse showed up in version 3.2
find_cuda_helper_libs(cusparse)
find_cuda_helper_libs(curand)
if (WIN32)
find_cuda_helper_libs(nvcuvenc)
find_cuda_helper_libs(nvcuvid)
endif()
endif()
if(NOT CUDA_VERSION VERSION_LESS "4.0")
find_cuda_helper_libs(npp)
endif()
if (CUDA_BUILD_EMULATION) if (CUDA_BUILD_EMULATION)
set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY})
@ -877,7 +906,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS: '${format}'. Use OBJ or PTX.") message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS: '${format}'. Use OBJ or PTX.")
endif() endif()
# Set up all the command line flags here, so that they can be overriden on a per target basis. # Set up all the command line flags here, so that they can be overridden on a per target basis.
set(nvcc_flags "") set(nvcc_flags "")

@ -4,9 +4,11 @@
# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc. # CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
# CURL_LIBRARIES - List of libraries when using curl. # CURL_LIBRARIES - List of libraries when using curl.
# CURL_FOUND - True if curl found. # CURL_FOUND - True if curl found.
# CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -32,10 +34,24 @@ FIND_LIBRARY(CURL_LIBRARY NAMES
) )
MARK_AS_ADVANCED(CURL_LIBRARY) MARK_AS_ADVANCED(CURL_LIBRARY)
IF(CURL_INCLUDE_DIR)
FOREACH(_curl_version_header curlver.h curl.h)
IF(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
UNSET(curl_version_str)
BREAK()
ENDIF()
ENDFOREACH(_curl_version_header)
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
VERSION_VAR CURL_VERSION_STRING)
IF(CURL_FOUND) IF(CURL_FOUND)
SET(CURL_LIBRARIES ${CURL_LIBRARY}) SET(CURL_LIBRARIES ${CURL_LIBRARY})

@ -4,12 +4,14 @@
# CUPS_FOUND - system has Cups # CUPS_FOUND - system has Cups
# CUPS_INCLUDE_DIR - the Cups include directory # CUPS_INCLUDE_DIR - the Cups include directory
# CUPS_LIBRARIES - Libraries needed to use Cups # CUPS_LIBRARIES - Libraries needed to use Cups
# CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
# Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which # Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
# features this function (i.e. at least 1.1.19) # features this function (i.e. at least 1.1.19)
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -21,36 +23,47 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE(CheckLibraryExists) find_path(CUPS_INCLUDE_DIR cups/cups.h )
FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h ) find_library(CUPS_LIBRARIES NAMES cups )
FIND_LIBRARY(CUPS_LIBRARIES NAMES cups ) if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
include(CheckLibraryExists)
IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
SET(CUPS_FOUND TRUE)
# ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint) # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE) CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE) endif (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
SET(CUPS_FOUND FALSE)
ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
ELSE (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES) if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
SET(CUPS_FOUND FALSE) file(STRINGS "${CUPS_INCLUDE_DIR}/cups/cups.h" cups_version_str
ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES) REGEX "^#[\t ]*define[\t ]+CUPS_VERSION_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
IF (CUPS_FOUND) unset(CUPS_VERSION_STRING)
IF (NOT Cups_FIND_QUIETLY) foreach(VPART MAJOR MINOR PATCH)
MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}") foreach(VLINE ${cups_version_str})
ENDIF (NOT Cups_FIND_QUIETLY) if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}")
ELSE (CUPS_FOUND) string(REGEX REPLACE "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$" "\\1"
SET(CUPS_LIBRARIES ) CUPS_VERSION_PART "${VLINE}")
IF (Cups_FIND_REQUIRED) if(CUPS_VERSION_STRING)
MESSAGE(FATAL_ERROR "Could NOT find Cups") set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}")
ENDIF (Cups_FIND_REQUIRED) else(CUPS_VERSION_STRING)
ENDIF (CUPS_FOUND) set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}")
endif(CUPS_VERSION_STRING)
endif()
endforeach(VLINE)
endforeach(VPART)
endif (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES) if (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR CUPS_HAS_IPP_DELETE_ATTRIBUTE
VERSION_VAR CUPS_VERSION_STRING)
else (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR
VERSION_VAR CUPS_VERSION_STRING)
endif (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES)

@ -9,6 +9,7 @@
# Only used in the case both Python & Perl # Only used in the case both Python & Perl
# are detected on the system to control # are detected on the system to control
# which CxxTest code generator is used. # which CxxTest code generator is used.
# Valid only for CxxTest version 3.
# #
# NOTE: In older versions of this Find Module, # NOTE: In older versions of this Find Module,
# this variable controlled if the Python test # this variable controlled if the Python test
@ -159,7 +160,8 @@ find_package(PythonInterp QUIET)
find_package(Perl QUIET) find_package(Perl QUIET)
find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h) find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE
NAMES cxxtestgen cxxtestgen.py
PATHS ${CXXTEST_INCLUDE_DIR}) PATHS ${CXXTEST_INCLUDE_DIR})
find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
PATHS ${CXXTEST_INCLUDE_DIR}) PATHS ${CXXTEST_INCLUDE_DIR})
@ -167,7 +169,7 @@ find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
if(PYTHONINTERP_FOUND OR PERL_FOUND) if(PYTHONINTERP_FOUND OR PERL_FOUND)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND)) if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND OR NOT DEFINED CXXTEST_USE_PYTHON))
set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE}) set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
set(CXXTEST_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE}) set(CXXTEST_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG

@ -11,6 +11,7 @@
# #
# DOXYGEN_EXECUTABLE = The path to the doxygen command. # DOXYGEN_EXECUTABLE = The path to the doxygen command.
# DOXYGEN_FOUND = Was Doxygen found or not? # DOXYGEN_FOUND = Was Doxygen found or not?
# DOXYGEN_VERSION = The version reported by doxygen --version
# #
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen. # DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
# DOXYGEN_DOT_FOUND = Was Dot found or not? # DOXYGEN_DOT_FOUND = Was Dot found or not?
@ -76,8 +77,12 @@ FIND_PROGRAM(DOXYGEN_EXECUTABLE
DOC "Doxygen documentation generation tool (http://www.doxygen.org)" DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
) )
IF(DOXYGEN_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDIF()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSION_VAR DOXYGEN_VERSION)
# #
# Find Dot... # Find Dot...

@ -24,10 +24,32 @@ FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
# Look for the library. # Look for the library.
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat) FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
REGEX "^#[\t ]*define[\t ]+XML_(MAJOR|MINOR|MICRO)_VERSION[\t ]+[0-9]+$")
unset(EXPAT_VERSION_STRING)
foreach(VPART MAJOR MINOR MICRO)
foreach(VLINE ${expat_version_str})
if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION")
string(REGEX REPLACE "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$" "\\1"
EXPAT_VERSION_PART "${VLINE}")
if(EXPAT_VERSION_STRING)
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}")
else(EXPAT_VERSION_STRING)
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}")
endif(EXPAT_VERSION_STRING)
endif()
endforeach(VLINE)
endforeach(VPART)
endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
REQUIRED_VARS EXPAT_LIBRARY EXPAT_INCLUDE_DIR
VERSION_VAR EXPAT_VERSION_STRING)
# Copy the results to the output variables. # Copy the results to the output variables.
IF(EXPAT_FOUND) IF(EXPAT_FOUND)

@ -91,8 +91,12 @@ IF(FLEX_EXECUTABLE)
MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available") MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
ENDIF() ENDIF()
ELSE() ELSE()
STRING(REGEX REPLACE "^flex (.*)$" "\\1" # older versions of flex printed "/full/path/to/executable version X.Y"
# newer versions use "basename(executable) X.Y"
GET_FILENAME_COMPONENT(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME)
STRING(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)$" "\\2"
FLEX_VERSION "${FLEX_version_output}") FLEX_VERSION "${FLEX_version_output}")
UNSET(FLEX_EXE_NAME)
ENDIF() ENDIF()
#============================================================ #============================================================

@ -3,6 +3,7 @@
# FREETYPE_LIBRARIES, the library to link against # FREETYPE_LIBRARIES, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE # FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers. # FREETYPE_INCLUDE_DIRS, where to find headers.
# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
# This is the concatenation of the paths: # This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build # FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2 # FREETYPE_INCLUDE_DIR_freetype2
@ -77,10 +78,33 @@ IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
IF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
FILE(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
UNSET(FREETYPE_VERSION_STRING)
FOREACH(VPART MAJOR MINOR PATCH)
FOREACH(VLINE ${freetype_version_str})
IF(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
STRING(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
FREETYPE_VERSION_PART "${VLINE}")
IF(FREETYPE_VERSION_STRING)
SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
ELSE(FREETYPE_VERSION_STRING)
SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
ENDIF(FREETYPE_VERSION_STRING)
UNSET(FREETYPE_VERSION_PART)
ENDIF()
ENDFOREACH(VLINE)
ENDFOREACH(VPART)
ENDIF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
VERSION_VAR FREETYPE_VERSION_STRING)
MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)

@ -64,9 +64,10 @@ ELSE (WIN32)
ENDIF (WIN32) ENDIF (WIN32)
SET( GLUT_FOUND "NO" ) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(GLUT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
IF(GLUT_glut_LIBRARY)
IF (GLUT_FOUND)
# Is -lXi and -lXmu required on all platforms that have it? # Is -lXi and -lXmu required on all platforms that have it?
# If not, we need some way to figure out what platform we are on. # If not, we need some way to figure out what platform we are on.
SET( GLUT_LIBRARIES SET( GLUT_LIBRARIES
@ -75,14 +76,11 @@ IF(GLUT_INCLUDE_DIR)
${GLUT_Xi_LIBRARY} ${GLUT_Xi_LIBRARY}
${GLUT_cocoa_LIBRARY} ${GLUT_cocoa_LIBRARY}
) )
SET( GLUT_FOUND "YES" )
#The following deprecated settings are for backwards compatibility with CMake1.4 #The following deprecated settings are for backwards compatibility with CMake1.4
SET (GLUT_LIBRARY ${GLUT_LIBRARIES}) SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR}) SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
ENDIF(GLUT_FOUND)
ENDIF(GLUT_glut_LIBRARY)
ENDIF(GLUT_INCLUDE_DIR)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
GLUT_INCLUDE_DIR GLUT_INCLUDE_DIR

@ -4,6 +4,7 @@
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool. # GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool. # GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
# GETTEXT_FOUND: True if gettext has been found. # GETTEXT_FOUND: True if gettext has been found.
# GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
# #
# Additionally it provides the following macros: # Additionally it provides the following macros:
# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) # GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
@ -42,11 +43,35 @@ FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt) FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
IF(GETTEXT_MSGMERGE_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version
OUTPUT_VARIABLE gettext_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF (gettext_version MATCHES "^msgmerge \\(.*\\) [0-9]")
STRING(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}")
ENDIF()
UNSET(gettext_version)
ENDIF(GETTEXT_MSGMERGE_EXECUTABLE)
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext
REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE
VERSION_VAR GETTEXT_VERSION_STRING)
INCLUDE(CMakeParseArguments) INCLUDE(CMakeParseArguments)
FUNCTION(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
SET(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
GET_PROPERTY(currentCounter GLOBAL PROPERTY "${propertyName}")
IF(NOT currentCounter)
SET(currentCounter 1)
ENDIF()
SET(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
MATH(EXPR currentCounter "${currentCounter} + 1")
SET_PROPERTY(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
ENDFUNCTION()
MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
# make it a real variable, so we can modify it here # make it a real variable, so we can modify it here
SET(_firstPoFile "${_firstPoFileArg}") SET(_firstPoFile "${_firstPoFileArg}")
@ -80,7 +105,15 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
ENDFOREACH (_currentPoFile ) ENDFOREACH (_currentPoFile )
ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles}) IF(NOT TARGET translations)
ADD_CUSTOM_TARGET(translations)
ENDIF()
_GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName)
ADD_CUSTOM_TARGET(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
ADD_DEPENDENCIES(translations ${uniqueTargetName})
ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
@ -119,11 +152,20 @@ FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile)
LIST(APPEND _gmoFiles ${_gmoFile}) LIST(APPEND _gmoFiles ${_gmoFile})
ENDFOREACH (_lang ) ENDFOREACH (_lang )
IF(NOT TARGET potfiles)
ADD_CUSTOM_TARGET(potfiles)
ENDIF()
_GETTEXT_GET_UNIQUE_TARGET_NAME( potfiles uniqueTargetName)
IF(_parsedArguments_ALL) IF(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(potfiles ALL DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
ELSE(_parsedArguments_ALL) ELSE(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(potfiles DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
ENDIF(_parsedArguments_ALL) ENDIF(_parsedArguments_ALL)
ADD_DEPENDENCIES(potfiles ${uniqueTargetName})
ENDFUNCTION(GETTEXT_PROCESS_POT_FILE) ENDFUNCTION(GETTEXT_PROCESS_POT_FILE)
@ -151,11 +193,21 @@ FUNCTION(GETTEXT_PROCESS_PO_FILES _lang)
LIST(APPEND _gmoFiles ${_gmoFile}) LIST(APPEND _gmoFiles ${_gmoFile})
ENDFOREACH(_current_PO_FILE) ENDFOREACH(_current_PO_FILE)
IF(NOT TARGET pofiles)
ADD_CUSTOM_TARGET(pofiles)
ENDIF()
_GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
IF(_parsedArguments_ALL) IF(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(pofiles ALL DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
ELSE(_parsedArguments_ALL) ELSE(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(pofiles DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
ENDIF(_parsedArguments_ALL) ENDIF(_parsedArguments_ALL)
ADD_DEPENDENCIES(pofiles ${uniqueTargetName})
ENDFUNCTION(GETTEXT_PROCESS_PO_FILES) ENDFUNCTION(GETTEXT_PROCESS_PO_FILES)
IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )

@ -1,6 +1,7 @@
# The module defines the following variables: # The module defines the following variables:
# GIT_EXECUTABLE - path to git command line client # GIT_EXECUTABLE - path to git command line client
# GIT_FOUND - true if the command line client was found # GIT_FOUND - true if the command line client was found
# GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
# Example usage: # Example usage:
# find_package(Git) # find_package(Git)
# if(GIT_FOUND) # if(GIT_FOUND)
@ -9,6 +10,7 @@
#============================================================================= #=============================================================================
# Copyright 2010 Kitware, Inc. # Copyright 2010 Kitware, Inc.
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -40,8 +42,21 @@ find_program(GIT_EXECUTABLE
) )
mark_as_advanced(GIT_EXECUTABLE) mark_as_advanced(GIT_EXECUTABLE)
if(GIT_EXECUTABLE)
execute_process(COMMAND ${GIT_EXECUTABLE} --version
OUTPUT_VARIABLE git_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (git_version MATCHES "^git version [0-9]")
string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
endif()
unset(git_version)
endif(GIT_EXECUTABLE)
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE) find_package_handle_standard_args(Git
REQUIRED_VARS GIT_EXECUTABLE
VERSION_VAR GIT_VERSION_STRING)

@ -35,9 +35,10 @@ IF (NOT WIN32)
# try using pkg-config to get the directories and then use these values # try using pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls # in the FIND_PATH() and FIND_LIBRARY() calls
# also fills in GNUTLS_DEFINITIONS, although that isn't normally useful # also fills in GNUTLS_DEFINITIONS, although that isn't normally useful
FIND_PACKAGE(PkgConfig) FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_GNUTLS gnutls) PKG_CHECK_MODULES(PC_GNUTLS QUIET gnutls)
SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER}) SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
SET(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION})
ENDIF (NOT WIN32) ENDIF (NOT WIN32)
FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
@ -57,7 +58,9 @@ MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS
REQUIRED_VARS GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR
VERSION_VAR GNUTLS_VERSION_STRING)
IF(GNUTLS_FOUND) IF(GNUTLS_FOUND)
SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY}) SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY})

@ -4,6 +4,9 @@
# #
# GNUPLOT_FOUND - system has Gnuplot # GNUPLOT_FOUND - system has Gnuplot
# GNUPLOT_EXECUTABLE - the Gnuplot executable # GNUPLOT_EXECUTABLE - the Gnuplot executable
# GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
#
# GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
#============================================================================= #=============================================================================
# Copyright 2002-2009 Kitware, Inc. # Copyright 2002-2009 Kitware, Inc.
@ -29,13 +32,26 @@ FIND_PROGRAM(GNUPLOT_EXECUTABLE
${CYGWIN_INSTALL_PATH}/bin ${CYGWIN_INSTALL_PATH}/bin
) )
IF (GNUPLOT_EXECUTABLE)
EXECUTE_PROCESS(COMMAND "${GNUPLOT_EXECUTABLE}" --version
OUTPUT_VARIABLE GNUPLOT_OUTPUT_VARIABLE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "^gnuplot ([0-9\\.]+)( patchlevel )?" "\\1." GNUPLOT_VERSION_STRING "${GNUPLOT_OUTPUT_VARIABLE}")
STRING(REGEX REPLACE "\\.$" "" GNUPLOT_VERSION_STRING "${GNUPLOT_VERSION_STRING}")
UNSET(GNUPLOT_OUTPUT_VARIABLE)
ENDIF()
# for compatibility # for compatibility
SET(GNUPLOT ${GNUPLOT_EXECUTABLE}) SET(GNUPLOT ${GNUPLOT_EXECUTABLE})
# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot DEFAULT_MSG GNUPLOT_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot
REQUIRED_VARS GNUPLOT_EXECUTABLE
VERSION_VAR GNUPLOT_VERSION_STRING)
MARK_AS_ADVANCED( GNUPLOT_EXECUTABLE ) MARK_AS_ADVANCED( GNUPLOT_EXECUTABLE )

@ -32,12 +32,15 @@ IF (HSPELL_INCLUDE_DIR)
FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H) FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}") STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}") STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
SET(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
ENDIF() ENDIF()
# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL DEFAULT_MSG HSPELL_LIBRARIES HSPELL_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL
REQUIRED_VARS HSPELL_LIBRARIES HSPELL_INCLUDE_DIR
VERSION_VAR HSPELL_VERSION_STRING)
MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES) MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)

@ -24,6 +24,10 @@
# ImageMagick_EXECUTABLE_DIR - Full path to executables directory. # ImageMagick_EXECUTABLE_DIR - Full path to executables directory.
# ImageMagick_<component>_FOUND - TRUE if <component> is found. # ImageMagick_<component>_FOUND - TRUE if <component> is found.
# ImageMagick_<component>_EXECUTABLE - Full path to <component> executable. # ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
# ImageMagick_VERSION_STRING - the version of ImageMagick found
# (since CMake 2.8.8)
#
# ImageMagick_VERSION_STRING will not work for old versions like 5.2.3.
# #
# There are also components for the following ImageMagick APIs: # There are also components for the following ImageMagick APIs:
# #
@ -53,6 +57,7 @@
#============================================================================= #=============================================================================
# Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2009 Kitware, Inc.
# Copyright 2007-2008 Miguel A. Figueroa-Villanueva <miguelf at ieee dot org> # Copyright 2007-2008 Miguel A. Figueroa-Villanueva <miguelf at ieee dot org>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -134,7 +139,8 @@ FIND_PATH(ImageMagick_EXECUTABLE_DIR
# Find each component. Search for all tools in same dir # Find each component. Search for all tools in same dir
# <ImageMagick_EXECUTABLE_DIR>; otherwise they should be found # <ImageMagick_EXECUTABLE_DIR>; otherwise they should be found
# independently and not in a cohesive module such as this one. # independently and not in a cohesive module such as this one.
SET(ImageMagick_FOUND TRUE) UNSET(ImageMagick_REQUIRED_VARS)
UNSET(ImageMagick_DEFAULT_EXECUTABLES)
FOREACH(component ${ImageMagick_FIND_COMPONENTS} FOREACH(component ${ImageMagick_FIND_COMPONENTS}
# DEPRECATED: forced components for backward compatibility # DEPRECATED: forced components for backward compatibility
convert mogrify import montage composite convert mogrify import montage composite
@ -143,37 +149,65 @@ FOREACH(component ${ImageMagick_FIND_COMPONENTS}
FIND_IMAGEMAGICK_API(Magick++ Magick++.h FIND_IMAGEMAGICK_API(Magick++ Magick++.h
Magick++ CORE_RL_Magick++_ Magick++ CORE_RL_Magick++_
) )
LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_Magick++_LIBRARY)
ELSEIF(component STREQUAL "MagickWand") ELSEIF(component STREQUAL "MagickWand")
FIND_IMAGEMAGICK_API(MagickWand wand/MagickWand.h FIND_IMAGEMAGICK_API(MagickWand wand/MagickWand.h
Wand MagickWand CORE_RL_wand_ Wand MagickWand CORE_RL_wand_
) )
LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY)
ELSEIF(component STREQUAL "MagickCore") ELSEIF(component STREQUAL "MagickCore")
FIND_IMAGEMAGICK_API(MagickCore magick/MagickCore.h FIND_IMAGEMAGICK_API(MagickCore magick/MagickCore.h
Magick MagickCore CORE_RL_magick_ Magick MagickCore CORE_RL_magick_
) )
LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
ELSE(component STREQUAL "Magick++") ELSE(component STREQUAL "Magick++")
IF(ImageMagick_EXECUTABLE_DIR) IF(ImageMagick_EXECUTABLE_DIR)
FIND_IMAGEMAGICK_EXE(${component}) FIND_IMAGEMAGICK_EXE(${component})
ENDIF(ImageMagick_EXECUTABLE_DIR) ENDIF(ImageMagick_EXECUTABLE_DIR)
ENDIF(component STREQUAL "Magick++")
IF(NOT ImageMagick_${component}_FOUND) IF(ImageMagick_FIND_COMPONENTS)
LIST(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested) LIST(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested)
IF(is_requested GREATER -1) IF(is_requested GREATER -1)
SET(ImageMagick_FOUND FALSE) LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE)
ENDIF(is_requested GREATER -1) ENDIF(is_requested GREATER -1)
ENDIF(NOT ImageMagick_${component}_FOUND) ELSEIF(ImageMagick_${component}_EXECUTABLE)
# if no components were requested explicitly put all (default) executables
# in the list
LIST(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE)
ENDIF(ImageMagick_FIND_COMPONENTS)
ENDIF(component STREQUAL "Magick++")
ENDFOREACH(component) ENDFOREACH(component)
IF(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES)
# No components were requested, and none of the default components were
# found. Just insert mogrify into the list of the default components to
# find so FPHSA below has something to check
LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_mogrify_EXECUTABLE)
ELSEIF(ImageMagick_DEFAULT_EXECUTABLES)
LIST(APPEND ImageMagick_REQUIRED_VARS ${ImageMagick_DEFAULT_EXECUTABLES})
ENDIF()
SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS}) SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS})
SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES}) SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES})
IF(ImageMagick_mogrify_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${ImageMagick_mogrify_EXECUTABLE} -version
OUTPUT_VARIABLE imagemagick_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(imagemagick_version MATCHES "^Version: ImageMagick [0-9]")
STRING(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}")
ENDIF()
UNSET(imagemagick_version)
ENDIF(ImageMagick_mogrify_EXECUTABLE)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Standard Package Output # Standard Package Output
#--------------------------------------------------------------------- #---------------------------------------------------------------------
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS( FIND_PACKAGE_HANDLE_STANDARD_ARGS(ImageMagick
ImageMagick DEFAULT_MSG ImageMagick_FOUND REQUIRED_VARS ${ImageMagick_REQUIRED_VARS}
VERSION_VAR ImageMagick_VERSION_STRING
) )
# Maintain consistency with all other variables. # Maintain consistency with all other variables.
SET(ImageMagick_FOUND ${IMAGEMAGICK_FOUND}) SET(ImageMagick_FOUND ${IMAGEMAGICK_FOUND})

@ -3,11 +3,13 @@
# #
# JASPER_FOUND - system has Jasper # JASPER_FOUND - system has Jasper
# JASPER_INCLUDE_DIR - the Jasper include directory # JASPER_INCLUDE_DIR - the Jasper include directory
# JASPER_LIBRARIES - The libraries needed to use Jasper # JASPER_LIBRARIES - the libraries needed to use Jasper
# JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -19,19 +21,33 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h)
IF (NOT JASPER_LIBRARIES)
FIND_PACKAGE(JPEG) FIND_PACKAGE(JPEG)
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h) FIND_LIBRARY(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
FIND_LIBRARY(JASPER_LIBRARY_DEBUG NAMES jasperd)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(JASPER)
ENDIF (NOT JASPER_LIBRARIES)
IF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
FILE(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
FIND_LIBRARY(JASPER_LIBRARY NAMES jasper libjasper) STRING(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
ENDIF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper DEFAULT_MSG JASPER_LIBRARY JASPER_INCLUDE_DIR JPEG_LIBRARIES) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper
REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES
VERSION_VAR JASPER_VERSION_STRING)
IF (JASPER_FOUND) IF (JASPER_FOUND)
SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} ) SET(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
ENDIF (JASPER_FOUND) ENDIF (JASPER_FOUND)
MARK_AS_ADVANCED(JASPER_INCLUDE_DIR JASPER_LIBRARY) MARK_AS_ADVANCED(JASPER_INCLUDE_DIR)

@ -220,6 +220,9 @@ if (BLA_VENDOR STREQUAL "Generic" OR
endif () endif ()
#intel lapack #intel lapack
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (NOT WIN32)
set(LM "-lm")
endif ()
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads) find_PACKAGE(Threads)
@ -228,6 +231,7 @@ endif ()
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
if (BLA_F95) if (BLA_F95)
if(NOT LAPACK95_LIBRARIES) if(NOT LAPACK95_LIBRARIES)
# old
check_lapack_libraries( check_lapack_libraries(
LAPACK95_LIBRARIES LAPACK95_LIBRARIES
LAPACK LAPACK
@ -235,11 +239,24 @@ endif ()
"" ""
"mkl_lapack95" "mkl_lapack95"
"${BLAS95_LIBRARIES}" "${BLAS95_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT LAPACK95_LIBRARIES)
if(NOT LAPACK95_LIBRARIES)
# new >= 10.3
check_lapack_libraries(
LAPACK95_LIBRARIES
LAPACK
CHEEV
""
"mkl_intel_lp64"
"${BLAS95_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
) )
endif(NOT LAPACK95_LIBRARIES) endif(NOT LAPACK95_LIBRARIES)
else(BLA_F95) else(BLA_F95)
if(NOT LAPACK_LIBRARIES) if(NOT LAPACK_LIBRARIES)
# old
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
@ -247,7 +264,19 @@ endif ()
"" ""
"mkl_lapack" "mkl_lapack"
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT LAPACK_LIBRARIES)
if(NOT LAPACK_LIBRARIES)
# new >= 10.3
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"mkl_gf_lp64"
"${BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
) )
endif(NOT LAPACK_LIBRARIES) endif(NOT LAPACK_LIBRARIES)
endif(BLA_F95) endif(BLA_F95)

@ -54,8 +54,9 @@ endif()
# itself includes this FindLibArchive when built with an older CMake that does # itself includes this FindLibArchive when built with an older CMake that does
# not provide it. The older CMake also does not have CMAKE_CURRENT_LIST_DIR.) # not provide it. The older CMake also does not have CMAKE_CURRENT_LIST_DIR.)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(LibArchive DEFAULT_MSG find_package_handle_standard_args(LibArchive
LibArchive_LIBRARY LibArchive_INCLUDE_DIR REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
VERSION_VAR LibArchive_VERSION
) )
set(LibArchive_FOUND ${LIBARCHIVE_FOUND}) set(LibArchive_FOUND ${LIBARCHIVE_FOUND})
unset(LIBARCHIVE_FOUND) unset(LIBARCHIVE_FOUND)

@ -6,6 +6,7 @@
# LIBXML2_LIBRARIES - The libraries needed to use LibXml2 # LIBXML2_LIBRARIES - The libraries needed to use LibXml2
# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2 # LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2 # LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
# LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8)
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
@ -23,8 +24,8 @@
# use pkg-config to get the directories and then use these values # use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls # in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig) FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_LIBXML libxml-2.0 QUIET) PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
@ -44,10 +45,22 @@ FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
# for backwards compat. with KDE 4.0.x: # for backwards compat. with KDE 4.0.x:
SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}") SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
IF(PC_LIBXML_VERSION)
SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
ELSEIF(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
FILE(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"")
STRING(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
LIBXML2_VERSION_STRING "${libxml2_version_str}")
UNSET(libxml2_version_str)
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
VERSION_VAR LIBXML2_VERSION_STRING)
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE) MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)

@ -5,6 +5,7 @@
# LIBXSLT_INCLUDE_DIR - the LibXslt include directory # LIBXSLT_INCLUDE_DIR - the LibXslt include directory
# LIBXSLT_LIBRARIES - Link these to LibXslt # LIBXSLT_LIBRARIES - Link these to LibXslt
# LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt # LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
# LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
# Additionally, the following two variables are set (but not required for using xslt): # Additionally, the following two variables are set (but not required for using xslt):
# LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library # LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library
# LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found # LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found
@ -25,7 +26,7 @@
# use pkg-config to get the directories and then use these values # use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls # in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig) FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt) PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt)
SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER}) SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
@ -51,10 +52,21 @@ SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc) FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if IF(PC_LIBXSLT_VERSION)
# all listed variables are TRUE SET(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION})
ELSEIF(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h")
FILE(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str
REGEX "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\".*\"")
STRING(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
LIBXSLT_VERSION_STRING "${libxslt_version_str}")
UNSET(libxslt_version_str)
ENDIF()
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt
REQUIRED_VARS LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR
VERSION_VAR LIBXSLT_VERSION_STRING)
MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR
LIBXSLT_LIBRARIES LIBXSLT_LIBRARIES

@ -3,6 +3,7 @@
# LUA51_FOUND, if false, do not try to link to Lua # LUA51_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES # LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h # LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
# #
# Note that the expected include convention is # Note that the expected include convention is
# #include "lua.h" # #include "lua.h"
@ -66,10 +67,19 @@ IF(LUA_LIBRARY)
ENDIF(UNIX AND NOT APPLE) ENDIF(UNIX AND NOT APPLE)
ENDIF(LUA_LIBRARY) ENDIF(LUA_LIBRARY)
IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
UNSET(lua_version_str)
ENDIF()
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)

@ -354,6 +354,20 @@ function (interrogate_mpi_compiler lang try_libs)
# Extract the set of libraries to link against from the link command # Extract the set of libraries to link against from the link command
# line # line
string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
# add the compiler implicit directories because some compilers
# such as the intel compiler have libraries that show up
# in the showme list that can only be found in the implicit
# link directories of the compiler. Do this for C++ and C
# compilers if the implicit link directories are defined.
if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES)
set(MPI_LINK_PATH
"${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}")
endif ()
if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES)
set(MPI_LINK_PATH
"${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif ()
# Determine full path names for all of the libraries that one needs # Determine full path names for all of the libraries that one needs
# to link against in an MPI program # to link against in an MPI program
@ -413,7 +427,7 @@ function (interrogate_mpi_compiler lang try_libs)
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
PATH_SUFFIXES lib) PATH_SUFFIXES lib)
if (MPI_LIBRARIES_WORK AND MPI_LIB) if (MPI_LIBRARIES_WORK AND MPI_LIB)
set(MPI_LIBRARIES_WORK "${MPI_LIBRARIES_WORK} ${MPI_LIB}") list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
endif() endif()
endif() endif()

@ -13,6 +13,7 @@
#============================================================================= #=============================================================================
# Copyright 2009 Kitware, Inc. # Copyright 2009 Kitware, Inc.
# Copyright 2008-2009 André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no> # Copyright 2008-2009 André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -24,18 +25,17 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
include(CheckCSourceCompiles) set(_OPENMP_REQUIRED_VARS)
include(CheckCXXSourceCompiles)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
set(OpenMP_C_FLAG_CANDIDATES function(_OPENMP_FLAG_CANDIDATES LANG)
#Gnu set(OpenMP_FLAG_CANDIDATES
#GNU
"-fopenmp" "-fopenmp"
#Microsoft Visual Studio #Microsoft Visual Studio
"/openmp" "/openmp"
#Intel windows #Intel windows
"-Qopenmp" "-Qopenmp"
#Intel #PathScale, Intel
"-openmp" "-openmp"
#Empty, if compiler automatically accepts openmp #Empty, if compiler automatically accepts openmp
" " " "
@ -45,10 +45,34 @@ set(OpenMP_C_FLAG_CANDIDATES
"+Oopenmp" "+Oopenmp"
#IBM XL C/c++ #IBM XL C/c++
"-qsmp" "-qsmp"
#Portland Group #Portland Group, MIPSpro
"-mp" "-mp"
) )
set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES})
set(OMP_FLAG_GNU "-fopenmp")
set(OMP_FLAG_HP "+Oopenmp")
if(WIN32)
set(OMP_FLAG_Intel "-Qopenmp")
else()
set(OMP_FLAG_Intel "-openmp")
endif()
set(OMP_FLAG_MIPSpro "-mp")
set(OMP_FLAG_MSVC "/openmp")
set(OMP_FLAG_PathScale "-openmp")
set(OMP_FLAG_PGI "-mp")
set(OMP_FLAG_SunPro "-xopenmp")
set(OMP_FLAG_XL "-qsmp")
# Move the flag that matches the compiler to the head of the list,
# this is faster and doesn't clutter the output that much. If that
# flag doesn't work we will still try all.
if(OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID})
list(REMOVE_ITEM OpenMP_FLAG_CANDIDATES "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}")
list(INSERT OpenMP_FLAG_CANDIDATES 0 "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}")
endif()
set(OpenMP_${LANG}_FLAG_CANDIDATES "${OpenMP_FLAG_CANDIDATES}" PARENT_SCOPE)
endfunction(_OPENMP_FLAG_CANDIDATES)
# sample openmp source code to test # sample openmp source code to test
set(OpenMP_C_TEST_SOURCE set(OpenMP_C_TEST_SOURCE
@ -62,22 +86,24 @@ int main() {
#endif #endif
} }
") ")
# use the same source for CXX as C for now
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE}) # check c compiler
if(CMAKE_C_COMPILER_LOADED)
# if these are set then do not try to find them again, # if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags # by avoiding any try_compiles for the flags
if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) if(OpenMP_C_FLAGS)
set(OpenMP_C_FLAG_CANDIDATES) unset(OpenMP_C_FLAG_CANDIDATES)
set(OpenMP_CXX_FLAG_CANDIDATES) else()
endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) _OPENMP_FLAG_CANDIDATES("C")
include(CheckCSourceCompiles)
endif()
# check c compiler
foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}") set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE) unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP C flag = [${FLAG}]") message(STATUS "Try OpenMP C flag = [${FLAG}]")
check_c_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED) check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED) if(OpenMP_FLAG_DETECTED)
set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
@ -85,13 +111,33 @@ foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
endif(OpenMP_FLAG_DETECTED) endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
CACHE STRING "C compiler flags for OpenMP parallization")
list(APPEND _OPENMP_REQUIRED_VARS OpenMP_C_FLAGS)
unset(OpenMP_C_FLAG_CANDIDATES)
endif()
# check cxx compiler # check cxx compiler
if(CMAKE_CXX_COMPILER_LOADED)
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(OpenMP_CXX_FLAGS)
unset(OpenMP_CXX_FLAG_CANDIDATES)
else()
_OPENMP_FLAG_CANDIDATES("CXX")
include(CheckCXXSourceCompiles)
# use the same source for CXX as C for now
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
endif()
foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}") set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE) unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP CXX flag = [${FLAG}]") message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
check_cxx_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED) check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED) if(OpenMP_FLAG_DETECTED)
set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
@ -99,16 +145,23 @@ foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
endif(OpenMP_FLAG_DETECTED) endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
CACHE STRING "C compiler flags for OpenMP parallization")
set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}"
CACHE STRING "C++ compiler flags for OpenMP parallization") CACHE STRING "C++ compiler flags for OpenMP parallization")
# handle the standard arguments for find_package
find_package_handle_standard_args(OpenMP DEFAULT_MSG
OpenMP_C_FLAGS OpenMP_CXX_FLAGS )
mark_as_advanced( list(APPEND _OPENMP_REQUIRED_VARS OpenMP_CXX_FLAGS)
OpenMP_C_FLAGS unset(OpenMP_CXX_FLAG_CANDIDATES)
OpenMP_CXX_FLAGS unset(OpenMP_CXX_TEST_SOURCE)
) endif()
if(_OPENMP_REQUIRED_VARS)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(OpenMP
REQUIRED_VARS ${_OPENMP_REQUIRED_VARS})
mark_as_advanced(${_OPENMP_REQUIRED_VARS})
unset(_OPENMP_REQUIRED_VARS)
else()
message(SEND_ERROR "FindOpenMP requires C or CXX language to be enabled")
endif()

@ -7,7 +7,7 @@
# OPENSSL_FOUND - system has the OpenSSL library # OPENSSL_FOUND - system has the OpenSSL library
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory # OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL # OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
# OPENSSL_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8) # OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
@ -25,10 +25,8 @@
# License text for the above reference.) # License text for the above reference.)
if (UNIX) if (UNIX)
find_package(PkgConfig) find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND) pkg_check_modules(_OPENSSL QUIET openssl)
pkg_check_modules(_OPENSSL openssl)
endif (PKG_CONFIG_FOUND)
endif (UNIX) endif (UNIX)
# http://www.slproweb.com/products/Win32OpenSSL.html # http://www.slproweb.com/products/Win32OpenSSL.html
@ -215,17 +213,73 @@ ELSE(WIN32 AND NOT CYGWIN)
ENDIF(WIN32 AND NOT CYGWIN) ENDIF(WIN32 AND NOT CYGWIN)
function(from_hex HEX DEC)
string(TOUPPER "${HEX}" HEX)
set(_res 0)
string(LENGTH "${HEX}" _strlen)
while (_strlen GREATER 0)
math(EXPR _res "${_res} * 16")
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
string(SUBSTRING "${HEX}" 1 -1 HEX)
if (NIBBLE STREQUAL "A")
math(EXPR _res "${_res} + 10")
elseif (NIBBLE STREQUAL "B")
math(EXPR _res "${_res} + 11")
elseif (NIBBLE STREQUAL "C")
math(EXPR _res "${_res} + 12")
elseif (NIBBLE STREQUAL "D")
math(EXPR _res "${_res} + 13")
elseif (NIBBLE STREQUAL "E")
math(EXPR _res "${_res} + 14")
elseif (NIBBLE STREQUAL "F")
math(EXPR _res "${_res} + 15")
else()
math(EXPR _res "${_res} + ${NIBBLE}")
endif()
string(LENGTH "${HEX}" _strlen)
endwhile()
set(${DEC} ${_res} PARENT_SCOPE)
endfunction(from_hex)
if (OPENSSL_INCLUDE_DIR) if (OPENSSL_INCLUDE_DIR)
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9][0-9][0-9][0-9].*") if (_OPENSSL_VERSION)
set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
# The status gives if this is a developer or prerelease and is ignored here.
# Major, minor, and fix directly translate into the version numbers shown in
# the string. The patch field translates to the single character suffix that
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
# on.
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" OPENSSL_VERSION_MAJOR "${openssl_version_str}") string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_MINOR "${openssl_version_str}") "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_PATCH "${openssl_version_str}") list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
string(REGEX REPLACE "^0" "" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}") if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
string(REGEX REPLACE "^0" "" OPENSSL_VERSION_PATCH "${OPENSSL_VERSION_PATCH}") from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
# 96 is the ASCII code of 'a' minus 1
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
unset(_tmp)
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
# this should be updated to handle that, too. This has not happened yet
# so it is simply ignored here for now.
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_PATCH}") set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
endif (_OPENSSL_VERSION)
endif (OPENSSL_INCLUDE_DIR) endif (OPENSSL_INCLUDE_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

@ -78,7 +78,7 @@ list(APPEND _osg_modules_to_process "osg" "OpenThreads")
list(REMOVE_DUPLICATES _osg_modules_to_process) list(REMOVE_DUPLICATES _osg_modules_to_process)
if(OpenSceneGraph_DEBUG) if(OpenSceneGraph_DEBUG)
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Components = ${_osg_modules_to_process}") "Components = ${_osg_modules_to_process}")
endif() endif()
@ -93,7 +93,7 @@ endif()
# Try to ascertain the version... # Try to ascertain the version...
if(OSG_INCLUDE_DIR) if(OSG_INCLUDE_DIR)
if(OpenSceneGraph_DEBUG) if(OpenSceneGraph_DEBUG)
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}") "Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
endif() endif()
@ -127,14 +127,14 @@ if(OSG_INCLUDE_DIR)
string(REGEX REPLACE ".*#define OPENSCENEGRAPH_PATCH_VERSION[ \t]+([0-9]+).*" string(REGEX REPLACE ".*#define OPENSCENEGRAPH_PATCH_VERSION[ \t]+([0-9]+).*"
"\\1" _osg_VERSION_PATCH ${_osg_Version_contents}) "\\1" _osg_VERSION_PATCH ${_osg_Version_contents})
else() else()
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " message(WARNING "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Failed to parse version number, please report this as a bug") "Failed to parse version number, please report this as a bug")
endif() endif()
set(OPENSCENEGRAPH_VERSION "${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR}.${_osg_VERSION_PATCH}" set(OPENSCENEGRAPH_VERSION "${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR}.${_osg_VERSION_PATCH}"
CACHE INTERNAL "The version of OSG which was detected") CACHE INTERNAL "The version of OSG which was detected")
if(OpenSceneGraph_DEBUG) if(OpenSceneGraph_DEBUG)
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Detected version ${OPENSCENEGRAPH_VERSION}") "Detected version ${OPENSCENEGRAPH_VERSION}")
endif() endif()
endif() endif()
@ -165,7 +165,7 @@ endif()
# #
foreach(_osg_module ${_osg_modules_to_process}) foreach(_osg_module ${_osg_modules_to_process})
if(OpenSceneGraph_DEBUG) if(OpenSceneGraph_DEBUG)
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Calling find_package(${_osg_module} ${_osg_required} ${_osg_quiet})") "Calling find_package(${_osg_module} ${_osg_required} ${_osg_quiet})")
endif() endif()
find_package(${_osg_module} ${_osg_quiet}) find_package(${_osg_module} ${_osg_quiet})

@ -7,6 +7,7 @@
# PNG_LIBRARIES, the libraries to link against to use PNG. # PNG_LIBRARIES, the libraries to link against to use PNG.
# PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files. # PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
# PNG_FOUND, If false, do not try to use PNG. # PNG_FOUND, If false, do not try to use PNG.
# PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8)
# Also defined, but not for general use are # Also defined, but not for general use are
# PNG_LIBRARY, where to find the PNG library. # PNG_LIBRARY, where to find the PNG library.
# For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS. # For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS.
@ -56,11 +57,19 @@ if(ZLIB_FOUND)
endif (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR) endif (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
unset(png_version_str)
endif (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
# handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PNG DEFAULT_MSG PNG_LIBRARY PNG_PNG_INCLUDE_DIR) find_package_handle_standard_args(PNG
REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR
VERSION_VAR PNG_VERSION_STRING)
mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY ) mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )

@ -19,7 +19,8 @@
# #
# The second mode is more powerful and also supports version checking: # The second mode is more powerful and also supports version checking:
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>] # FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
# [VERSION_VAR <versionvar> # [VERSION_VAR <versionvar>]
# [HANDLE_COMPONENTS]
# [CONFIG_MODE] # [CONFIG_MODE]
# [FAIL_MESSAGE "Custom failure message"] ) # [FAIL_MESSAGE "Custom failure message"] )
# #
@ -32,10 +33,15 @@
# in the find_package() call. The EXACT keyword is also handled. The default # in the find_package() call. The EXACT keyword is also handled. The default
# messages include information about the required version and the version # messages include information about the required version and the version
# which has been actually found, both if the version is ok or not. # which has been actually found, both if the version is ok or not.
# If the package supports components, use the HANDLE_COMPONENTS option to enable
# handling them. In this case, find_package_handle_standard_args() will report
# which components have been found and which are missing, and the <NAME>_FOUND
# variable will be set to FALSE if any of the required components (i.e. not the
# ones listed after OPTIONAL_COMPONENTS) are missing.
# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for # Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
# a find_package(... NO_MODULE) call, in this case all the information # a find_package(... NO_MODULE) call. In this case VERSION_VAR will be set
# provided by the config-mode of find_package() will be evaluated # to <NAME>_VERSION and the macro will automatically check whether the
# automatically. # Config module was found.
# Via FAIL_MESSAGE a custom failure message can be specified, if this is not # Via FAIL_MESSAGE a custom failure message can be specified, if this is not
# used, the default message will be displayed. # used, the default message will be displayed.
# #
@ -128,7 +134,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in # set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
# new extended or in the "old" mode: # new extended or in the "old" mode:
SET(options CONFIG_MODE) SET(options CONFIG_MODE HANDLE_COMPONENTS)
SET(oneValueArgs FAIL_MESSAGE VERSION_VAR) SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
SET(multiValueArgs REQUIRED_VARS) SET(multiValueArgs REQUIRED_VARS)
SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
@ -189,6 +195,36 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
ENDIF(NOT ${_CURRENT_VAR}) ENDIF(NOT ${_CURRENT_VAR})
ENDFOREACH(_CURRENT_VAR) ENDFOREACH(_CURRENT_VAR)
# component handling
UNSET(FOUND_COMPONENTS_MSG)
UNSET(MISSING_COMPONENTS_MSG)
IF(FPHSA_HANDLE_COMPONENTS)
FOREACH(comp ${${_NAME}_FIND_COMPONENTS})
IF(${_NAME}_${comp}_FOUND)
IF(NOT DEFINED FOUND_COMPONENTS_MSG)
SET(FOUND_COMPONENTS_MSG "found components: ")
ENDIF()
SET(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
ELSE()
IF(NOT DEFINED MISSING_COMPONENTS_MSG)
SET(MISSING_COMPONENTS_MSG "missing components: ")
ENDIF()
SET(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
IF(${_NAME}_FIND_REQUIRED_${comp})
SET(${_NAME_UPPER}_FOUND FALSE)
SET(MISSING_VARS "${MISSING_VARS} ${comp}")
ENDIF()
ENDIF()
ENDFOREACH(comp)
SET(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
SET(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
ENDIF(FPHSA_HANDLE_COMPONENTS)
# version handling: # version handling:
SET(VERSION_MSG "") SET(VERSION_MSG "")
@ -240,7 +276,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# print the result: # print the result:
IF (${_NAME_UPPER}_FOUND) IF (${_NAME_UPPER}_FOUND)
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}") FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
ELSE (${_NAME_UPPER}_FOUND) ELSE (${_NAME_UPPER}_FOUND)
IF(FPHSA_CONFIG_MODE) IF(FPHSA_CONFIG_MODE)

@ -3,6 +3,7 @@
# #
# PERL_EXECUTABLE - the full path to perl # PERL_EXECUTABLE - the full path to perl
# PERL_FOUND - If false, don't attempt to use perl. # PERL_FOUND - If false, don't attempt to use perl.
# PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
#============================================================================= #=============================================================================
# Copyright 2001-2009 Kitware, Inc. # Copyright 2001-2009 Kitware, Inc.
@ -39,12 +40,44 @@ FIND_PROGRAM(PERL_EXECUTABLE
PATHS ${PERL_POSSIBLE_BIN_PATHS} PATHS ${PERL_POSSIBLE_BIN_PATHS}
) )
IF(PERL_EXECUTABLE)
### PERL_VERSION
EXECUTE_PROCESS(
COMMAND
${PERL_EXECUTABLE} -V:version
OUTPUT_VARIABLE
PERL_VERSION_OUTPUT_VARIABLE
RESULT_VARIABLE
PERL_VERSION_RESULT_VARIABLE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
IF(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'")
STRING(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
ELSE()
EXECUTE_PROCESS(
COMMAND ${PERL_EXECUTABLE} -v
OUTPUT_VARIABLE PERL_VERSION_OUTPUT_VARIABLE
RESULT_VARIABLE PERL_VERSION_RESULT_VARIABLE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
IF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
STRING(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
ELSEIF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
STRING(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
ENDIF()
ENDIF()
ENDIF(PERL_EXECUTABLE)
# Deprecated settings for compatibility with CMake1.4 # Deprecated settings for compatibility with CMake1.4
SET(PERL ${PERL_EXECUTABLE}) SET(PERL ${PERL_EXECUTABLE})
# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl DEFAULT_MSG PERL_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl
REQUIRED_VARS PERL_EXECUTABLE
VERSION_VAR PERL_VERSION_STRING)
MARK_AS_ADVANCED(PERL_EXECUTABLE) MARK_AS_ADVANCED(PERL_EXECUTABLE)

@ -55,19 +55,6 @@ if (PERL_EXECUTABLE)
string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE}) string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE})
endif (NOT PERL_PREFIX_RESULT_VARIABLE) endif (NOT PERL_PREFIX_RESULT_VARIABLE)
### PERL_VERSION
execute_process(
COMMAND
${PERL_EXECUTABLE} -V:version
OUTPUT_VARIABLE
PERL_VERSION_OUTPUT_VARIABLE
RESULT_VARIABLE
PERL_VERSION_RESULT_VARIABLE
)
if (NOT PERL_VERSION_RESULT_VARIABLE)
string(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION ${PERL_VERSION_OUTPUT_VARIABLE})
endif (NOT PERL_VERSION_RESULT_VARIABLE)
### PERL_ARCHNAME ### PERL_ARCHNAME
execute_process( execute_process(
COMMAND COMMAND
@ -107,6 +94,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_SITESEARCH_RESULT_VARIABLE) if (NOT PERL_SITESEARCH_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH)
endif (NOT PERL_SITESEARCH_RESULT_VARIABLE) endif (NOT PERL_SITESEARCH_RESULT_VARIABLE)
### PERL_SITELIB ### PERL_SITELIB
@ -120,6 +108,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_SITELIB_RESULT_VARIABLE) if (NOT PERL_SITELIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB)
endif (NOT PERL_SITELIB_RESULT_VARIABLE) endif (NOT PERL_SITELIB_RESULT_VARIABLE)
### PERL_VENDORARCH ### PERL_VENDORARCH
@ -133,6 +122,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_VENDORARCH_RESULT_VARIABLE) if (NOT PERL_VENDORARCH_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH)
endif (NOT PERL_VENDORARCH_RESULT_VARIABLE) endif (NOT PERL_VENDORARCH_RESULT_VARIABLE)
### PERL_VENDORLIB ### PERL_VENDORLIB
@ -146,6 +136,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_VENDORLIB_RESULT_VARIABLE) if (NOT PERL_VENDORLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
endif (NOT PERL_VENDORLIB_RESULT_VARIABLE) endif (NOT PERL_VENDORLIB_RESULT_VARIABLE)
macro(perl_adjust_darwin_lib_variable varname) macro(perl_adjust_darwin_lib_variable varname)
@ -186,6 +177,7 @@ if (PERL_EXECUTABLE)
if (NOT PERL_ARCHLIB_RESULT_VARIABLE) if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
perl_adjust_darwin_lib_variable( ARCHLIB ) perl_adjust_darwin_lib_variable( ARCHLIB )
file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
endif (NOT PERL_ARCHLIB_RESULT_VARIABLE) endif (NOT PERL_ARCHLIB_RESULT_VARIABLE)
### PERL_PRIVLIB ### PERL_PRIVLIB
@ -200,28 +192,10 @@ if (PERL_EXECUTABLE)
if (NOT PERL_PRIVLIB_RESULT_VARIABLE) if (NOT PERL_PRIVLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
perl_adjust_darwin_lib_variable( PRIVLIB ) perl_adjust_darwin_lib_variable( PRIVLIB )
file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB)
endif (NOT PERL_PRIVLIB_RESULT_VARIABLE) endif (NOT PERL_PRIVLIB_RESULT_VARIABLE)
### PERL_POSSIBLE_LIBRARY_NAMES
### PERL_POSSIBLE_INCLUDE_PATHS
set(PERL_POSSIBLE_INCLUDE_PATHS
${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION}/CORE
/usr/lib/perl/${PERL_VERSION}/CORE
)
### PERL_POSSIBLE_LIB_PATHS
set(PERL_POSSIBLE_LIB_PATHS
${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION}/CORE
/usr/lib/perl/${PERL_VERSION}/CORE
)
### PERL_POSSIBLE_LIBRARY_NAME
execute_process( execute_process(
COMMAND COMMAND
${PERL_EXECUTABLE} -V:libperl ${PERL_EXECUTABLE} -V:libperl
@ -231,10 +205,9 @@ if (PERL_EXECUTABLE)
PERL_LIBRARY_RESULT_VARIABLE PERL_LIBRARY_RESULT_VARIABLE
) )
if (NOT PERL_LIBRARY_RESULT_VARIABLE) if (NOT PERL_LIBRARY_RESULT_VARIABLE)
foreach(_perl_lib_path ${PERL_POSSIBLE_LIB_PATHS}) string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE})
string(REGEX REPLACE "libperl='([^']+)'" "\\1" PERL_LIBRARY_OUTPUT_VARIABLE ${PERL_LIBRARY_OUTPUT_VARIABLE}) else (NOT PERL_LIBRARY_RESULT_VARIABLE)
set(PERL_POSSIBLE_LIBRARY_NAME ${PERL_POSSIBLE_LIBRARY_NAME} "${_perl_lib_path}/${PERL_LIBRARY_OUTPUT_VARIABLE}") set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
endforeach(_perl_lib_path ${PERL_POSSIBLE_LIB_PATHS})
endif (NOT PERL_LIBRARY_RESULT_VARIABLE) endif (NOT PERL_LIBRARY_RESULT_VARIABLE)
### PERL_INCLUDE_PATH ### PERL_INCLUDE_PATH
@ -242,17 +215,23 @@ if (PERL_EXECUTABLE)
NAMES NAMES
perl.h perl.h
PATHS PATHS
${PERL_POSSIBLE_INCLUDE_PATHS} ${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/CORE
) )
### PERL_LIBRARY ### PERL_LIBRARY
find_library(PERL_LIBRARY find_library(PERL_LIBRARY
NAMES NAMES
${PERL_POSSIBLE_LIBRARY_NAME} ${PERL_POSSIBLE_LIBRARY_NAMES}
perl${PERL_VERSION}
perl
PATHS PATHS
${PERL_POSSIBLE_LIB_PATHS} ${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/CORE
) )
endif (PERL_EXECUTABLE) endif (PERL_EXECUTABLE)
@ -261,15 +240,16 @@ endif (PERL_EXECUTABLE)
# all listed variables are TRUE # all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
VERSION_VAR PERL_VERSION) VERSION_VAR PERL_VERSION_STRING)
# Introduced after CMake 2.6.4 to bring module into compliance # Introduced after CMake 2.6.4 to bring module into compliance
set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH}) set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH})
set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH}) set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH})
set(PERL_LIBRARIES ${PERL_LIBRARY}) set(PERL_LIBRARIES ${PERL_LIBRARY})
# For backward compatibility with CMake before 2.8.8
set(PERL_VERSION ${PERL_VERSION_STRING})
mark_as_advanced( mark_as_advanced(
PERL_INCLUDE_PATH PERL_INCLUDE_PATH
PERL_EXECUTABLE
PERL_LIBRARY PERL_LIBRARY
) )

@ -15,12 +15,15 @@
# It sets the following variables: # It sets the following variables:
# PKG_CONFIG_FOUND ... true if pkg-config works on the system # PKG_CONFIG_FOUND ... true if pkg-config works on the system
# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program # PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
# <PREFIX>_FOUND ... set to 1 if module(s) exist # PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
# (since CMake 2.8.8)
# PKG_CONFIG_FOUND ... if pkg-config executable was found
# #
# For the following variables two sets of values exist; first one is the # For the following variables two sets of values exist; first one is the
# common one and has the given PREFIX. The second set contains flags # common one and has the given PREFIX. The second set contains flags
# which are given out when pkgconfig was called with the '--static' # which are given out when pkgconfig was called with the '--static'
# option. # option.
# <XPREFIX>_FOUND ... set to 1 if module(s) exist
# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l') # <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') # <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
# <XPREFIX>_LDFLAGS ... all required linker flags # <XPREFIX>_LDFLAGS ... all required linker flags
@ -85,15 +88,21 @@
### Common stuff #### ### Common stuff ####
set(PKG_CONFIG_VERSION 1) set(PKG_CONFIG_VERSION 1)
set(PKG_CONFIG_FOUND 0)
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
mark_as_advanced(PKG_CONFIG_EXECUTABLE) mark_as_advanced(PKG_CONFIG_EXECUTABLE)
if (PKG_CONFIG_EXECUTABLE) if (PKG_CONFIG_EXECUTABLE)
set(PKG_CONFIG_FOUND 1) execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --version
OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif (PKG_CONFIG_EXECUTABLE) endif (PKG_CONFIG_EXECUTABLE)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PkgConfig
REQUIRED_VARS PKG_CONFIG_EXECUTABLE
VERSION_VAR PKG_CONFIG_VERSION_STRING)
# Unsets the given variables # Unsets the given variables
macro(_pkgconfig_unset var) macro(_pkgconfig_unset var)

@ -1,20 +1,11 @@
# - Find the PostgreSQL installation. # - Find the PostgreSQL installation.
# Usage:
# In your CMakeLists.txt file do something like this:
# ...
# # PostgreSQL
# FIND_PACKAGE(PostgreSQL)
# ...
# if( PostgreSQL_FOUND )
# include_directories(${PostgreSQL_INCLUDE_DIRS})
# endif( PostgreSQL_FOUND )
# ...
# Remember to include ${PostgreSQL_LIBRARIES} in the target_link_libraries() statement.
#
#
# In Windows, we make the assumption that, if the PostgreSQL files are installed, the default directory # In Windows, we make the assumption that, if the PostgreSQL files are installed, the default directory
# will be C:\Program Files\PostgreSQL. # will be C:\Program Files\PostgreSQL.
# #
# This module defines
# PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking
# PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers
# PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8)
#============================================================================= #=============================================================================
# Copyright 2004-2009 Kitware, Inc. # Copyright 2004-2009 Kitware, Inc.
@ -150,11 +141,20 @@ find_library( PostgreSQL_LIBRARY
) )
get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH) get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
if (PostgreSQL_INCLUDE_DIR AND EXISTS "${PostgreSQL_INCLUDE_DIR}/pg_config.h")
file(STRINGS "${PostgreSQL_INCLUDE_DIR}/pg_config.h" pgsql_version_str
REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
PostgreSQL_VERSION_STRING "${pgsql_version_str}")
unset(pgsql_version_str)
endif()
# Did we find anything? # Did we find anything?
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PostgreSQL DEFAULT_MSG find_package_handle_standard_args(PostgreSQL
PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR) REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR
VERSION_VAR PostgreSQL_VERSION_STRING)
set( PostgreSQL_FOUND ${POSTGRESQL_FOUND}) set( PostgreSQL_FOUND ${POSTGRESQL_FOUND})
# Now try to get the include and library path. # Now try to get the include and library path.

@ -7,6 +7,9 @@
# (vsprojects/Debug & vsprojects/Release) will be searched # (vsprojects/Debug & vsprojects/Release) will be searched
# for libraries and binaries. # for libraries and binaries.
# #
# PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for
# imported .proto files. (New in CMake 2.8.8)
#
# Defines the following variables: # Defines the following variables:
# #
# PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files) # PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files)
@ -91,6 +94,16 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
if(DEFINED PROTOBUF_IMPORT_DIRS)
foreach(DIR ${PROTOBUF_IMPORT_DIRS})
get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
if(${_contains_already} EQUAL -1)
list(APPEND _protobuf_include_path -I ${ABS_PATH})
endif()
endforeach()
endif()
set(${SRCS}) set(${SRCS})
set(${HDRS}) set(${HDRS})
foreach(FIL ${ARGN}) foreach(FIL ${ARGN})

@ -10,11 +10,14 @@
# PYTHON_VERSION_MINOR - Python minor version found e.g. 5 # PYTHON_VERSION_MINOR - Python minor version found e.g. 5
# PYTHON_VERSION_PATCH - Python patch version found e.g. 2 # PYTHON_VERSION_PATCH - Python patch version found e.g. 2
# #
# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for # The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of
# version numbers that should be taken into account when searching for Python.
# You need to set this variable before calling find_package(PythonInterp).
#============================================================================= #=============================================================================
# Copyright 2005-2010 Kitware, Inc. # Copyright 2005-2010 Kitware, Inc.
# Copyright 2011 Bjoern Ricks <bjoern.ricks@gmail.com> # Copyright 2011 Bjoern Ricks <bjoern.ricks@gmail.com>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -26,14 +29,51 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
if(PythonInterp_FIND_VERSION)
if(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION}")
string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ})
unset(_PYTHON_FIND_OTHER_VERSIONS)
if(NOT PythonInterp_FIND_VERSION_EXACT)
foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
endif()
endforeach()
endif(NOT PythonInterp_FIND_VERSION_EXACT)
unset(_PYTHON_FIND_MAJ_MIN)
unset(_PYTHON_FIND_MAJ)
else(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION})
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS})
endif(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
else(PythonInterp_FIND_VERSION)
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
endif(PythonInterp_FIND_VERSION)
list(APPEND _Python_NAMES python)
# Search for the current active python version first # Search for the current active python version first
find_program(PYTHON_EXECUTABLE NAMES python) find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
# Set up the versions we know about, in the order we will search. Always add # Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front. # the user supplied additional versions to the front.
set(_Python_VERSIONS set(_Python_VERSIONS
${Python_ADDITIONAL_VERSIONS} ${Python_ADDITIONAL_VERSIONS}
2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) ${_PYTHON_FIND_OTHER_VERSIONS}
)
unset(_PYTHON_FIND_OTHER_VERSIONS)
unset(_PYTHON1_VERSIONS)
unset(_PYTHON2_VERSIONS)
unset(_PYTHON3_VERSIONS)
# Search for newest python version if python executable isn't found # Search for newest python version if python executable isn't found
if(NOT PYTHON_EXECUTABLE) if(NOT PYTHON_EXECUTABLE)
@ -51,12 +91,47 @@ endif()
# determine python version string # determine python version string
if(PYTHON_EXECUTABLE) if(PYTHON_EXECUTABLE)
execute_process(COMMAND "${PYTHON_EXECUTABLE}" --version ERROR_VARIABLE _VERSION OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
string(REPLACE "Python " "" PYTHON_VERSION_STRING "${_VERSION}") "import sys; sys.stdout.write(';'.join([str(x) for x in sys.version_info[:3]]))"
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}") OUTPUT_VARIABLE _VERSION
string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}") RESULT_VARIABLE _PYTHON_VERSION_RESULT
ERROR_QUIET)
if(NOT _PYTHON_VERSION_RESULT)
string(REPLACE ";" "." PYTHON_VERSION_STRING "${_VERSION}")
list(GET _VERSION 0 PYTHON_VERSION_MAJOR)
list(GET _VERSION 1 PYTHON_VERSION_MINOR)
list(GET _VERSION 2 PYTHON_VERSION_PATCH)
if(PYTHON_VERSION_PATCH EQUAL 0)
# it's called "Python 2.7", not "2.7.0"
string(REGEX REPLACE "\\.0$" "" PYTHON_VERSION_STRING "${PYTHON_VERSION_STRING}")
endif()
else()
# sys.version predates sys.version_info, so use that
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; sys.stdout.write(sys.version)"
OUTPUT_VARIABLE _VERSION
RESULT_VARIABLE _PYTHON_VERSION_RESULT
ERROR_QUIET)
if(NOT _PYTHON_VERSION_RESULT)
string(REGEX REPLACE " .*" "" PYTHON_VERSION_STRING "${_VERSION}")
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9])+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}")
if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+.*")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}") string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}")
else()
set(PYTHON_VERSION_PATCH "0")
endif()
else()
# sys.version was first documented for Python 1.5, so assume
# this is older.
set(PYTHON_VERSION_STRING "1.4")
set(PYTHON_VERSION_MAJOR "1")
set(PYTHON_VERSION_MAJOR "4")
set(PYTHON_VERSION_MAJOR "0")
endif()
endif() endif()
unset(_PYTHON_VERSION_RESULT)
unset(_VERSION)
endif(PYTHON_EXECUTABLE)
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE

@ -7,8 +7,12 @@
# PYTHON_LIBRARIES - path to the python library # PYTHON_LIBRARIES - path to the python library
# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated) # PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
# PYTHON_INCLUDE_DIRS - path to where Python.h is found # PYTHON_INCLUDE_DIRS - path to where Python.h is found
# PYTHON_DEBUG_LIBRARIES - path to the debug library # PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for # PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
#
# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of
# version numbers that should be taken into account when searching for Python.
# You need to set this variable before calling find_package(PythonLibs).
#============================================================================= #=============================================================================
# Copyright 2001-2009 Kitware, Inc. # Copyright 2001-2009 Kitware, Inc.
@ -27,11 +31,42 @@ INCLUDE(CMakeFindFrameworks)
# Search for the python framework on Apple. # Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python) CMAKE_FIND_FRAMEWORKS(Python)
SET(_PYTHON1_VERSIONS 1.6 1.5)
SET(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
SET(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
IF(PythonLibs_FIND_VERSION)
IF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
UNSET(_PYTHON_FIND_OTHER_VERSIONS)
IF(NOT PythonLibs_FIND_VERSION_EXACT)
FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
ENDIF()
ENDFOREACH()
ENDIF(NOT PythonLibs_FIND_VERSION_EXACT)
UNSET(_PYTHON_FIND_MAJ_MIN)
UNSET(_PYTHON_FIND_MAJ)
ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
ENDIF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
ELSE(PythonLibs_FIND_VERSION)
SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
ENDIF(PythonLibs_FIND_VERSION)
# Set up the versions we know about, in the order we will search. Always add # Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front. # the user supplied additional versions to the front.
set(_Python_VERSIONS SET(_Python_VERSIONS
${Python_ADDITIONAL_VERSIONS} ${Python_ADDITIONAL_VERSIONS}
2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) ${_PYTHON_FIND_OTHER_VERSIONS}
)
UNSET(_PYTHON_FIND_OTHER_VERSIONS)
UNSET(_PYTHON1_VERSIONS)
UNSET(_PYTHON2_VERSIONS)
UNSET(_PYTHON3_VERSIONS)
FOREACH(_CURRENT_VERSION ${_Python_VERSIONS}) FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION}) STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
@ -40,13 +75,17 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
PATHS PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs ) [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
)
ENDIF(WIN32) ENDIF(WIN32)
FIND_LIBRARY(PYTHON_LIBRARY FIND_LIBRARY(PYTHON_LIBRARY
NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
PATHS PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
# Avoid finding the .dll in the PATH. We want the .lib. # Avoid finding the .dll in the PATH. We want the .lib.
NO_SYSTEM_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
) )
@ -79,6 +118,7 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
PATHS PATHS
${PYTHON_FRAMEWORK_INCLUDES} ${PYTHON_FRAMEWORK_INCLUDES}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
PATH_SUFFIXES PATH_SUFFIXES
python${_CURRENT_VERSION} python${_CURRENT_VERSION}
) )
@ -87,6 +127,17 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL
"Path to where Python.h is found (deprecated)") "Path to where Python.h is found (deprecated)")
IF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
STRING(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
PYTHONLIBS_VERSION_STRING "${python_version_str}")
UNSET(python_version_str)
ENDIF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
BREAK()
ENDIF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
ENDFOREACH(_CURRENT_VERSION) ENDFOREACH(_CURRENT_VERSION)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
@ -100,13 +151,23 @@ MARK_AS_ADVANCED(
# library. We now set the variables listed by the documentation for this # library. We now set the variables listed by the documentation for this
# module. # module.
SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
# These variables have been historically named in this module different from
# what SELECT_LIBRARY_CONFIGURATIONS() expects.
SET(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
SET(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
# Unset this, this prefix doesn't match the module prefix, they are different
# for historical reasons.
UNSET(PYTHON_FOUND)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
VERSION_VAR PYTHONLIBS_VERSION_STRING)
# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python. # PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include # PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include

@ -5,6 +5,7 @@
# QT_DEFINITIONS - definitions to use when # QT_DEFINITIONS - definitions to use when
# compiling code that uses Qt. # compiling code that uses Qt.
# QT_FOUND - If false, don't try to use Qt. # QT_FOUND - If false, don't try to use Qt.
# QT_VERSION_STRING - the version of Qt found
# #
# If you need the multithreaded version of Qt, set QT_MT_REQUIRED to TRUE # If you need the multithreaded version of Qt, set QT_MT_REQUIRED to TRUE
# #
@ -46,13 +47,16 @@ IF(QT4_FOUND)
ENDIF(QT4_FOUND) ENDIF(QT4_FOUND)
FILE(GLOB GLOB_PATHS_BIN /usr/lib/qt-3*/bin/) FILE(GLOB GLOB_PATHS /usr/lib/qt-3*)
FOREACH(GLOB_PATH ${GLOB_PATHS})
LIST(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin")
ENDFOREACH(GLOB_PATH)
FIND_PATH(QT_INCLUDE_DIR qt.h FIND_PATH(QT_INCLUDE_DIR qt.h
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
$ENV{QTDIR}/include $ENV{QTDIR}/include
${GLOB_PATHS_BIN} ${GLOB_PATHS}
/usr/local/qt/include /usr/local/qt/include
/usr/lib/qt/include /usr/lib/qt/include
/usr/lib/qt3/include /usr/lib/qt3/include
@ -71,12 +75,13 @@ ENDIF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
IF(QT_INCLUDE_DIR) IF(QT_INCLUDE_DIR)
#extract the version string from qglobal.h #extract the version string from qglobal.h
FILE(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H) FILE(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H)
STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"([0-9]+.[0-9]+.[0-9]+)\"" QGLOBAL_H "${QGLOBAL_H}") STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"" QGLOBAL_H "${QGLOBAL_H}")
STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+)\".*" "\\1" qt_version_str "${QGLOBAL_H}") STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}")
# Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the # Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the
# version X.Y.Z, so we need to remove the dots from version # version X.Y.Z, so we need to remove the dots from version
STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}") STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
SET(QT_VERSION_STRING "${qt_version_str}")
ENDIF(QT_INCLUDE_DIR) ENDIF(QT_INCLUDE_DIR)
FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/) FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
@ -183,67 +188,28 @@ ENDIF(QT_UIC_EXECUTABLE)
IF (WIN32) IF (WIN32)
FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain
HINTS
$ENV{QTDIR}/lib
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
PATHS
"$ENV{ProgramFiles}/qt/lib" "$ENV{ProgramFiles}/qt/lib"
$ENV{QTDIR}/lib "C:/Program Files/qt/lib" "C:/Program Files/qt/lib"
DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise." DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
) )
ENDIF (WIN32) ENDIF (WIN32)
#support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
IF (QT_MIN_VERSION) IF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
SET(Qt3_FIND_VERSION ${QT_MIN_VERSION})
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" qt_major_vers "${qt_version_str}") ENDIF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" qt_minor_vers "${qt_version_str}")
STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" qt_patch_vers "${qt_version_str}")
#now parse the parts of the user given version string into variables
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" req_qt_major_vers "${QT_MIN_VERSION}")
IF (NOT req_qt_major_vers)
error_message( "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"3.1.5\"")
ENDIF (NOT req_qt_major_vers)
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}")
STRING(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
# req = "6.5.4", qt = "3.2.1"
MACRO(error_message msg)
IF(QT3_REQUIRED)
MESSAGE( FATAL_ERROR ${msg})
ELSE(QT3_REQUIRED)
MESSAGE( STATUS ${msg})
ENDIF(QT3_REQUIRED)
ENDMACRO(error_message)
IF (req_qt_major_vers GREATER qt_major_vers) # (6 > 3) ?
ERROR_MESSAGE( "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ELSE (req_qt_major_vers GREATER qt_major_vers) # no
IF (req_qt_major_vers LESS qt_major_vers) # (6 < 3) ?
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
ELSE (req_qt_major_vers LESS qt_major_vers) # ( 6==3) ?
IF (req_qt_minor_vers GREATER qt_minor_vers) # (5>2) ?
ERROR_MESSAGE( "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ELSE (req_qt_minor_vers GREATER qt_minor_vers) # no
IF (req_qt_minor_vers LESS qt_minor_vers) # (5<2) ?
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
ELSE (req_qt_minor_vers LESS qt_minor_vers) # (5==2)
IF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
ERROR_MESSAGE( "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ELSE (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
ENDIF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
ENDIF (req_qt_minor_vers LESS qt_minor_vers)
ENDIF (req_qt_minor_vers GREATER qt_minor_vers)
ENDIF (req_qt_major_vers LESS qt_major_vers)
ENDIF (req_qt_major_vers GREATER qt_major_vers)
ENDIF (QT_MIN_VERSION)
# if the include a library are found then we have it # if the include a library are found then we have it
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 DEFAULT_MSG QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3
REQUIRED_VARS QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE
VERSION_VAR QT_VERSION_STRING)
SET(QT_FOUND ${QT3_FOUND} ) SET(QT_FOUND ${QT3_FOUND} )
IF(QT_FOUND) IF(QT_FOUND)
@ -293,8 +259,16 @@ IF(QT_FOUND)
ENDIF(QT_QT_LIBRARY MATCHES "qt-mt") ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
ENDIF(QT_FOUND) ENDIF(QT_FOUND)
EXEC_PROGRAM(${QT_MOC_EXECUTABLE} ARGS "-v" OUTPUT_VARIABLE QTVERSION_MOC) IF(QT_MOC_EXECUTABLE)
EXEC_PROGRAM(${QT_UIC_EXECUTABLE} ARGS "-version" OUTPUT_VARIABLE QTVERSION_UIC) EXECUTE_PROCESS(COMMAND ${QT_MOC_EXECUTABLE} "-v"
OUTPUT_VARIABLE QTVERSION_MOC
ERROR_QUIET)
ENDIF(QT_MOC_EXECUTABLE)
IF(QT_UIC_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${QT_UIC_EXECUTABLE} "-version"
OUTPUT_VARIABLE QTVERSION_UIC
ERROR_QUIET)
ENDIF(QT_UIC_EXECUTABLE)
SET(_QT_UIC_VERSION_3 FALSE) SET(_QT_UIC_VERSION_3 FALSE)
IF("${QTVERSION_UIC}" MATCHES ".* 3..*") IF("${QTVERSION_UIC}" MATCHES ".* 3..*")

@ -588,8 +588,9 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
SET(QT_QTCORE_FOUND 1) SET(QT_QTCORE_FOUND 1)
ELSE() ELSE()
MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}") MESSAGE(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" "
MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly, or it wasn't found for cross compiling.") "but QtCore could not be found there. "
"Qt is NOT installed correctly for the target build environment.")
IF(Qt4_FIND_REQUIRED) IF(Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
ENDIF(Qt4_FIND_REQUIRED) ENDIF(Qt4_FIND_REQUIRED)

@ -60,50 +60,45 @@ ENDIF("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
FIND_PROGRAM(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}) FIND_PROGRAM(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
IF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION) IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
# query the ruby version FUNCTION(_RUBY_CONFIG_VAR RBVAR OUTVAR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MAJOR']" EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
OUTPUT_VARIABLE RUBY_VERSION_MAJOR) RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
IF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
ENDIF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
SET(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
ENDFUNCTION(_RUBY_CONFIG_VAR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MINOR']"
OUTPUT_VARIABLE RUBY_VERSION_MINOR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['TEENY']" # query the ruby version
OUTPUT_VARIABLE RUBY_VERSION_PATCH) _RUBY_CONFIG_VAR("MAJOR" RUBY_VERSION_MAJOR)
_RUBY_CONFIG_VAR("MINOR" RUBY_VERSION_MINOR)
_RUBY_CONFIG_VAR("TEENY" RUBY_VERSION_PATCH)
# query the different directories # query the different directories
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['archdir']" _RUBY_CONFIG_VAR("archdir" RUBY_ARCH_DIR)
OUTPUT_VARIABLE RUBY_ARCH_DIR) _RUBY_CONFIG_VAR("arch" RUBY_ARCH)
_RUBY_CONFIG_VAR("rubyhdrdir" RUBY_HDR_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['arch']" _RUBY_CONFIG_VAR("libdir" RUBY_POSSIBLE_LIB_DIR)
OUTPUT_VARIABLE RUBY_ARCH) _RUBY_CONFIG_VAR("rubylibdir" RUBY_RUBY_LIB_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubyhdrdir']"
OUTPUT_VARIABLE RUBY_HDR_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['libdir']"
OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']"
OUTPUT_VARIABLE RUBY_RUBY_LIB_DIR)
# site_ruby # site_ruby
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']" _RUBY_CONFIG_VAR("sitearchdir" RUBY_SITEARCH_DIR)
OUTPUT_VARIABLE RUBY_SITEARCH_DIR) _RUBY_CONFIG_VAR("sitelibdir" RUBY_SITELIB_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']"
OUTPUT_VARIABLE RUBY_SITELIB_DIR)
# vendor_ruby available ? # vendor_ruby available ?
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'" EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET) OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET)
IF(RUBY_HAS_VENDOR_RUBY) IF(RUBY_HAS_VENDOR_RUBY)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorlibdir']" _RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR)
OUTPUT_VARIABLE RUBY_VENDORLIB_DIR) _RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)
ENDIF(RUBY_HAS_VENDOR_RUBY) ENDIF(RUBY_HAS_VENDOR_RUBY)
# save the results in the cache so we don't have to run ruby the next time again # save the results in the cache so we don't have to run ruby the next time again
@ -135,11 +130,11 @@ IF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION)
RUBY_VERSION_MINOR RUBY_VERSION_MINOR
RUBY_VERSION_PATCH RUBY_VERSION_PATCH
) )
ENDIF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION) ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
# In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling) # In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling)
# try to detect which version we found. This is not too good. # try to detect which version we found. This is not too good.
IF(NOT RUBY_VERSION_MAJOR) IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
# by default assume 1.8.0 # by default assume 1.8.0
SET(RUBY_VERSION_MAJOR 1) SET(RUBY_VERSION_MAJOR 1)
SET(RUBY_VERSION_MINOR 8) SET(RUBY_VERSION_MINOR 8)
@ -149,13 +144,14 @@ IF(NOT RUBY_VERSION_MAJOR)
SET(RUBY_VERSION_MAJOR 1) SET(RUBY_VERSION_MAJOR 1)
SET(RUBY_VERSION_MINOR 9) SET(RUBY_VERSION_MINOR 9)
ENDIF(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR) ENDIF(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR)
ENDIF(NOT RUBY_VERSION_MAJOR) ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
IF(RUBY_VERSION_MAJOR)
SET(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}") SET(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}")
SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}") SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}") SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}") SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
ENDIF(RUBY_VERSION_MAJOR)
FIND_PATH(RUBY_INCLUDE_DIR FIND_PATH(RUBY_INCLUDE_DIR
NAMES ruby.h NAMES ruby.h
@ -167,7 +163,7 @@ FIND_PATH(RUBY_INCLUDE_DIR
SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} ) SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} )
# if ruby > 1.8 is required or if ruby > 1.8 was found, search for the config.h dir # if ruby > 1.8 is required or if ruby > 1.8 was found, search for the config.h dir
IF( ${Ruby_FIND_VERSION_SHORT_NODOT} GREATER 18 OR ${_RUBY_VERSION_SHORT_NODOT} GREATER 18 OR RUBY_HDR_DIR) IF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR)
FIND_PATH(RUBY_CONFIG_INCLUDE_DIR FIND_PATH(RUBY_CONFIG_INCLUDE_DIR
NAMES ruby/config.h config.h NAMES ruby/config.h config.h
HINTS HINTS
@ -176,11 +172,11 @@ IF( ${Ruby_FIND_VERSION_SHORT_NODOT} GREATER 18 OR ${_RUBY_VERSION_SHORT_NODOT
) )
SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} ) SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} )
ENDIF( ${Ruby_FIND_VERSION_SHORT_NODOT} GREATER 18 OR ${_RUBY_VERSION_SHORT_NODOT} GREATER 18 OR RUBY_HDR_DIR) ENDIF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR)
# Determine the list of possible names for the ruby library # Determine the list of possible names for the ruby library
SET(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT}) SET(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION})
IF(WIN32) IF(WIN32)
SET( _RUBY_MSVC_RUNTIME "" ) SET( _RUBY_MSVC_RUNTIME "" )
@ -224,6 +220,10 @@ IF(_RUBY_DEBUG_OUTPUT)
MESSAGE(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}") MESSAGE(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}")
MESSAGE(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"") MESSAGE(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"")
MESSAGE(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}") MESSAGE(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}")
MESSAGE(STATUS "RUBY_EXECUTABLE: ${RUBY_EXECUTABLE}")
MESSAGE(STATUS "RUBY_LIBRARY: ${RUBY_LIBRARY}")
MESSAGE(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}")
MESSAGE(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}")
MESSAGE(STATUS "--------------------") MESSAGE(STATUS "--------------------")
ENDIF(_RUBY_DEBUG_OUTPUT) ENDIF(_RUBY_DEBUG_OUTPUT)

@ -81,7 +81,6 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
/opt/csw # Blastwave /opt/csw # Blastwave
/opt /opt
) )
#MESSAGE("SDL_INCLUDE_DIR is ${SDL_INCLUDE_DIR}")
# SDL-1.1 is the name used by FreeBSD ports... # SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number. # don't confuse it for the version number.
@ -97,8 +96,6 @@ FIND_LIBRARY(SDL_LIBRARY_TEMP
/opt /opt
) )
#MESSAGE("SDL_LIBRARY_TEMP is ${SDL_LIBRARY_TEMP}")
IF(NOT SDL_BUILDING_LIBRARY) IF(NOT SDL_BUILDING_LIBRARY)
IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to # Non-OS X framework versions expect you to also dynamically link to
@ -134,7 +131,6 @@ IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW) ENDIF(MINGW)
SET(SDL_FOUND "NO")
IF(SDL_LIBRARY_TEMP) IF(SDL_LIBRARY_TEMP)
# For SDLmain # For SDLmain
IF(NOT SDL_BUILDING_LIBRARY) IF(NOT SDL_BUILDING_LIBRARY)
@ -169,9 +165,9 @@ IF(SDL_LIBRARY_TEMP)
SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP) ENDIF(SDL_LIBRARY_TEMP)
#MESSAGE("SDL_LIBRARY is ${SDL_LIBRARY}") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR)

@ -68,8 +68,7 @@ FIND_LIBRARY(SDLIMAGE_LIBRARY
/opt /opt
) )
SET(SDLIMAGE_FOUND "NO") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR)
SET(SDLIMAGE_FOUND "YES")
ENDIF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR)

@ -68,8 +68,7 @@ FIND_LIBRARY(SDLMIXER_LIBRARY
/opt /opt
) )
SET(SDLMIXER_FOUND "NO") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR)
SET(SDLMIXER_FOUND "YES")
ENDIF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER
REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR)

@ -67,8 +67,7 @@ FIND_LIBRARY(SDLNET_LIBRARY
/opt /opt
) )
SET(SDLNET_FOUND "NO") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)
SET(SDLNET_FOUND "YES")
ENDIF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR)

@ -114,7 +114,6 @@ FIND_LIBRARY(SDL_SOUND_LIBRARY
/opt/lib /opt/lib
) )
SET(SDL_SOUND_FOUND "NO")
IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS # CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS
@ -414,8 +413,9 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
ENDIF(NOT MY_RESULT) ENDIF(NOT MY_RESULT)
SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries") SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
SET(SDL_SOUND_FOUND "YES")
ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# MESSAGE("SDL_SOUND_LIBRARIES is ${SDL_SOUND_LIBRARIES}") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND
REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR)

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save