Merge commit 'upstream/2.8.5_rc2'
This commit is contained in:
commit
73497febcf
@ -1,6 +1,6 @@
|
||||
#=============================================================================
|
||||
# CMake - Cross Platform Makefile Generator
|
||||
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
||||
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@ -9,12 +9,9 @@
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
|
||||
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
|
||||
PROJECT(CMake)
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
|
||||
IF(CMAKE_BOOTSTRAP)
|
||||
# Running from bootstrap script. Set local variable and remove from cache.
|
||||
@ -22,20 +19,8 @@ IF(CMAKE_BOOTSTRAP)
|
||||
UNSET(CMAKE_BOOTSTRAP CACHE)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
|
||||
|
||||
# Allow empty endif() and such with CMake 2.4.
|
||||
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1)
|
||||
|
||||
SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
|
||||
|
||||
IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
|
||||
# Since the built CMake will install itself instead of the
|
||||
# generating CMake, tell it that the install rules were generated
|
||||
# by CMake 2.4.
|
||||
INSTALL(CODE "SET(CMAKE_INSTALL_SELF_2_4 1)")
|
||||
ENDIF()
|
||||
|
||||
IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||
# Disallow architecture-specific try_run. It may not run on the host.
|
||||
MACRO(TRY_RUN)
|
||||
@ -340,6 +325,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
|
||||
IF(NOT LibArchive_FOUND)
|
||||
MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
|
||||
ENDIF()
|
||||
SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
|
||||
SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
|
||||
ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
|
||||
SET(HAVE_LIBZ 1)
|
||||
@ -430,9 +416,9 @@ ENDIF()
|
||||
# The CMake version number.
|
||||
SET(CMake_VERSION_MAJOR 2)
|
||||
SET(CMake_VERSION_MINOR 8)
|
||||
SET(CMake_VERSION_PATCH 4)
|
||||
SET(CMake_VERSION_PATCH 5)
|
||||
SET(CMake_VERSION_TWEAK 0)
|
||||
#SET(CMake_VERSION_RC 2)
|
||||
SET(CMake_VERSION_RC 2)
|
||||
|
||||
# Releases define a tweak level.
|
||||
IF(DEFINED CMake_VERSION_TWEAK)
|
||||
|
390
ChangeLog.manual
390
ChangeLog.manual
@ -1,3 +1,393 @@
|
||||
Changes in CMake 2.8.5-rc2 (since 2.8.5-rc1)
|
||||
--------------------------------------------
|
||||
Bill Hoffman (6):
|
||||
Fix a memory leak.
|
||||
Fix for bug#10798. VS10 did not append -I flags with COMPILE_FLAGS prop.
|
||||
Append and do not clobber CMAKE_CXX_FLAGS in the test.
|
||||
Use bin tree for inclues to avoid -I with spaces in the path.
|
||||
One more try. Use full path by default, and relative on broken compilers.
|
||||
Fix for bug #11927, external project git clone step always runs vs10.
|
||||
|
||||
Brad King (9):
|
||||
XL: Place Fortran modules with -qmoddir= flag (#12246)
|
||||
Teach file(DOWNLOAD|UPLOAD) to timeout after inactivity
|
||||
Xcode: Fix parallel build depends with universal binaries (#11844)
|
||||
Fix style errors added by parent and grandparent
|
||||
Use cascading-if for per-config test and install code
|
||||
CTest: Report tests not run due to unknown configuration
|
||||
GNU: Fix CMAKE_INCLUDE_SYSTEM_FLAG_<lang> value (#12258)
|
||||
Teach find_(library|package) about Linux multiarch (#12037)
|
||||
Test find_package multiarch support (#12037)
|
||||
|
||||
Clinton Stimpson (11):
|
||||
BundleUtilities: Work w/ non .app exes on Mac (#12034)
|
||||
BundleUtilities: Fix regex to extract dependents from ldd (#12034)
|
||||
BundleUtilities: Fix test when using xcode (#12034)
|
||||
BundleUtilities: Fix issues with custom target DEPENDS in test (#12034)
|
||||
BundleUtilities: Disable running test on Windows unless using MSVC.
|
||||
BundleUtilities: Run test on Windows if either MSVC or dumpbin was found.
|
||||
BundleUtilities: Print reason for not loading module.so
|
||||
BundleUtilities: Add rpath to loadable modules in test.
|
||||
Revert "BundleUtilities: Run test on Windows if either MSVC or dumpbin was found."
|
||||
Qt4: complete module dependencies in UseQt4.cmake
|
||||
Add imported targets support for frameworks on Mac.
|
||||
|
||||
Daniel R. Gomez (1):
|
||||
Fix plugin API for gcc 2.9-aix51-020209 (#12233)
|
||||
|
||||
David Cole (3):
|
||||
BundleUtilities: Avoid a cryptic and unhelpful error message
|
||||
BundleUtilities: Avoid test on Watcom dashboards (#12034)
|
||||
CMake: eliminate use of cvs in the Release scripts
|
||||
|
||||
Eric NOULARD (2):
|
||||
CPackRPM: Enhance documentation
|
||||
Add some more Specs file tag handling.
|
||||
|
||||
Johan Björk (3):
|
||||
CMake: Move tokenize to cmSystemTools
|
||||
Xcode: Support multiple level nesting of XCode folders (#10039)
|
||||
XCode: Support target folders on XCode.
|
||||
|
||||
Modestas Vainius (1):
|
||||
multiarch: Set CMAKE_LIBRARY_ARCHITECTURE_REGEX for Linux|Hurd|kFreeBSD
|
||||
|
||||
Philip Lowman (3):
|
||||
FindProtobuf: Better MSVC support, Searching for protobuf lite
|
||||
Fix , to - in Copyright message so it passes CMake.ModuleNotices test
|
||||
10997: PROTOBUF_GENERATE_CPP now supports proto files outside current dir
|
||||
|
||||
Rolf Eike Beer (1):
|
||||
CMake: Update documentation of STRING(SUBSTRING) for length -1 (#10740)
|
||||
|
||||
Sean McBride (1):
|
||||
Fix XCode -> Xcode typos, notably in man page (#12231)
|
||||
|
||||
Tim Gallagher (1):
|
||||
Modified the FindHDF5.cmake file to locate the Fortran bindings.
|
||||
|
||||
Will Dicharry (7):
|
||||
HDF5 high level library is a find COMPONENT now.
|
||||
Add logic for CMake built HDF5 install.
|
||||
Use CMAKE_CURRENT_LIST_DIR to locate FindPackageHandleStandardArgs.
|
||||
Use HDF5_FOUND to control autoconf and CMake built FindHDF5.
|
||||
Fix for bug 11752, mixed debug and release libraries.
|
||||
FindHDF5 ensures good link lines when libraries are duplicated.
|
||||
Remove unnecessary mark_as_advanced from FindHDF5.
|
||||
|
||||
Zach Mullen (3):
|
||||
Dynamic analysis test output should not be compressed.
|
||||
We will actually compress memcheck output if the server supports it.
|
||||
Fix type conversion warning
|
||||
|
||||
Changes in CMake 2.8.5-rc1 (since 2.8.4)
|
||||
----------------------------------------
|
||||
Alex Neundorf (33):
|
||||
Rework the way assembler is handled, use the C/CXX compiler by default
|
||||
Make it possible to exlude external libs from dot files
|
||||
GRAPHVIZ_IGNORE_TARGETS is now a list of regular expressions
|
||||
Also generate dependers-graphviz files.
|
||||
Fix XML escaping for the project() name in Eclipse projects (#11658)
|
||||
Fix XML escaping for target names in Eclipse project files (#11658)
|
||||
Add XML escaping for directory name in Eclipse projects (#11658)
|
||||
Eclipse projects: created one linked resource for each subproject
|
||||
Also add the SOURCES from add_custom_target() to CodeBlocks projects (#11736)
|
||||
Add ASM support for the Intel compiler
|
||||
Actually use CMAKE_ASM_COMPILER for asm, instead of CMAKE_C_COMPILER
|
||||
Add support for ASM for the SunPro compiler
|
||||
Add suport for ASM for the IBM XL compiler
|
||||
Add support for ASm for the HP compiler.
|
||||
Set the HP asm file suffix
|
||||
Change the default rules so they fit better to the new ASM handling
|
||||
Fix the default CMAKE_ASM_COMPILE_OBJECT, make XL-ASM use it
|
||||
Add assemble- and preprocess commands for HP
|
||||
The Assembler test now tests ASM for GNU, Intel, HP, XL and SunPro
|
||||
Use a regexp instead a lot of ORs for checking the compiler ID
|
||||
Only try assembler support for Makefile-based generators
|
||||
Fix bad comparison in the detect assembler-code
|
||||
It's ELSEIF(), not ELSIF()
|
||||
Add temporary debug output for compiler ID detection for ASM
|
||||
Add more regex for gcc, always print the ASM compiler ID
|
||||
Add support for the Intel compiler used for ASM under Windows
|
||||
-use CMAKE_C_FLAGS when generating the assembler file
|
||||
-only enable the asm test for the Intel compiler if we are under UNIX
|
||||
Remove trailing whitespace
|
||||
Make use_mangled_mesa() available in cmake script mode (#11926)
|
||||
Fix parsing include dirs and builtin macros for CXX-only projects
|
||||
Don't skip the last builtin include dir for the Eclipse project file
|
||||
-fix VirtualFolders in Eclipse under Windows
|
||||
|
||||
Alexey Ozeritsky (1):
|
||||
ACML search improvement
|
||||
|
||||
Andreas Schneider (6):
|
||||
Modules: Added CheckPrototypeDefinition module.
|
||||
Tests: Added test for check_prototype_definition.
|
||||
FindOpenSSL: Added support for pkg-config.
|
||||
FindOpenSSL: We should only use hints to find OpenSSL.
|
||||
FindOpenSSL: Fixed crypto und ssl variable names.
|
||||
FindOpenSSL: Use find_package_handle_standard_args for version check.
|
||||
|
||||
Bill Hoffman (2):
|
||||
With very long file names, VS 2010 was unable to compile files.
|
||||
Fix for bug where VS2010 did not use .obj files as part of the build.
|
||||
|
||||
Brad King (94):
|
||||
Reject directory names containing '=' (#11689)
|
||||
FindQt4: Include builtin FindPackageHandleStandardArgs directly
|
||||
Handle trailing slashes on add_custom_command DEPENDS
|
||||
Handle relative WORKING_DIRECTORY in add_custom_(command|target)
|
||||
Pass -o after -c for Fortran to avoid mpif77 ordering bug
|
||||
Add link flag table entries for VS 7,8,9
|
||||
VS: Create a Fortran DLL's import library directory
|
||||
Fix linker flag initialization from LDFLAGS (#11840)
|
||||
ccmake: Remove extra parens around comparison
|
||||
Avoid direct use of std::stringstream
|
||||
Honor module .def files with MinGW tools (#9997)
|
||||
CTest: Update Git submodules with --recursive
|
||||
libarchive: Remove unused build/windows directory (#11885)
|
||||
Pass .def files directly to MinGW tools (#9997)
|
||||
Fix Fortran test .def file symbol mangling
|
||||
Require at least CMake 2.6.3 to build current CMake
|
||||
GNUInstallDirs: Simplify and clarify documentation
|
||||
KWSys: Require at least CMake 2.6.3
|
||||
Remove unused CMAKE_BACKWARDS_COMPATIBILITY mark
|
||||
Factor AIX and XL compiler flags into common module
|
||||
Move RPATH flags to AIX per-compiler information files
|
||||
Initialize ASM rpath flags for executables with those for shared libs
|
||||
Add ASM platform information for XL compiler on AIX
|
||||
Factor HP compiler flags into per-platform/per-compiler files
|
||||
Add ASM platform information for HP compiler on HP
|
||||
Add target property LINK_SEARCH_START_STATIC to aid static linking
|
||||
Test static linking with LINK_SEARCH_START_STATIC
|
||||
Fix Assembler test to parse C flags string before using
|
||||
Teach Assembler test to generate main.s at build time
|
||||
Do not bother enabling C++ in Assembler test
|
||||
The link interface of MODULE libraries is empty (#11945)
|
||||
CTest: Do not fail with submodules and Git < 1.6.5.0
|
||||
Remove trailing whitespace
|
||||
Add parens in cmTarget::ComputeLinkInterface logic
|
||||
Validate custom command arguments (#11963)
|
||||
Factor old-style -D flags out from -I flag generation
|
||||
FindMPI: Fix documentation formatting
|
||||
Generate target-wide flags before individual build rules
|
||||
Optionally pass include directories with response files
|
||||
Pass include directories with response files to GNU on Windows
|
||||
Enable Java test more carefully on Apple
|
||||
Disable Java test with Xcode generator
|
||||
Allow '.' in target names in generator expressions (#12002)
|
||||
GNUInstallDirs: Propagate DATAROOTDIR changes to dependent defaults
|
||||
KWSys: Do not trust EXECUTABLE_OUTPUT_PATH for ProcessFwd9x encoding
|
||||
Refine unused cache variable warning
|
||||
Fix unused cache warning after multiple configure iterations
|
||||
FortranCInterface: Fix mangling detection with Cray Fortran >= 7.3.2
|
||||
Fix typo in include_directories documentation (#12020)
|
||||
KWSys: Recognize rxvt-unicode-256color terminal (#12013)
|
||||
Normalize slashes of add_custom_(command|target) DEPENDS (#11973)
|
||||
COMP: Fix build against non-standard outside libarchive
|
||||
Modules: Add comment and copyright notice validation to readme.txt
|
||||
cmArchiveWrite: Clear xattr and acl from entries (#11958)
|
||||
find_package: Forward component list for recursive calls in modules
|
||||
XL: Set C++ and Fortran flags consistently with C
|
||||
XL: Consolidate compiler flag information
|
||||
XL: Avoid copying archives into shared libraries that link them
|
||||
VS10: Fix working directory of consecutive custom commands (#11938)
|
||||
Fix working drive of make rules on Windows
|
||||
Change working drive only in MinGW Makefiles
|
||||
VS: Use setlocal/endlocal only in VS 10 custom commands
|
||||
VS10: Fix exit code of custom commands with setlocal/endlocal (#11938)
|
||||
KWSys: Remove unused CheckCXXSourceRuns cmake module
|
||||
find_package: Rename implementation of user package registry
|
||||
find_package: Cleanup user package registry less aggressively
|
||||
find_package: Document user package registry locations
|
||||
find_package: Search a "system package registry"
|
||||
find_package: Check both 32-bit and 64-bit registry views
|
||||
find_package: Test system package registry when possible
|
||||
find_package: Fix system package registry test path conversion
|
||||
FindITK: Use passthru find_package config mode for messages
|
||||
OpenBSD: Use 'arch -s' for host processor (#12143)
|
||||
Fix case typo in CMAKE_BUILD_TYPE docs (#12148)
|
||||
KWSys: Fix leaked FILE in EncodeExecutable error case
|
||||
ENH: Fix Intel 12 plugin project generation for VS < 10
|
||||
Revert "Honor RULE_MESSAGES property for build target messages" (#12190)
|
||||
Fix signed/unsigned comparison in EscapeJSON
|
||||
Fix run_compile_commands build on Apple GCC 3.3
|
||||
Make std::map usage more portable in language=>flags/defines maps
|
||||
Provide std::map<>::at for use in run_compile_commands
|
||||
run_compile_commands: Avoid shadow in std::map<>::at workaround
|
||||
Improve string(RANDOM) default seed
|
||||
run_compile_commands: Avoid extra stl vector conversion
|
||||
VS 6: Define _WIN32_WINNT to load wincrypt.h correctly
|
||||
run_compile_commands: Cast istream::get() result to char
|
||||
Fix CompileCommandOutput test for Make tools not supporting spaces
|
||||
Explicitly cast time value in cmSystemTools::RandomSeed
|
||||
Fix CompileCommandOutput test build on Windows
|
||||
Add Absoft Fortran compiler id and basic flags
|
||||
Absoft: Detect implicit link libraries on Linux and Mac
|
||||
Absoft: Enable FortranCInterface check in Fortran test
|
||||
Document status of output_required_files command (#12214)
|
||||
Fix forced-seed argument type in string(RANDOM)
|
||||
|
||||
Clement Creusot (2):
|
||||
Add new module Armadillo
|
||||
Corrected copyright format in FindArmadillo.cmake
|
||||
|
||||
Clinton Stimpson (8):
|
||||
Change to use fphsa to check required variables and version.
|
||||
Fix grouping bug where "Ungrouped Entries" showed up as a child.
|
||||
When checking find_package() components, special case qtmain.
|
||||
Fix issues with find_path() for QtCore include dir on Mac. Fixes 11868.
|
||||
Fix regression in 43cb9b8.
|
||||
Speed up creation of parameters file for moc custom command.
|
||||
Combine component packaging methods into an enum.
|
||||
Add component support to DragNDrop generator.
|
||||
|
||||
David Cole (34):
|
||||
ExternalProject Test: Increase test timeout value
|
||||
CFBundle Test: Add PATHS for finding Rez (#11295)
|
||||
CTest: Mark DART_TESTING_TIMEOUT as advanced (#10150)
|
||||
Xcode: Allow override of CMAKE_CONFIGURATION_TYPES (#8914)
|
||||
Tests: Eliminate unnecessary files and variables.
|
||||
VS9: Map enable/disable PREfast flags (#10638)
|
||||
Strip trailing space from xcode-select output (#10723)
|
||||
CTest: Add alias for make test target (#4564)
|
||||
Add CMAKE_SCRIPT_MODE_FILE variable (#2828)
|
||||
Add CMAKE_ARGC and CMAKE_ARGV0..N-1 variables (#2828)
|
||||
Fix KWStyle line-too-long complaint (#2828)
|
||||
Documentation: Sync two differing copies of -E docs (#10446)
|
||||
Clarify list subcommand documentation (#8154)
|
||||
VS2010: Fixed GenerateManifest flag (#10704)
|
||||
VS: Only use /MANIFEST if hasManifest is true (#11216)
|
||||
Make file DOWNLOAD less noisy (#11761)
|
||||
Begin post-2.8.4 development
|
||||
Use stable_sort to preserve test order (#11877)
|
||||
Implement file(UPLOAD (#11286)
|
||||
Fix KWStyle line too long error (#11286)
|
||||
ExternalProject: Extract file names from more urls
|
||||
InstallRequiredSystemLibraries: Read reg values with get_filename_component
|
||||
Add correct module notice header.
|
||||
If getconf returns empty output, try cpuinfo. (#11302)
|
||||
Add ProcessorCount support for QNX via pidin. (#11302)
|
||||
Compare ProcessorCount to SystemInformation count. (#11302)
|
||||
ProcessorCount test: more output, do not fail. (#11302)
|
||||
ProcessorCount: Add support for remaining platforms (#11302)
|
||||
ProcessorCount: Test fails if count is 0 (#11302)
|
||||
ProcessorCount: Use ERROR_QUIET with execute_process (#11302)
|
||||
ExternalProject: Add SVN_TRUST_CERT argument
|
||||
CMake: Clarify the --debug-trycompile help text
|
||||
ExternalProject: Always use --non-interactive with svn
|
||||
VS10: Write header-only files in correct xml element (#11925)
|
||||
|
||||
Eric NOULARD (25):
|
||||
CPackRPM honors all the different ways of packaging components
|
||||
CPackRPM fix IRIX compiler warning (variable never used)
|
||||
CPack remove "-ALL" suffix for ALL-IN-ONE packages
|
||||
CPack Authorize DISPLAY_NAME usage in component package
|
||||
CPack fix KWStyle warning
|
||||
CPack remove previously CPack generated files (if any) before running CPack
|
||||
CPackRPM Replace space in some CPACK_ vars (Fix bug 9932)
|
||||
CPackRPM activate CPackRPM test on Linux systems where rpmbuild is found
|
||||
CPackArchive package all components specified in CPACK_COMPONENTS_ALL
|
||||
CPack more robust way to collect files belonging to a component
|
||||
CPackRPM do not run test if build dir contains space
|
||||
CPack fix compile error on VS70 and avoid KWStyle warnings
|
||||
CPackRPM add more trace output in order to help failing diagnostics
|
||||
CPackRPM even more trace in debug mode or in case of failure
|
||||
CPackRPM non matching ENDIF
|
||||
CPack try to please SUSE 64 bits and install lib in lib64 and not lib.
|
||||
Remove debbuging typo
|
||||
CPack fix CPackDeb crash when CPackDeb.cmake ends with a FATAL_ERROR
|
||||
CPack fix #11930 and simplifies component packaging options
|
||||
Fix #11964 Handle lib64 library on Linux
|
||||
Fix KWStyle warnings
|
||||
Split CPack.cmake in more manageable parts
|
||||
Fix KWStyle warnings
|
||||
CPackRPM Fix #12096: handle absolute install path with component install
|
||||
CPack make RPM work on AIX. fix #0012183 merge patch from Pasi Valminen
|
||||
|
||||
James Bigler (1):
|
||||
Add FloatingPointModel to the list of known VS7 generator flags.
|
||||
|
||||
Johan Björk (1):
|
||||
XCode: Also qoute [] as needed to set build-configurations.
|
||||
|
||||
Kovarththanan Rajaratnam (1):
|
||||
Documentation: document platform specific -E commands (#10446)
|
||||
|
||||
M. Konrad (1):
|
||||
CPackDeb add Component Support to DEB generator fix #0011655
|
||||
|
||||
Manuel Klimek (6):
|
||||
refactor flags and defines
|
||||
cache flags and defines
|
||||
implement cxx command output
|
||||
make compile command output optional
|
||||
Adds a test for the compile command line output.
|
||||
Only offer the compile command output feature on unix systems
|
||||
|
||||
Marco Craveiro (1):
|
||||
CTest: Use the gcov --preserve-paths flag (#11717)
|
||||
|
||||
Markus Rathgeb (1):
|
||||
When cross compiling, don't double-root paths when using find_*.
|
||||
|
||||
Martin Konrad (2):
|
||||
CPackDeb: Fix #12006 broken package names
|
||||
CPackDeb: Handle dirs for CONTROL_EXTRA correctly when packaging components
|
||||
|
||||
Mathieu Malaterre (8):
|
||||
This commit fixes bug #0010316
|
||||
Add a new function SWIG_GET_WRAPPER_DEPENDENCIES to UseSWIG.cmake
|
||||
Add support for Java on HP
|
||||
Add support for java on fedora
|
||||
UseSWIG.cmake does not expand $(OutDir)
|
||||
Add support for new swig 2.0 application
|
||||
UseSWIG.cmake did not support multiple modules and parallel builds
|
||||
Add support for FindJava on HP-UX and alpha
|
||||
|
||||
Michael Wild (1):
|
||||
Add module ProcessorCount.cmake (#11302)
|
||||
|
||||
Modestas Vainius (1):
|
||||
Documentation: Fix a few typos (#11883)
|
||||
|
||||
Nikita Krupen'ko (1):
|
||||
Add GNUInstallDirs module to define GNU layout (#3976)
|
||||
|
||||
Philip Lowman (1):
|
||||
VS7/8/9: Map whole program optimization flags (#10263)
|
||||
|
||||
Richard Bateman (1):
|
||||
Add support for CFBundle targets on the Mac (#11295)
|
||||
|
||||
Rolf Eike Beer (2):
|
||||
CTest: catch warning output of Apache Maven
|
||||
FindZLIB: print library instead of include directory
|
||||
|
||||
Sean McBride (1):
|
||||
Removed most usage of Carbon in favour of CoreFoundation
|
||||
|
||||
Sebastian Herbst (2):
|
||||
VS8/9: Add flag map entries for /Zc:wchar_t (#10397)
|
||||
VS7/8/9: Add flag map for string pooling option (#10397)
|
||||
|
||||
Tim Hütz (1):
|
||||
Add a string(FIND) sub-command (#11795)
|
||||
|
||||
Todd Gamblin (2):
|
||||
FindMPI: Handle multiple languages
|
||||
Added backward compatibility for input as well as output vars.
|
||||
|
||||
Wesley Turner (1):
|
||||
Ensure executable files have executable permissions.
|
||||
|
||||
Zach Mullen (5):
|
||||
Implement ctest_upload command
|
||||
Change 'Files' tag to 'Upload' in Upload.xml
|
||||
Don't tar/gz ctest_upload() files
|
||||
Add the FILES keyword to ctest_upload command
|
||||
cmCTestUploadCommand::CheckArgumentKeyword should return false if not FILES
|
||||
|
||||
Changes in CMake 2.8.4 (since 2.8.4-rc2)
|
||||
----------------------------------------
|
||||
Alex Neundorf (1):
|
||||
|
@ -53,9 +53,8 @@
|
||||
#
|
||||
# GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
|
||||
# Returns the nearest parent dir whose name ends with ".app" given the full
|
||||
# path to an executable. If there is no such parent dir, then return a dir at
|
||||
# the same level as the executable, named with the executable's base name and
|
||||
# ending with ".app"
|
||||
# path to an executable. If there is no such parent dir, then simply return
|
||||
# the dir containing the executable.
|
||||
#
|
||||
# The returned directory may or may not exist.
|
||||
#
|
||||
@ -227,35 +226,35 @@ endfunction(get_bundle_main_executable)
|
||||
function(get_dotapp_dir exe dotapp_dir_var)
|
||||
set(s "${exe}")
|
||||
|
||||
set(has_dotapp_parent 0)
|
||||
if(s MATCHES "^.*/.*\\.app/.*$")
|
||||
set(has_dotapp_parent 1)
|
||||
endif(s MATCHES "^.*/.*\\.app/.*$")
|
||||
|
||||
set(done 0)
|
||||
while(NOT ${done})
|
||||
get_filename_component(snamewe "${s}" NAME_WE)
|
||||
get_filename_component(sname "${s}" NAME)
|
||||
get_filename_component(sdir "${s}" PATH)
|
||||
if(has_dotapp_parent)
|
||||
# If there is a ".app" parent directory,
|
||||
# ascend until we hit it:
|
||||
# (typical of a Mac bundle executable)
|
||||
#
|
||||
# If there is a ".app" parent directory,
|
||||
# ascend until we hit it:
|
||||
# (typical of a Mac bundle executable)
|
||||
#
|
||||
set(done 0)
|
||||
while(NOT ${done})
|
||||
get_filename_component(snamewe "${s}" NAME_WE)
|
||||
get_filename_component(sname "${s}" NAME)
|
||||
get_filename_component(sdir "${s}" PATH)
|
||||
set(s "${sdir}")
|
||||
if(sname MATCHES "\\.app$")
|
||||
set(done 1)
|
||||
set(dotapp_dir "${sdir}/${sname}")
|
||||
endif(sname MATCHES "\\.app$")
|
||||
else(has_dotapp_parent)
|
||||
# Otherwise use a directory named the same
|
||||
# as the exe, but with a ".app" extension:
|
||||
# (typical of a non-bundle executable on Mac, Windows or Linux)
|
||||
#
|
||||
set(done 1)
|
||||
set(dotapp_dir "${sdir}/${snamewe}.app")
|
||||
endif(has_dotapp_parent)
|
||||
endwhile(NOT ${done})
|
||||
endwhile(NOT ${done})
|
||||
else(s MATCHES "^.*/.*\\.app/.*$")
|
||||
# Otherwise use a directory containing the exe
|
||||
# (typical of a non-bundle executable on Mac, Windows or Linux)
|
||||
#
|
||||
is_file_executable("${s}" is_executable)
|
||||
if(is_executable)
|
||||
get_filename_component(sdir "${s}" PATH)
|
||||
set(dotapp_dir "${sdir}")
|
||||
else(is_executable)
|
||||
set(dotapp_dir "${s}")
|
||||
endif(is_executable)
|
||||
endif(s MATCHES "^.*/.*\\.app/.*$")
|
||||
|
||||
|
||||
set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
|
||||
endfunction(get_dotapp_dir)
|
||||
@ -546,13 +545,25 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
|
||||
#
|
||||
get_dotapp_dir("${exepath}" exe_dotapp_dir)
|
||||
string(LENGTH "${exe_dotapp_dir}/" exe_dotapp_dir_length)
|
||||
string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
|
||||
if(NOT "${exe_dotapp_dir}/" STREQUAL "${item_substring}")
|
||||
string(LENGTH "${resolved_embedded_item}" resolved_embedded_item_length)
|
||||
set(path_too_short 0)
|
||||
set(is_embedded 0)
|
||||
if(${resolved_embedded_item_length} LESS ${exe_dotapp_dir_length})
|
||||
set(path_too_short 1)
|
||||
endif()
|
||||
if(NOT path_too_short)
|
||||
string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
|
||||
if("${exe_dotapp_dir}/" STREQUAL "${item_substring}")
|
||||
set(is_embedded 1)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT is_embedded)
|
||||
message(" exe_dotapp_dir/='${exe_dotapp_dir}/'")
|
||||
message(" item_substring='${item_substring}'")
|
||||
message(" resolved_embedded_item='${resolved_embedded_item}'")
|
||||
message("")
|
||||
message("Install or copy the item into the bundle before calling fixup_bundle")
|
||||
message("Install or copy the item into the bundle before calling fixup_bundle.")
|
||||
message("Or maybe there's a typo or incorrect path in one of the args to fixup_bundle?")
|
||||
message("")
|
||||
message(FATAL_ERROR "cannot fixup an item that is not in the bundle...")
|
||||
endif()
|
||||
|
@ -18,5 +18,8 @@ SET(ASM_DIALECT "-ATT")
|
||||
# *.S files are supposed to be preprocessed, so they should not be passed to
|
||||
# assembler but should be processed by gcc
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
|
||||
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
|
||||
|
||||
INCLUDE(CMakeASMInformation)
|
||||
SET(ASM_DIALECT)
|
||||
|
@ -4,6 +4,7 @@ SET(CMAKE_AR "@CMAKE_AR@")
|
||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||
SET(CMAKE_LINKER "@CMAKE_LINKER@")
|
||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
|
||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
|
||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
|
||||
|
||||
SET(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
|
@ -12,8 +12,6 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
MESSAGE(STATUS "Loaded CMakeASM${ASM_DIALECT}Information - ASM${ASM_DIALECT} support is still experimental, please report issues")
|
||||
|
||||
IF(UNIX)
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
|
||||
ELSE(UNIX)
|
||||
@ -34,6 +32,9 @@ IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
IF(NOT _INCLUDED_FILE)
|
||||
IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
||||
MESSAGE(FATAL_ERROR "Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
|
||||
ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
||||
INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
|
||||
ENDIF(NOT _INCLUDED_FILE)
|
||||
|
||||
@ -89,7 +90,7 @@ MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
|
||||
|
||||
|
||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
||||
|
||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
||||
@ -100,9 +101,21 @@ ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
||||
|
||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
|
||||
"<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
||||
|
||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
|
||||
SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
|
||||
ENDIF()
|
||||
|
||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
|
||||
SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
|
||||
ENDIF()
|
||||
|
||||
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
|
||||
SET(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
|
||||
ENDIF()
|
||||
|
||||
# to be done
|
||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
||||
|
@ -28,6 +28,7 @@ SET(CMAKE_C_LINKER_PREFERENCE 10)
|
||||
# Save compiler ABI information.
|
||||
SET(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
|
||||
SET(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
|
||||
SET(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
|
||||
|
||||
IF(CMAKE_C_SIZEOF_DATA_PTR)
|
||||
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
||||
@ -37,6 +38,10 @@ IF(CMAKE_C_COMPILER_ABI)
|
||||
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
||||
ENDIF(CMAKE_C_COMPILER_ABI)
|
||||
|
||||
IF(CMAKE_C_LIBRARY_ARCHITECTURE)
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
|
||||
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
|
||||
|
||||
|
@ -29,6 +29,7 @@ SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
||||
# Save compiler ABI information.
|
||||
SET(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
|
||||
SET(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
|
||||
SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
|
||||
|
||||
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
||||
@ -38,6 +39,10 @@ IF(CMAKE_CXX_COMPILER_ABI)
|
||||
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
|
||||
ENDIF(CMAKE_CXX_COMPILER_ABI)
|
||||
|
||||
IF(CMAKE_CXX_LIBRARY_ARCHITECTURE)
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
|
||||
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
# cache values that can be initialized in the platform-compiler.cmake file
|
||||
# it may be included by more than one language.
|
||||
|
||||
SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
|
||||
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||
CACHE STRING "Flags used by the linker.")
|
||||
|
||||
|
||||
@ -70,11 +70,11 @@ IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
|
||||
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
# shared linker flags
|
||||
SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
|
||||
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||
CACHE STRING "Flags used by the linker during the creation of dll's.")
|
||||
|
||||
# module linker flags
|
||||
SET (CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
|
||||
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||
CACHE STRING "Flags used by the linker during the creation of modules.")
|
||||
|
||||
SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
|
||||
|
@ -21,11 +21,37 @@ IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||
ENDIF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
|
||||
|
||||
# finally list compilers to try
|
||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT})
|
||||
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}as ${_CMAKE_TOOLCHAIN_PREFIX}gas)
|
||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
||||
IF("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
|
||||
|
||||
IF(CMAKE_ASM_COMPILER_INIT)
|
||||
SET(CMAKE_ASM_COMPILER_LIST ${CMAKE_ASM_COMPILER_INIT})
|
||||
ELSE(CMAKE_ASM_COMPILER_INIT)
|
||||
|
||||
IF(CMAKE_C_COMPILER)
|
||||
SET(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
||||
SET(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
|
||||
ELSEIF(CMAKE_CXX_COMPILER)
|
||||
SET(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
||||
SET(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
|
||||
ELSE(CMAKE_CXX_COMPILER)
|
||||
# List all default C and CXX compilers
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc
|
||||
${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
|
||||
ENDIF(CMAKE_C_COMPILER)
|
||||
|
||||
ENDIF(CMAKE_ASM_COMPILER_INIT)
|
||||
|
||||
|
||||
ELSE("ASM${ASM_DIALECT}" STREQUAL "ASM") # some specific assembler "dialect"
|
||||
|
||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT})
|
||||
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
||||
MESSAGE(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
|
||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
||||
|
||||
ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
||||
|
||||
|
||||
# Find the compiler.
|
||||
IF (_CMAKE_USER_CXX_COMPILER_PATH OR _CMAKE_USER_C_COMPILER_PATH)
|
||||
@ -63,7 +89,24 @@ IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
# Table of per-vendor compiler id flags with expected output.
|
||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "GNU assembler")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
|
||||
|
||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
|
||||
|
||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
|
||||
|
||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
|
||||
|
||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
|
||||
|
||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
|
||||
@ -71,14 +114,15 @@ IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
INCLUDE(CMakeDetermineCompilerId)
|
||||
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
|
||||
|
||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
|
||||
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
|
||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
|
||||
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
|
||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||
|
||||
|
||||
|
||||
# If we have a gas/as cross compiler, they have usually some prefix, like
|
||||
# e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas , optionally
|
||||
@ -90,10 +134,25 @@ ENDIF()
|
||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
|
||||
IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||
STRING(REGEX REPLACE "^(.+-)g?as(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
|
||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
|
||||
# Now try the C compiler regexp:
|
||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
|
||||
# Finally try the CXX compiler regexp:
|
||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
|
||||
|
||||
INCLUDE(CMakeFindBinUtils)
|
||||
|
||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
|
||||
@ -106,6 +165,7 @@ ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||
|
||||
|
||||
SET(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
|
||||
SET(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
|
||||
SET(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
|
||||
SET(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
|
||||
|
||||
|
@ -86,6 +86,17 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
||||
SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
|
||||
SET(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
|
||||
|
||||
# Detect library architecture directory name.
|
||||
IF(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
|
||||
FOREACH(dir ${implicit_dirs})
|
||||
IF("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
|
||||
GET_FILENAME_COMPONENT(arch "${dir}" NAME)
|
||||
SET(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
|
||||
BREAK()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
ELSE(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
||||
MESSAGE(STATUS "Detecting ${lang} compiler ABI info - failed")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
|
@ -287,6 +287,13 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
|
||||
RESULT_VARIABLE result
|
||||
TIMEOUT 10
|
||||
)
|
||||
|
||||
IF("${lang}" STREQUAL "ASM")
|
||||
MESSAGE(STATUS "Checked for ${vendor}")
|
||||
MESSAGE(STATUS " Output: -${output}-")
|
||||
MESSAGE(STATUS " Result: -${result}-")
|
||||
ENDIF("${lang}" STREQUAL "ASM")
|
||||
|
||||
IF("${output}" MATCHES "${regex}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
||||
|
@ -64,7 +64,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
|
||||
# then 77 or older compilers, gnu is always last in the group,
|
||||
# so if you paid for a compiler it is picked by default.
|
||||
SET(CMAKE_Fortran_COMPILER_LIST
|
||||
ifort ifc efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort
|
||||
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort
|
||||
gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
|
||||
frt pgf77 xlf fl32 af77 g77 f77
|
||||
)
|
||||
@ -72,6 +72,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
|
||||
# Vendor-specific compiler names.
|
||||
SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
|
||||
SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
|
||||
SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
|
||||
SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgf90 pgf77)
|
||||
SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
|
||||
SET(_Fortran_COMPILER_NAMES_XL xlf)
|
||||
|
@ -50,14 +50,17 @@ IF(CMAKE_HOST_UNIX)
|
||||
IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
|
||||
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||
RETURN_VALUE val)
|
||||
ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
|
||||
ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||
RETURN_VALUE val)
|
||||
ELSE()
|
||||
EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||
RETURN_VALUE val)
|
||||
IF("${val}" GREATER 0)
|
||||
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||
RETURN_VALUE val)
|
||||
ENDIF("${val}" GREATER 0)
|
||||
ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
|
||||
ENDIF()
|
||||
# check the return of the last uname -m or -p
|
||||
IF("${val}" GREATER 0)
|
||||
SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
|
||||
|
@ -32,14 +32,20 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
|
||||
SET(${_resultIncludeDirs})
|
||||
SET(_gccOutput)
|
||||
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -v -E -x ${_lang} -dD dummy
|
||||
|
||||
IF (${_lang} STREQUAL "c++")
|
||||
SET(_compilerExecutable "${CMAKE_CXX_COMPILER}")
|
||||
ELSE (${_lang} STREQUAL "c++")
|
||||
SET(_compilerExecutable "${CMAKE_C_COMPILER}")
|
||||
ENDIF (${_lang} STREQUAL "c++")
|
||||
EXECUTE_PROCESS(COMMAND ${_compilerExecutable} -v -E -x ${_lang} -dD dummy
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
|
||||
ERROR_VARIABLE _gccOutput
|
||||
OUTPUT_VARIABLE _gccStdout )
|
||||
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
|
||||
|
||||
# First find the system include dirs:
|
||||
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
|
||||
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
|
||||
|
||||
# split the output into lines and then remove leading and trailing spaces from each of them:
|
||||
STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
|
||||
@ -48,7 +54,7 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
|
||||
LIST(APPEND ${_resultIncludeDirs} "${_includePath}")
|
||||
ENDFOREACH(nextLine)
|
||||
|
||||
ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
|
||||
ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
|
||||
|
||||
|
||||
# now find the builtin macros:
|
||||
|
@ -34,6 +34,7 @@ ENDIF(UNIX)
|
||||
# Save compiler ABI information.
|
||||
SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
|
||||
SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
|
||||
SET(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
|
||||
|
||||
IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
|
||||
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
|
||||
@ -43,5 +44,9 @@ IF(CMAKE_Fortran_COMPILER_ABI)
|
||||
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
|
||||
ENDIF(CMAKE_Fortran_COMPILER_ABI)
|
||||
|
||||
IF(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
|
||||
SET(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
|
||||
|
@ -12,6 +12,8 @@
|
||||
PRINT *, 'INFO:compiler[G95]'
|
||||
#elif defined(__PATHSCALE__)
|
||||
PRINT *, 'INFO:compiler[PathScale]'
|
||||
#elif defined(__ABSOFT__)
|
||||
PRINT *, 'INFO:compiler[Absoft]'
|
||||
#elif defined(__GNUC__)
|
||||
PRINT *, 'INFO:compiler[GNU]'
|
||||
#elif defined(__IBMC__)
|
||||
|
@ -178,9 +178,10 @@ IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
|
||||
ENDIF()
|
||||
|
||||
# compile a Fortran file into an object file
|
||||
# (put -o after -c to workaround bug in at least one mpif77 wrapper)
|
||||
IF(NOT CMAKE_Fortran_COMPILE_OBJECT)
|
||||
SET(CMAKE_Fortran_COMPILE_OBJECT
|
||||
"<CMAKE_Fortran_COMPILER> -o <OBJECT> <DEFINES> <FLAGS> -c <SOURCE>")
|
||||
"<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
|
||||
ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT)
|
||||
|
||||
# link a fortran program
|
||||
|
@ -50,6 +50,12 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
|
||||
IF(DEFINED CMAKE_RULE_MESSAGES)
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
|
||||
ENDIF(DEFINED CMAKE_RULE_MESSAGES)
|
||||
IF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
||||
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
|
||||
"Enable/Disable output of compile commands during generation."
|
||||
)
|
||||
MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
||||
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
|
||||
|
||||
|
||||
|
@ -29,11 +29,13 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex)
|
||||
# Construct a regex to match linker lines. It must match both the
|
||||
# whole line and just the command (argv[0]).
|
||||
set(linker_regex "^( *|.*[/\\])(${linker}|ld|collect2)[^/\\]*( |$)")
|
||||
set(linker_exclude_regex "collect2 version ")
|
||||
set(log "${log} link line regex: [${linker_regex}]\n")
|
||||
string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
|
||||
foreach(line IN LISTS output_lines)
|
||||
set(cmd)
|
||||
if("${line}" MATCHES "${linker_regex}")
|
||||
if("${line}" MATCHES "${linker_regex}" AND
|
||||
NOT "${line}" MATCHES "${linker_exclude_regex}")
|
||||
if(UNIX)
|
||||
separate_arguments(args UNIX_COMMAND "${line}")
|
||||
else()
|
||||
@ -64,8 +66,8 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex)
|
||||
# Object file full path.
|
||||
list(APPEND implicit_libs_tmp ${arg})
|
||||
set(log "${log} arg [${arg}] ==> obj [${arg}]\n")
|
||||
elseif("${arg}" MATCHES "^-Y(P,)?")
|
||||
# Sun search path.
|
||||
elseif("${arg}" MATCHES "^-Y(P,)?[^0-9]")
|
||||
# Sun search path ([^0-9] avoids conflict with Mac -Y<num>).
|
||||
string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}")
|
||||
string(REPLACE ":" ";" dirs "${dirs}")
|
||||
list(APPEND implicit_dirs_tmp ${dirs})
|
||||
|
@ -11,13 +11,7 @@
|
||||
# For certain kinds of binary installers (including the graphical
|
||||
# installers on Mac OS X and Windows), CPack generates installers that
|
||||
# allow users to select individual application components to
|
||||
# install. The contents of each of the components are identified by
|
||||
# the COMPONENT argument of CMake's INSTALL command. These components
|
||||
# can be annotated with user-friendly names and descriptions,
|
||||
# inter-component dependencies, etc., and grouped in various ways to
|
||||
# customize the resulting installer. See the cpack_add_* commands,
|
||||
# described below, for more information about component-specific
|
||||
# installations.
|
||||
# install. See CPackComponent module for that.
|
||||
#
|
||||
# The CPACK_GENERATOR variable has different meanings in different
|
||||
# contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a
|
||||
@ -183,93 +177,6 @@
|
||||
# automatically detected command (or specify its location if the
|
||||
# auto-detection fails to find it.)
|
||||
#
|
||||
# Installers built on Mac OS X using the Bundle generator use the
|
||||
# aforementioned DragNDrop variables, plus the following Bundle-specific
|
||||
# parameters:
|
||||
#
|
||||
# CPACK_BUNDLE_NAME - The name of the generated bundle. This
|
||||
# appears in the OSX finder as the bundle name. Required.
|
||||
#
|
||||
# CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
|
||||
# as the Info.plist for the generated bundle. This assumes that
|
||||
# the caller has generated or specified their own Info.plist file.
|
||||
# Required.
|
||||
#
|
||||
# CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as
|
||||
# the icon for the generated bundle. This is the icon that appears
|
||||
# in the OSX finder for the bundle, and in the OSX dock when the
|
||||
# bundle is opened. Required.
|
||||
#
|
||||
# CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that
|
||||
# will be run whenever an end-user double-clicks the generated bundle
|
||||
# in the OSX Finder. Optional.
|
||||
#
|
||||
# The following variables are specific to the graphical installers built
|
||||
# on Windows using the Nullsoft Installation System.
|
||||
#
|
||||
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
|
||||
# installing this project.
|
||||
#
|
||||
# CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
|
||||
# to the end user by the NSIS installer is under this root dir. The full
|
||||
# directory presented to the end user is:
|
||||
# ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
|
||||
#
|
||||
# CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
|
||||
# install program.
|
||||
#
|
||||
# CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated
|
||||
# uninstall program.
|
||||
#
|
||||
# CPACK_PACKAGE_ICON - A branding image that will be displayed inside
|
||||
# the installer.
|
||||
#
|
||||
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
|
||||
# be added to the install Section.
|
||||
#
|
||||
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
|
||||
# be added to the uninstall Section.
|
||||
#
|
||||
# CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
|
||||
# NSIS SetCompressor command.
|
||||
#
|
||||
# CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page
|
||||
# will appear in the installer that will allow the user to choose
|
||||
# whether the program directory should be added to the system PATH
|
||||
# variable.
|
||||
#
|
||||
# CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
|
||||
# the Windows Add/Remove Program control panel
|
||||
#
|
||||
# CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
|
||||
# installer.
|
||||
#
|
||||
# CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
|
||||
# contains the installer icon.
|
||||
#
|
||||
# CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
|
||||
# installing your application.
|
||||
#
|
||||
# CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
|
||||
# information about your application.
|
||||
#
|
||||
# CPACK_NSIS_CONTACT - Contact information for questions and comments
|
||||
# about the installation process.
|
||||
#
|
||||
# CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
|
||||
# creating start menu shortcuts.
|
||||
#
|
||||
# CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
|
||||
# uninstall start menu shortcuts.
|
||||
#
|
||||
# CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
|
||||
# assumes that they are in 'bin' unless this variable is set.
|
||||
# For example, you would set this to 'exec' if your executables are
|
||||
# in an exec directory.
|
||||
#
|
||||
# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
|
||||
# to run on the finish page of the NSIS installer.
|
||||
#
|
||||
# The following variable is specific to installers build on Mac OS X
|
||||
# using PackageMaker:
|
||||
#
|
||||
@ -310,194 +217,6 @@
|
||||
#
|
||||
# CPACK_INSTALL_DIRECTORIES - Extra directories to install.
|
||||
#
|
||||
# Component-specific installation allows users to select specific sets
|
||||
# of components to install during the install process. Installation
|
||||
# components are identified by the COMPONENT argument of CMake's
|
||||
# INSTALL commands, and should be further described by the following
|
||||
# CPack commands:
|
||||
#
|
||||
# cpack_add_component - Describes a CPack installation component
|
||||
# named by the COMPONENT argument to a CMake INSTALL command.
|
||||
#
|
||||
# cpack_add_component(compname
|
||||
# [DISPLAY_NAME name]
|
||||
# [DESCRIPTION description]
|
||||
# [HIDDEN | REQUIRED | DISABLED ]
|
||||
# [GROUP group]
|
||||
# [DEPENDS comp1 comp2 ... ]
|
||||
# [INSTALL_TYPES type1 type2 ... ]
|
||||
# [DOWNLOADED]
|
||||
# [ARCHIVE_FILE filename])
|
||||
#
|
||||
# The cmake_add_component command describes an installation
|
||||
# component, which the user can opt to install or remove as part of
|
||||
# the graphical installation process. compname is the name of the
|
||||
# component, as provided to the COMPONENT argument of one or more
|
||||
# CMake INSTALL commands.
|
||||
#
|
||||
# DISPLAY_NAME is the displayed name of the component, used in
|
||||
# graphical installers to display the component name. This value can
|
||||
# be any string.
|
||||
#
|
||||
# DESCRIPTION is an extended description of the component, used in
|
||||
# graphical installers to give the user additional information about
|
||||
# the component. Descriptions can span multiple lines using "\n" as
|
||||
# the line separator. Typically, these descriptions should be no
|
||||
# more than a few lines long.
|
||||
#
|
||||
# HIDDEN indicates that this component will be hidden in the
|
||||
# graphical installer, so that the user cannot directly change
|
||||
# whether it is installed or not.
|
||||
#
|
||||
# REQUIRED indicates that this component is required, and therefore
|
||||
# will always be installed. It will be visible in the graphical
|
||||
# installer, but it cannot be unselected. (Typically, required
|
||||
# components are shown greyed out).
|
||||
#
|
||||
# DISABLED indicates that this component should be disabled
|
||||
# (unselected) by default. The user is free to select this component
|
||||
# for installation, unless it is also HIDDEN.
|
||||
#
|
||||
# DEPENDS lists the components on which this component depends. If
|
||||
# this component is selected, then each of the components listed
|
||||
# must also be selected. The dependency information is encoded
|
||||
# within the installer itself, so that users cannot install
|
||||
# inconsitent sets of components.
|
||||
#
|
||||
# GROUP names the component group of which this component is a
|
||||
# part. If not provided, the component will be a standalone
|
||||
# component, not part of any component group. Component groups are
|
||||
# described with the cpack_add_component_group command, detailed
|
||||
# below.
|
||||
#
|
||||
# INSTALL_TYPES lists the installation types of which this component
|
||||
# is a part. When one of these installations types is selected, this
|
||||
# component will automatically be selected. Installation types are
|
||||
# described with the cpack_add_install_type command, detailed below.
|
||||
#
|
||||
# DOWNLOADED indicates that this component should be downloaded
|
||||
# on-the-fly by the installer, rather than packaged in with the
|
||||
# installer itself. For more information, see the cpack_configure_downloads
|
||||
# command.
|
||||
#
|
||||
# ARCHIVE_FILE provides a name for the archive file created by CPack
|
||||
# to be used for downloaded components. If not supplied, CPack will
|
||||
# create a file with some name based on CPACK_PACKAGE_FILE_NAME and
|
||||
# the name of the component. See cpack_configure_downloads for more
|
||||
# information.
|
||||
#
|
||||
# cpack_add_component_group - Describes a group of related CPack
|
||||
# installation components.
|
||||
#
|
||||
# cpack_add_component_group(groupname
|
||||
# [DISPLAY_NAME name]
|
||||
# [DESCRIPTION description]
|
||||
# [PARENT_GROUP parent]
|
||||
# [EXPANDED]
|
||||
# [BOLD_TITLE])
|
||||
#
|
||||
# The cpack_add_component_group describes a group of installation
|
||||
# components, which will be placed together within the listing of
|
||||
# options. Typically, component groups allow the user to
|
||||
# select/deselect all of the components within a single group via a
|
||||
# single group-level option. Use component groups to reduce the
|
||||
# complexity of installers with many options. groupname is an
|
||||
# arbitrary name used to identify the group in the GROUP argument of
|
||||
# the cpack_add_component command, which is used to place a
|
||||
# component in a group. The name of the group must not conflict with
|
||||
# the name of any component.
|
||||
#
|
||||
# DISPLAY_NAME is the displayed name of the component group, used in
|
||||
# graphical installers to display the component group name. This
|
||||
# value can be any string.
|
||||
#
|
||||
# DESCRIPTION is an extended description of the component group,
|
||||
# used in graphical installers to give the user additional
|
||||
# information about the components within that group. Descriptions
|
||||
# can span multiple lines using "\n" as the line
|
||||
# separator. Typically, these descriptions should be no more than a
|
||||
# few lines long.
|
||||
#
|
||||
# PARENT_GROUP, if supplied, names the parent group of this group.
|
||||
# Parent groups are used to establish a hierarchy of groups,
|
||||
# providing an arbitrary hierarchy of groups.
|
||||
#
|
||||
# EXPANDED indicates that, by default, the group should show up as
|
||||
# "expanded", so that the user immediately sees all of the
|
||||
# components within the group. Otherwise, the group will initially
|
||||
# show up as a single entry.
|
||||
#
|
||||
# BOLD_TITLE indicates that the group title should appear in bold,
|
||||
# to call the user's attention to the group.
|
||||
#
|
||||
# cpack_add_install_type - Add a new installation type containing a
|
||||
# set of predefined component selections to the graphical installer.
|
||||
#
|
||||
# cpack_add_install_type(typename
|
||||
# [DISPLAY_NAME name])
|
||||
#
|
||||
# The cpack_add_install_type command identifies a set of preselected
|
||||
# components that represents a common use case for an
|
||||
# application. For example, a "Developer" install type might include
|
||||
# an application along with its header and library files, while an
|
||||
# "End user" install type might just include the application's
|
||||
# executable. Each component identifies itself with one or more
|
||||
# install types via the INSTALL_TYPES argument to
|
||||
# cpack_add_component.
|
||||
#
|
||||
# DISPLAY_NAME is the displayed name of the install type, which will
|
||||
# typically show up in a drop-down box within a graphical
|
||||
# installer. This value can be any string.
|
||||
#
|
||||
# cpack_configure_downloads - Configure CPack to download selected
|
||||
# components on-the-fly as part of the installation process.
|
||||
#
|
||||
# cpack_configure_downloads(site
|
||||
# [UPLOAD_DIRECTORY dirname]
|
||||
# [ALL]
|
||||
# [ADD_REMOVE|NO_ADD_REMOVE])
|
||||
#
|
||||
# The cpack_configure_downloads command configures installation-time
|
||||
# downloads of selected components. For each downloadable component,
|
||||
# CPack will create an archive containing the contents of that
|
||||
# component, which should be uploaded to the given site. When the
|
||||
# user selects that component for installation, the installer will
|
||||
# download and extract the component in place. This feature is
|
||||
# useful for creating small installers that only download the
|
||||
# requested components, saving bandwidth. Additionally, the
|
||||
# installers are small enough that they will be installed as part of
|
||||
# the normal installation process, and the "Change" button in
|
||||
# Windows Add/Remove Programs control panel will allow one to add or
|
||||
# remove parts of the application after the original
|
||||
# installation. On Windows, the downloaded-components functionality
|
||||
# requires the ZipDLL plug-in for NSIS, available at:
|
||||
#
|
||||
# http://nsis.sourceforge.net/ZipDLL_plug-in
|
||||
#
|
||||
# On Mac OS X, installers that download components on-the-fly can
|
||||
# only be built and installed on system using Mac OS X 10.5 or
|
||||
# later.
|
||||
#
|
||||
# The site argument is a URL where the archives for downloadable
|
||||
# components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
|
||||
# All of the archives produced by CPack should be uploaded to that location.
|
||||
#
|
||||
# UPLOAD_DIRECTORY is the local directory where CPack will create the
|
||||
# various archives for each of the components. The contents of this
|
||||
# directory should be uploaded to a location accessible by the URL given
|
||||
# in the site argument. If omitted, CPack will use the directory
|
||||
# CPackUploads inside the CMake binary directory to store the generated
|
||||
# archives.
|
||||
#
|
||||
# The ALL flag indicates that all components be downloaded. Otherwise, only
|
||||
# those components explicitly marked as DOWNLOADED or that have a specified
|
||||
# ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
|
||||
# ADD_REMOVE (unless NO_ADD_REMOVE is specified).
|
||||
#
|
||||
# ADD_REMOVE indicates that CPack should install a copy of the installer
|
||||
# that can be called from Windows' Add/Remove Programs dialog (via the
|
||||
# "Modify" button) to change the set of installed components. NO_ADD_REMOVE
|
||||
# turns off this behavior. This option is ignored on Mac OS X.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
@ -512,6 +231,13 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Define this var in order to avoid (or warn) concerning multiple inclusion
|
||||
IF(CPack_CMake_INCLUDED)
|
||||
MESSAGE(WARNING "CPack.cmake has already been included!!")
|
||||
ELSE(CPack_CMake_INCLUDED)
|
||||
SET(CPack_CMake_INCLUDED 1)
|
||||
ENDIF(CPack_CMake_INCLUDED)
|
||||
|
||||
# Pick a configuration file
|
||||
SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
|
||||
IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
|
||||
@ -522,214 +248,9 @@ IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
|
||||
SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
|
||||
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
|
||||
|
||||
# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
|
||||
MACRO(cpack_parse_arguments prefix arg_names option_names)
|
||||
SET(${prefix}_DEFAULT_ARGS)
|
||||
FOREACH(arg_name ${arg_names})
|
||||
SET(${prefix}_${arg_name})
|
||||
ENDFOREACH(arg_name)
|
||||
FOREACH(option ${option_names})
|
||||
SET(${prefix}_${option} FALSE)
|
||||
ENDFOREACH(option)
|
||||
|
||||
SET(current_arg_name DEFAULT_ARGS)
|
||||
SET(current_arg_list)
|
||||
FOREACH(arg ${ARGN})
|
||||
SET(larg_names ${arg_names})
|
||||
LIST(FIND larg_names "${arg}" is_arg_name)
|
||||
IF (is_arg_name GREATER -1)
|
||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||
SET(current_arg_name ${arg})
|
||||
SET(current_arg_list)
|
||||
ELSE (is_arg_name GREATER -1)
|
||||
SET(loption_names ${option_names})
|
||||
LIST(FIND loption_names "${arg}" is_option)
|
||||
IF (is_option GREATER -1)
|
||||
SET(${prefix}_${arg} TRUE)
|
||||
ELSE (is_option GREATER -1)
|
||||
SET(current_arg_list ${current_arg_list} ${arg})
|
||||
ENDIF (is_option GREATER -1)
|
||||
ENDIF (is_arg_name GREATER -1)
|
||||
ENDFOREACH(arg)
|
||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||
ENDMACRO(cpack_parse_arguments)
|
||||
|
||||
# Macro that appends a SET command for the given variable name (var)
|
||||
# to the macro named strvar, but only if the variable named "var"
|
||||
# has been defined. The string will eventually be appended to a CPack
|
||||
# configuration file.
|
||||
MACRO(cpack_append_variable_set_command var strvar)
|
||||
IF (DEFINED ${var})
|
||||
SET(${strvar} "${${strvar}}SET(${var}")
|
||||
FOREACH(APPENDVAL ${${var}})
|
||||
SET(${strvar} "${${strvar}} ${APPENDVAL}")
|
||||
ENDFOREACH(APPENDVAL)
|
||||
SET(${strvar} "${${strvar}})\n")
|
||||
ENDIF (DEFINED ${var})
|
||||
ENDMACRO(cpack_append_variable_set_command)
|
||||
|
||||
# Macro that appends a SET command for the given variable name (var)
|
||||
# to the macro named strvar, but only if the variable named "var"
|
||||
# has been defined and is a string. The string will eventually be
|
||||
# appended to a CPack configuration file.
|
||||
MACRO(cpack_append_string_variable_set_command var strvar)
|
||||
IF (DEFINED ${var})
|
||||
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
||||
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
|
||||
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
ENDIF (DEFINED ${var})
|
||||
ENDMACRO(cpack_append_string_variable_set_command)
|
||||
|
||||
# Macro that appends a SET command for the given variable name (var)
|
||||
# to the macro named strvar, but only if the variable named "var"
|
||||
# has been set to true. The string will eventually be
|
||||
# appended to a CPack configuration file.
|
||||
MACRO(cpack_append_option_set_command var strvar)
|
||||
IF (${var})
|
||||
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
||||
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
|
||||
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
ENDIF (${var})
|
||||
ENDMACRO(cpack_append_option_set_command)
|
||||
|
||||
# Macro that adds a component to the CPack installer
|
||||
MACRO(cpack_add_component compname)
|
||||
STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
|
||||
cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
|
||||
"DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
|
||||
"HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
|
||||
SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
|
||||
else ()
|
||||
SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
|
||||
endif ()
|
||||
|
||||
IF(NOT CPACK_MONOLITHIC_INSTALL)
|
||||
# If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
|
||||
# value of CPACK_COMPONENTS_ALL in the configuration file. This will
|
||||
# take care of any components that have been added after the CPack
|
||||
# moduled was included.
|
||||
IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
||||
GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
|
||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
|
||||
FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
|
||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
|
||||
ENDFOREACH(COMP)
|
||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
|
||||
ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
||||
ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
|
||||
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DESCRIPTION
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_GROUP
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DEPENDS
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_INSTALL_TYPES
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_HIDDEN
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_REQUIRED
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISABLED
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED
|
||||
CPACK_ADDCOMP_STR)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
|
||||
ENDMACRO(cpack_add_component)
|
||||
|
||||
# Macro that adds a component group to the CPack installer
|
||||
MACRO(cpack_add_component_group grpname)
|
||||
STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
|
||||
cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
|
||||
"DISPLAY_NAME;DESCRIPTION"
|
||||
"EXPANDED;BOLD_TITLE"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
|
||||
CPACK_ADDGRP_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DESCRIPTION
|
||||
CPACK_ADDGRP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_EXPANDED
|
||||
CPACK_ADDGRP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_BOLD_TITLE
|
||||
CPACK_ADDGRP_STR)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
|
||||
ENDMACRO(cpack_add_component_group)
|
||||
|
||||
# Macro that adds an installation type to the CPack installer
|
||||
MACRO(cpack_add_install_type insttype)
|
||||
STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
|
||||
cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
|
||||
"DISPLAY_NAME"
|
||||
""
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
SET(CPACK_INSTTYPE_STR
|
||||
"\n# Configuration for installation type \"${insttype}\"\n")
|
||||
SET(CPACK_INSTTYPE_STR
|
||||
"${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
|
||||
CPACK_INSTTYPE_STR)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
|
||||
ENDMACRO(cpack_add_install_type)
|
||||
|
||||
MACRO(cpack_configure_downloads site)
|
||||
cpack_parse_arguments(CPACK_DOWNLOAD
|
||||
"UPLOAD_DIRECTORY"
|
||||
"ALL;ADD_REMOVE;NO_ADD_REMOVE"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
SET(CPACK_CONFIG_DL_STR
|
||||
"\n# Downloaded components configuration\n")
|
||||
SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
|
||||
SET(CPACK_DOWNLOAD_SITE ${site})
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_DOWNLOAD_SITE
|
||||
CPACK_CONFIG_DL_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_UPLOAD_DIRECTORY
|
||||
CPACK_CONFIG_DL_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_DOWNLOAD_ALL
|
||||
CPACK_CONFIG_DL_STR)
|
||||
IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
||||
SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
|
||||
ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
||||
SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
|
||||
cpack_append_option_set_command(
|
||||
CPACK_ADD_REMOVE
|
||||
CPACK_CONFIG_DL_STR)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
|
||||
ENDMACRO(cpack_configure_downloads)
|
||||
# Backward compatibility
|
||||
# Include CPackComponent macros if it has not already been included before.
|
||||
include(CPackComponent)
|
||||
|
||||
# Macro for setting values if a user did not overwrite them
|
||||
MACRO(cpack_set_if_not_set name value)
|
||||
@ -739,7 +260,7 @@ MACRO(cpack_set_if_not_set name value)
|
||||
ENDMACRO(cpack_set_if_not_set)
|
||||
|
||||
# Macro to encode variables for the configuration file
|
||||
# find any varable that stars 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
|
||||
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
|
||||
# used as an @ replacment in configure_file for the CPackConfig.
|
||||
|
37
Modules/CPackBundle.cmake
Normal file
37
Modules/CPackBundle.cmake
Normal file
@ -0,0 +1,37 @@
|
||||
# - CPack Bundle generator (Mac OS X) specific options
|
||||
#
|
||||
# Installers built on Mac OS X using the Bundle generator use the
|
||||
# aforementioned DragNDrop variables, plus the following Bundle-specific
|
||||
# parameters:
|
||||
#
|
||||
# CPACK_BUNDLE_NAME - The name of the generated bundle. This
|
||||
# appears in the OSX finder as the bundle name. Required.
|
||||
#
|
||||
# CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
|
||||
# as the Info.plist for the generated bundle. This assumes that
|
||||
# the caller has generated or specified their own Info.plist file.
|
||||
# Required.
|
||||
#
|
||||
# CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as
|
||||
# the icon for the generated bundle. This is the icon that appears
|
||||
# in the OSX finder for the bundle, and in the OSX dock when the
|
||||
# bundle is opened. Required.
|
||||
#
|
||||
# CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that
|
||||
# will be run whenever an end-user double-clicks the generated bundle
|
||||
# in the OSX Finder. Optional.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
#Bundle Generator specific code should be put here
|
456
Modules/CPackComponent.cmake
Normal file
456
Modules/CPackComponent.cmake
Normal file
@ -0,0 +1,456 @@
|
||||
# - Build binary and source package installers
|
||||
#
|
||||
# The CPackComponent module is the module which handles
|
||||
# the component part of CPack. See CPack module for
|
||||
# general information about CPack.
|
||||
#
|
||||
# For certain kinds of binary installers (including the graphical
|
||||
# installers on Mac OS X and Windows), CPack generates installers that
|
||||
# allow users to select individual application components to
|
||||
# install. The contents of each of the components are identified by
|
||||
# the COMPONENT argument of CMake's INSTALL command. These components
|
||||
# can be annotated with user-friendly names and descriptions,
|
||||
# inter-component dependencies, etc., and grouped in various ways to
|
||||
# customize the resulting installer. See the cpack_add_* commands,
|
||||
# described below, for more information about component-specific
|
||||
# installations.
|
||||
#
|
||||
# Component-specific installation allows users to select specific sets
|
||||
# of components to install during the install process. Installation
|
||||
# components are identified by the COMPONENT argument of CMake's
|
||||
# INSTALL commands, and should be further described by the following
|
||||
# CPack commands:
|
||||
#
|
||||
# cpack_add_component - Describes a CPack installation component
|
||||
# named by the COMPONENT argument to a CMake INSTALL command.
|
||||
#
|
||||
# cpack_add_component(compname
|
||||
# [DISPLAY_NAME name]
|
||||
# [DESCRIPTION description]
|
||||
# [HIDDEN | REQUIRED | DISABLED ]
|
||||
# [GROUP group]
|
||||
# [DEPENDS comp1 comp2 ... ]
|
||||
# [INSTALL_TYPES type1 type2 ... ]
|
||||
# [DOWNLOADED]
|
||||
# [ARCHIVE_FILE filename])
|
||||
#
|
||||
# The cmake_add_component command describes an installation
|
||||
# component, which the user can opt to install or remove as part of
|
||||
# the graphical installation process. compname is the name of the
|
||||
# component, as provided to the COMPONENT argument of one or more
|
||||
# CMake INSTALL commands.
|
||||
#
|
||||
# DISPLAY_NAME is the displayed name of the component, used in
|
||||
# graphical installers to display the component name. This value can
|
||||
# be any string.
|
||||
#
|
||||
# DESCRIPTION is an extended description of the component, used in
|
||||
# graphical installers to give the user additional information about
|
||||
# the component. Descriptions can span multiple lines using "\n" as
|
||||
# the line separator. Typically, these descriptions should be no
|
||||
# more than a few lines long.
|
||||
#
|
||||
# HIDDEN indicates that this component will be hidden in the
|
||||
# graphical installer, so that the user cannot directly change
|
||||
# whether it is installed or not.
|
||||
#
|
||||
# REQUIRED indicates that this component is required, and therefore
|
||||
# will always be installed. It will be visible in the graphical
|
||||
# installer, but it cannot be unselected. (Typically, required
|
||||
# components are shown greyed out).
|
||||
#
|
||||
# DISABLED indicates that this component should be disabled
|
||||
# (unselected) by default. The user is free to select this component
|
||||
# for installation, unless it is also HIDDEN.
|
||||
#
|
||||
# DEPENDS lists the components on which this component depends. If
|
||||
# this component is selected, then each of the components listed
|
||||
# must also be selected. The dependency information is encoded
|
||||
# within the installer itself, so that users cannot install
|
||||
# inconsitent sets of components.
|
||||
#
|
||||
# GROUP names the component group of which this component is a
|
||||
# part. If not provided, the component will be a standalone
|
||||
# component, not part of any component group. Component groups are
|
||||
# described with the cpack_add_component_group command, detailed
|
||||
# below.
|
||||
#
|
||||
# INSTALL_TYPES lists the installation types of which this component
|
||||
# is a part. When one of these installations types is selected, this
|
||||
# component will automatically be selected. Installation types are
|
||||
# described with the cpack_add_install_type command, detailed below.
|
||||
#
|
||||
# DOWNLOADED indicates that this component should be downloaded
|
||||
# on-the-fly by the installer, rather than packaged in with the
|
||||
# installer itself. For more information, see the cpack_configure_downloads
|
||||
# command.
|
||||
#
|
||||
# ARCHIVE_FILE provides a name for the archive file created by CPack
|
||||
# to be used for downloaded components. If not supplied, CPack will
|
||||
# create a file with some name based on CPACK_PACKAGE_FILE_NAME and
|
||||
# the name of the component. See cpack_configure_downloads for more
|
||||
# information.
|
||||
#
|
||||
# cpack_add_component_group - Describes a group of related CPack
|
||||
# installation components.
|
||||
#
|
||||
# cpack_add_component_group(groupname
|
||||
# [DISPLAY_NAME name]
|
||||
# [DESCRIPTION description]
|
||||
# [PARENT_GROUP parent]
|
||||
# [EXPANDED]
|
||||
# [BOLD_TITLE])
|
||||
#
|
||||
# The cpack_add_component_group describes a group of installation
|
||||
# components, which will be placed together within the listing of
|
||||
# options. Typically, component groups allow the user to
|
||||
# select/deselect all of the components within a single group via a
|
||||
# single group-level option. Use component groups to reduce the
|
||||
# complexity of installers with many options. groupname is an
|
||||
# arbitrary name used to identify the group in the GROUP argument of
|
||||
# the cpack_add_component command, which is used to place a
|
||||
# component in a group. The name of the group must not conflict with
|
||||
# the name of any component.
|
||||
#
|
||||
# DISPLAY_NAME is the displayed name of the component group, used in
|
||||
# graphical installers to display the component group name. This
|
||||
# value can be any string.
|
||||
#
|
||||
# DESCRIPTION is an extended description of the component group,
|
||||
# used in graphical installers to give the user additional
|
||||
# information about the components within that group. Descriptions
|
||||
# can span multiple lines using "\n" as the line
|
||||
# separator. Typically, these descriptions should be no more than a
|
||||
# few lines long.
|
||||
#
|
||||
# PARENT_GROUP, if supplied, names the parent group of this group.
|
||||
# Parent groups are used to establish a hierarchy of groups,
|
||||
# providing an arbitrary hierarchy of groups.
|
||||
#
|
||||
# EXPANDED indicates that, by default, the group should show up as
|
||||
# "expanded", so that the user immediately sees all of the
|
||||
# components within the group. Otherwise, the group will initially
|
||||
# show up as a single entry.
|
||||
#
|
||||
# BOLD_TITLE indicates that the group title should appear in bold,
|
||||
# to call the user's attention to the group.
|
||||
#
|
||||
# cpack_add_install_type - Add a new installation type containing a
|
||||
# set of predefined component selections to the graphical installer.
|
||||
#
|
||||
# cpack_add_install_type(typename
|
||||
# [DISPLAY_NAME name])
|
||||
#
|
||||
# The cpack_add_install_type command identifies a set of preselected
|
||||
# components that represents a common use case for an
|
||||
# application. For example, a "Developer" install type might include
|
||||
# an application along with its header and library files, while an
|
||||
# "End user" install type might just include the application's
|
||||
# executable. Each component identifies itself with one or more
|
||||
# install types via the INSTALL_TYPES argument to
|
||||
# cpack_add_component.
|
||||
#
|
||||
# DISPLAY_NAME is the displayed name of the install type, which will
|
||||
# typically show up in a drop-down box within a graphical
|
||||
# installer. This value can be any string.
|
||||
#
|
||||
# cpack_configure_downloads - Configure CPack to download selected
|
||||
# components on-the-fly as part of the installation process.
|
||||
#
|
||||
# cpack_configure_downloads(site
|
||||
# [UPLOAD_DIRECTORY dirname]
|
||||
# [ALL]
|
||||
# [ADD_REMOVE|NO_ADD_REMOVE])
|
||||
#
|
||||
# The cpack_configure_downloads command configures installation-time
|
||||
# downloads of selected components. For each downloadable component,
|
||||
# CPack will create an archive containing the contents of that
|
||||
# component, which should be uploaded to the given site. When the
|
||||
# user selects that component for installation, the installer will
|
||||
# download and extract the component in place. This feature is
|
||||
# useful for creating small installers that only download the
|
||||
# requested components, saving bandwidth. Additionally, the
|
||||
# installers are small enough that they will be installed as part of
|
||||
# the normal installation process, and the "Change" button in
|
||||
# Windows Add/Remove Programs control panel will allow one to add or
|
||||
# remove parts of the application after the original
|
||||
# installation. On Windows, the downloaded-components functionality
|
||||
# requires the ZipDLL plug-in for NSIS, available at:
|
||||
#
|
||||
# http://nsis.sourceforge.net/ZipDLL_plug-in
|
||||
#
|
||||
# On Mac OS X, installers that download components on-the-fly can
|
||||
# only be built and installed on system using Mac OS X 10.5 or
|
||||
# later.
|
||||
#
|
||||
# The site argument is a URL where the archives for downloadable
|
||||
# components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
|
||||
# All of the archives produced by CPack should be uploaded to that location.
|
||||
#
|
||||
# UPLOAD_DIRECTORY is the local directory where CPack will create the
|
||||
# various archives for each of the components. The contents of this
|
||||
# directory should be uploaded to a location accessible by the URL given
|
||||
# in the site argument. If omitted, CPack will use the directory
|
||||
# CPackUploads inside the CMake binary directory to store the generated
|
||||
# archives.
|
||||
#
|
||||
# The ALL flag indicates that all components be downloaded. Otherwise, only
|
||||
# those components explicitly marked as DOWNLOADED or that have a specified
|
||||
# ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
|
||||
# ADD_REMOVE (unless NO_ADD_REMOVE is specified).
|
||||
#
|
||||
# ADD_REMOVE indicates that CPack should install a copy of the installer
|
||||
# that can be called from Windows' Add/Remove Programs dialog (via the
|
||||
# "Modify" button) to change the set of installed components. NO_ADD_REMOVE
|
||||
# turns off this behavior. This option is ignored on Mac OS X.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Define var in order to avoid multiple inclusion
|
||||
IF(NOT CPackComponent_CMake_INCLUDED)
|
||||
SET(CPackComponent_CMake_INCLUDED 1)
|
||||
|
||||
# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
|
||||
MACRO(cpack_parse_arguments prefix arg_names option_names)
|
||||
SET(${prefix}_DEFAULT_ARGS)
|
||||
FOREACH(arg_name ${arg_names})
|
||||
SET(${prefix}_${arg_name})
|
||||
ENDFOREACH(arg_name)
|
||||
FOREACH(option ${option_names})
|
||||
SET(${prefix}_${option} FALSE)
|
||||
ENDFOREACH(option)
|
||||
|
||||
SET(current_arg_name DEFAULT_ARGS)
|
||||
SET(current_arg_list)
|
||||
FOREACH(arg ${ARGN})
|
||||
SET(larg_names ${arg_names})
|
||||
LIST(FIND larg_names "${arg}" is_arg_name)
|
||||
IF (is_arg_name GREATER -1)
|
||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||
SET(current_arg_name ${arg})
|
||||
SET(current_arg_list)
|
||||
ELSE (is_arg_name GREATER -1)
|
||||
SET(loption_names ${option_names})
|
||||
LIST(FIND loption_names "${arg}" is_option)
|
||||
IF (is_option GREATER -1)
|
||||
SET(${prefix}_${arg} TRUE)
|
||||
ELSE (is_option GREATER -1)
|
||||
SET(current_arg_list ${current_arg_list} ${arg})
|
||||
ENDIF (is_option GREATER -1)
|
||||
ENDIF (is_arg_name GREATER -1)
|
||||
ENDFOREACH(arg)
|
||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||
ENDMACRO(cpack_parse_arguments)
|
||||
|
||||
# Macro that appends a SET command for the given variable name (var)
|
||||
# to the macro named strvar, but only if the variable named "var"
|
||||
# has been defined. The string will eventually be appended to a CPack
|
||||
# configuration file.
|
||||
MACRO(cpack_append_variable_set_command var strvar)
|
||||
IF (DEFINED ${var})
|
||||
SET(${strvar} "${${strvar}}SET(${var}")
|
||||
FOREACH(APPENDVAL ${${var}})
|
||||
SET(${strvar} "${${strvar}} ${APPENDVAL}")
|
||||
ENDFOREACH(APPENDVAL)
|
||||
SET(${strvar} "${${strvar}})\n")
|
||||
ENDIF (DEFINED ${var})
|
||||
ENDMACRO(cpack_append_variable_set_command)
|
||||
|
||||
# Macro that appends a SET command for the given variable name (var)
|
||||
# to the macro named strvar, but only if the variable named "var"
|
||||
# has been defined and is a string. The string will eventually be
|
||||
# appended to a CPack configuration file.
|
||||
MACRO(cpack_append_string_variable_set_command var strvar)
|
||||
IF (DEFINED ${var})
|
||||
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
||||
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
|
||||
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
ENDIF (DEFINED ${var})
|
||||
ENDMACRO(cpack_append_string_variable_set_command)
|
||||
|
||||
# Macro that appends a SET command for the given variable name (var)
|
||||
# to the macro named strvar, but only if the variable named "var"
|
||||
# has been set to true. The string will eventually be
|
||||
# appended to a CPack configuration file.
|
||||
MACRO(cpack_append_option_set_command var strvar)
|
||||
IF (${var})
|
||||
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
||||
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
|
||||
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||
ENDIF (${var})
|
||||
ENDMACRO(cpack_append_option_set_command)
|
||||
|
||||
# Macro that adds a component to the CPack installer
|
||||
MACRO(cpack_add_component compname)
|
||||
STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
|
||||
cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
|
||||
"DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
|
||||
"HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
|
||||
SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
|
||||
else ()
|
||||
SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
|
||||
endif ()
|
||||
|
||||
IF(NOT CPACK_MONOLITHIC_INSTALL)
|
||||
# If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
|
||||
# value of CPACK_COMPONENTS_ALL in the configuration file. This will
|
||||
# take care of any components that have been added after the CPack
|
||||
# moduled was included.
|
||||
IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
||||
GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
|
||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
|
||||
FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
|
||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
|
||||
ENDFOREACH(COMP)
|
||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
|
||||
ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
||||
ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
|
||||
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DESCRIPTION
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_GROUP
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DEPENDS
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_INSTALL_TYPES
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_HIDDEN
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_REQUIRED
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISABLED
|
||||
CPACK_ADDCOMP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED
|
||||
CPACK_ADDCOMP_STR)
|
||||
# Backward compatibility issue.
|
||||
# Write to config iff the macros is used after CPack.cmake has been
|
||||
# included, other it's not necessary because the variables
|
||||
# will be encoded by cpack_encode_variables.
|
||||
IF(CPack_CMake_INCLUDED)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
|
||||
ENDIF(CPack_CMake_INCLUDED)
|
||||
ENDMACRO(cpack_add_component)
|
||||
|
||||
# Macro that adds a component group to the CPack installer
|
||||
MACRO(cpack_add_component_group grpname)
|
||||
STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
|
||||
cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
|
||||
"DISPLAY_NAME;DESCRIPTION"
|
||||
"EXPANDED;BOLD_TITLE"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
|
||||
CPACK_ADDGRP_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DESCRIPTION
|
||||
CPACK_ADDGRP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_EXPANDED
|
||||
CPACK_ADDGRP_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_BOLD_TITLE
|
||||
CPACK_ADDGRP_STR)
|
||||
# Backward compatibility issue.
|
||||
# Write to config iff the macros is used after CPack.cmake has been
|
||||
# included, other it's not necessary because the variables
|
||||
# will be encoded by cpack_encode_variables.
|
||||
IF(CPack_CMake_INCLUDED)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
|
||||
ENDIF(CPack_CMake_INCLUDED)
|
||||
ENDMACRO(cpack_add_component_group)
|
||||
|
||||
# Macro that adds an installation type to the CPack installer
|
||||
MACRO(cpack_add_install_type insttype)
|
||||
STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
|
||||
cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
|
||||
"DISPLAY_NAME"
|
||||
""
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
SET(CPACK_INSTTYPE_STR
|
||||
"\n# Configuration for installation type \"${insttype}\"\n")
|
||||
SET(CPACK_INSTTYPE_STR
|
||||
"${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
|
||||
CPACK_INSTTYPE_STR)
|
||||
# Backward compatibility issue.
|
||||
# Write to config iff the macros is used after CPack.cmake has been
|
||||
# included, other it's not necessary because the variables
|
||||
# will be encoded by cpack_encode_variables.
|
||||
IF(CPack_CMake_INCLUDED)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
|
||||
ENDIF(CPack_CMake_INCLUDED)
|
||||
ENDMACRO(cpack_add_install_type)
|
||||
|
||||
MACRO(cpack_configure_downloads site)
|
||||
cpack_parse_arguments(CPACK_DOWNLOAD
|
||||
"UPLOAD_DIRECTORY"
|
||||
"ALL;ADD_REMOVE;NO_ADD_REMOVE"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
SET(CPACK_CONFIG_DL_STR
|
||||
"\n# Downloaded components configuration\n")
|
||||
SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
|
||||
SET(CPACK_DOWNLOAD_SITE ${site})
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_DOWNLOAD_SITE
|
||||
CPACK_CONFIG_DL_STR)
|
||||
cpack_append_string_variable_set_command(
|
||||
CPACK_UPLOAD_DIRECTORY
|
||||
CPACK_CONFIG_DL_STR)
|
||||
cpack_append_option_set_command(
|
||||
CPACK_DOWNLOAD_ALL
|
||||
CPACK_CONFIG_DL_STR)
|
||||
IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
||||
SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
|
||||
ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
||||
SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
|
||||
cpack_append_option_set_command(
|
||||
CPACK_ADD_REMOVE
|
||||
CPACK_CONFIG_DL_STR)
|
||||
# Backward compatibility issue.
|
||||
# Write to config iff the macros is used after CPack.cmake has been
|
||||
# included, other it's not necessary because the variables
|
||||
# will be encoded by cpack_encode_variables.
|
||||
IF(CPack_CMake_INCLUDED)
|
||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
|
||||
ENDIF(CPack_CMake_INCLUDED)
|
||||
ENDMACRO(cpack_configure_downloads)
|
||||
ENDIF(NOT CPackComponent_CMake_INCLUDED)
|
@ -60,7 +60,7 @@
|
||||
# CPACK_DEBIAN_PACKAGE_DEBUG
|
||||
# Mandatory : NO
|
||||
# Default : -
|
||||
# May be set when invoking cpack in order to trace debug informations
|
||||
# May be set when invoking cpack in order to trace debug information
|
||||
# during CPackDeb run.
|
||||
# CPACK_DEBIAN_PACKAGE_PREDEPENDS
|
||||
# Mandatory : NO
|
||||
@ -311,6 +311,29 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
|
||||
# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
|
||||
|
||||
# Are we packaging components ?
|
||||
IF(CPACK_DEB_PACKAGE_COMPONENT)
|
||||
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
|
||||
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
|
||||
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
|
||||
STRING(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
|
||||
ELSE(CPACK_DEB_PACKAGE_COMPONENT)
|
||||
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
|
||||
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
|
||||
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
|
||||
ENDIF(CPACK_DEB_PACKAGE_COMPONENT)
|
||||
|
||||
# Print out some debug information if we were asked for that
|
||||
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||
MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
|
||||
MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
|
||||
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
|
||||
MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
|
||||
MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
|
||||
MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
|
||||
MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
|
||||
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||
|
||||
# For debian source packages:
|
||||
# debian/control
|
||||
|
83
Modules/CPackNSIS.cmake
Normal file
83
Modules/CPackNSIS.cmake
Normal file
@ -0,0 +1,83 @@
|
||||
# - CPack NSIS generator specific options
|
||||
#
|
||||
# The following variables are specific to the graphical installers built
|
||||
# on Windows using the Nullsoft Installation System.
|
||||
#
|
||||
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
|
||||
# installing this project.
|
||||
#
|
||||
# CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
|
||||
# to the end user by the NSIS installer is under this root dir. The full
|
||||
# directory presented to the end user is:
|
||||
# ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
|
||||
#
|
||||
# CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
|
||||
# install program.
|
||||
#
|
||||
# CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated
|
||||
# uninstall program.
|
||||
#
|
||||
# CPACK_PACKAGE_ICON - A branding image that will be displayed inside
|
||||
# the installer.
|
||||
#
|
||||
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
|
||||
# be added to the install Section.
|
||||
#
|
||||
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
|
||||
# be added to the uninstall Section.
|
||||
#
|
||||
# CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
|
||||
# NSIS SetCompressor command.
|
||||
#
|
||||
# CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page
|
||||
# will appear in the installer that will allow the user to choose
|
||||
# whether the program directory should be added to the system PATH
|
||||
# variable.
|
||||
#
|
||||
# CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
|
||||
# the Windows Add/Remove Program control panel
|
||||
#
|
||||
# CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
|
||||
# installer.
|
||||
#
|
||||
# CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
|
||||
# contains the installer icon.
|
||||
#
|
||||
# CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
|
||||
# installing your application.
|
||||
#
|
||||
# CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
|
||||
# information about your application.
|
||||
#
|
||||
# CPACK_NSIS_CONTACT - Contact information for questions and comments
|
||||
# about the installation process.
|
||||
#
|
||||
# CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
|
||||
# creating start menu shortcuts.
|
||||
#
|
||||
# CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
|
||||
# uninstall start menu shortcuts.
|
||||
#
|
||||
# CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
|
||||
# assumes that they are in 'bin' unless this variable is set.
|
||||
# For example, you would set this to 'exec' if your executables are
|
||||
# in an exec directory.
|
||||
#
|
||||
# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
|
||||
# to run on the finish page of the NSIS installer.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
#FIXME we should put NSIS specific code here
|
||||
#FIXME but I'm not doing it because I'm not able to test it...
|
@ -4,8 +4,10 @@
|
||||
# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
|
||||
#
|
||||
# However CPackRPM has specific features which are controlled by
|
||||
# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on
|
||||
# the wiki:
|
||||
# the specifics CPACK_RPM_XXX variables.
|
||||
# Usually those vars correspond to RPM spec file entities, one may find
|
||||
# information about spec files here http://www.rpm.org/wiki/Docs.
|
||||
# You'll find a detailed usage of CPackRPM on the wiki:
|
||||
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
|
||||
# However as a handy reminder here comes the list of specific variables:
|
||||
#
|
||||
@ -68,6 +70,8 @@
|
||||
# Note that you must enclose the complete requires string between quotes,
|
||||
# for example:
|
||||
# set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
|
||||
# The required package list of an RPM file could be printed with
|
||||
# rpm -qp --requires file.rpm
|
||||
# CPACK_RPM_PACKAGE_SUGGESTS
|
||||
# Mandatory : NO
|
||||
# Default : -
|
||||
@ -77,6 +81,8 @@
|
||||
# Mandatory : NO
|
||||
# Default : -
|
||||
# May be used to set RPM dependencies (provides).
|
||||
# The provided package list of an RPM file could be printed with
|
||||
# rpm -qp --provides file.rpm
|
||||
# CPACK_RPM_PACKAGE_OBSOLETES
|
||||
# Mandatory : NO
|
||||
# Default : -
|
||||
@ -194,6 +200,25 @@ IF(NOT RPMBUILD_EXECUTABLE)
|
||||
MESSAGE(FATAL_ERROR "RPM package requires rpmbuild executable")
|
||||
ENDIF(NOT RPMBUILD_EXECUTABLE)
|
||||
|
||||
# Display lsb_release output if DEBUG mode enable
|
||||
# This will help to diagnose problem with CPackRPM
|
||||
# because we will know on which kind of Linux we are
|
||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
||||
find_program(LSB_RELEASE_EXECUTABLE lsb_release)
|
||||
if(LSB_RELEASE_EXECUTABLE)
|
||||
execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -a
|
||||
OUTPUT_VARIABLE _TMP_LSB_RELEASE_OUTPUT
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "\n" ", "
|
||||
LSB_RELEASE_OUTPUT
|
||||
${_TMP_LSB_RELEASE_OUTPUT})
|
||||
else (LSB_RELEASE_EXECUTABLE)
|
||||
set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
|
||||
endif(LSB_RELEASE_EXECUTABLE)
|
||||
MESSAGE("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
|
||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
||||
|
||||
# We may use RPM version in the future in order
|
||||
# to shut down warning about space in buildtree
|
||||
# some recent RPM version should support space in different places.
|
||||
@ -345,7 +370,7 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE)
|
||||
endif(CPACK_RPM_PACKAGE_RELOCATABLE)
|
||||
|
||||
# check if additional fields for RPM spec header are given
|
||||
FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX)
|
||||
FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
|
||||
IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
|
||||
STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
|
||||
MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
|
||||
@ -470,12 +495,26 @@ ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
|
||||
# file name by enclosing it between double quotes (thus the sed)
|
||||
# Then we must authorize any man pages extension (adding * at the end)
|
||||
# because rpmbuild may automatically compress those files
|
||||
EXECUTE_PROCESS(COMMAND find -type f -o -type l
|
||||
COMMAND sed {s:.*/man.*/.*:&*:}
|
||||
COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
|
||||
EXECUTE_PROCESS(COMMAND find . -type f -o -type l
|
||||
COMMAND sed s:.*/man.*/.*:&*:
|
||||
COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
|
||||
WORKING_DIRECTORY "${WDIR}"
|
||||
OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
|
||||
|
||||
# In component case, replace CPACK_ABSOLUTE_DESTINATION_FILES
|
||||
# with the content of CPACK_ABSOLUTE_DESTINATION_FILES_<COMPONENT>
|
||||
# This must be done BEFORE the CPACK_ABSOLUTE_DESTINATION_FILES handling
|
||||
if(CPACK_RPM_PACKAGE_COMPONENT)
|
||||
if(CPACK_ABSOLUTE_DESTINATION_FILES)
|
||||
set(COMPONENT_FILES_TAG "CPACK_ABSOLUTE_DESTINATION_FILES_${CPACK_RPM_PACKAGE_COMPONENT}")
|
||||
set(CPACK_ABSOLUTE_DESTINATION_FILES "${${COMPONENT_FILES_TAG}}")
|
||||
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||
message("CPackRPM:Debug: Handling Absolute Destination Files ${CPACK_ABSOLUTE_DESTINATION_FILES}")
|
||||
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
|
||||
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CPACK_ABSOLUTE_DESTINATION_FILES)
|
||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
||||
message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES}")
|
||||
@ -540,6 +579,10 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
|
||||
\@TMP_RPM_REQUIRES\@
|
||||
\@TMP_RPM_PROVIDES\@
|
||||
\@TMP_RPM_OBSOLETES\@
|
||||
\@TMP_RPM_CONFLICTS\@
|
||||
\@TMP_RPM_AUTOPROV\@
|
||||
\@TMP_RPM_AUTOREQ\@
|
||||
\@TMP_RPM_AUTOREQPROV\@
|
||||
\@TMP_RPM_BUILDARCH\@
|
||||
\@TMP_RPM_PREFIX\@
|
||||
|
||||
@ -621,13 +664,18 @@ IF(RPMBUILD_EXECUTABLE)
|
||||
--buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
|
||||
"${CPACK_RPM_BINARY_SPECFILE}"
|
||||
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
|
||||
RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
|
||||
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
|
||||
OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
|
||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
||||
IF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
|
||||
FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
|
||||
FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
|
||||
MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
|
||||
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
|
||||
MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
|
||||
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
|
||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
||||
MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
|
||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
|
||||
ELSE(RPMBUILD_EXECUTABLE)
|
||||
IF(ALIEN_EXECUTABLE)
|
||||
MESSAGE(FATAL_ERROR "RPM packaging through alien not done (yet)")
|
||||
|
@ -63,7 +63,8 @@ OPTION(BUILD_TESTING "Build the testing tree." ON)
|
||||
# function to turn generator name into a version string
|
||||
# like vs7 vs71 vs8 vs9
|
||||
FUNCTION(GET_VS_VERSION_STRING generator var)
|
||||
STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}")
|
||||
STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
|
||||
NUMBER "${generator}")
|
||||
IF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
||||
SET(ver_string "vs71")
|
||||
ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
||||
@ -253,15 +254,16 @@ IF(BUILD_TESTING)
|
||||
ENDIF(CTEST_USE_LAUNCHERS)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
COVERAGE_COMMAND
|
||||
CVSCOMMAND
|
||||
SVNCOMMAND
|
||||
BZRCOMMAND
|
||||
HGCOMMAND
|
||||
GITCOMMAND
|
||||
CVS_UPDATE_OPTIONS
|
||||
SVN_UPDATE_OPTIONS
|
||||
BZR_UPDATE_OPTIONS
|
||||
COVERAGE_COMMAND
|
||||
CTEST_SUBMIT_RETRY_DELAY
|
||||
CTEST_SUBMIT_RETRY_COUNT
|
||||
CVSCOMMAND
|
||||
CVS_UPDATE_OPTIONS
|
||||
DART_TESTING_TIMEOUT
|
||||
GITCOMMAND
|
||||
HGCOMMAND
|
||||
MAKECOMMAND
|
||||
MEMORYCHECK_COMMAND
|
||||
MEMORYCHECK_SUPPRESSIONS_FILE
|
||||
@ -270,10 +272,9 @@ IF(BUILD_TESTING)
|
||||
SLURM_SBATCH_COMMAND
|
||||
SLURM_SRUN_COMMAND
|
||||
SITE
|
||||
CTEST_SUBMIT_RETRY_DELAY
|
||||
CTEST_SUBMIT_RETRY_COUNT
|
||||
SVNCOMMAND
|
||||
SVN_UPDATE_OPTIONS
|
||||
)
|
||||
# BUILDNAME
|
||||
IF(NOT RUN_FROM_DART)
|
||||
SET(RUN_FROM_CTEST_OR_DART 1)
|
||||
INCLUDE(CTestTargets)
|
||||
|
@ -84,4 +84,12 @@ IF(NOT _CTEST_TARGETS_ADDED)
|
||||
ENDFOREACH(testtype)
|
||||
ENDFOREACH(mode)
|
||||
ENDIF("${CMAKE_GENERATOR}" MATCHES Make)
|
||||
|
||||
# If requested, add an alias that is the equivalent of the built-in "test"
|
||||
# or "RUN_TESTS" target:
|
||||
IF(CTEST_TEST_TARGET_ALIAS)
|
||||
ADD_CUSTOM_TARGET(${CTEST_TEST_TARGET_ALIAS}
|
||||
${CMAKE_CTEST_COMMAND} ${__conf_types}
|
||||
)
|
||||
ENDIF()
|
||||
ENDIF(NOT _CTEST_TARGETS_ADDED)
|
||||
|
29
Modules/CheckPrototypeDefinition.c.in
Normal file
29
Modules/CheckPrototypeDefinition.c.in
Normal file
@ -0,0 +1,29 @@
|
||||
@CHECK_PROTOTYPE_DEFINITION_HEADER@
|
||||
|
||||
static void cmakeRequireSymbol(int dummy, ...) {
|
||||
(void) dummy;
|
||||
}
|
||||
|
||||
static void checkSymbol(void) {
|
||||
#ifndef @CHECK_PROTOTYPE_DEFINITION_SYMBOL@
|
||||
cmakeRequireSymbol(0, &@CHECK_PROTOTYPE_DEFINITION_SYMBOL@);
|
||||
#endif
|
||||
}
|
||||
|
||||
@CHECK_PROTOTYPE_DEFINITION_PROTO@ {
|
||||
return @CHECK_PROTOTYPE_DEFINITION_RETURN@;
|
||||
}
|
||||
|
||||
#ifdef __CLASSIC_C__
|
||||
int main() {
|
||||
int ac;
|
||||
char*av[];
|
||||
#else
|
||||
int main(int ac, char *av[]) {
|
||||
#endif
|
||||
checkSymbol();
|
||||
if (ac > 1000) {
|
||||
return *av[0];
|
||||
}
|
||||
return 0;
|
||||
}
|
96
Modules/CheckPrototypeDefinition.cmake
Normal file
96
Modules/CheckPrototypeDefinition.cmake
Normal file
@ -0,0 +1,96 @@
|
||||
# - Check if the protoype we expect is correct.
|
||||
# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
|
||||
# FUNCTION - The name of the function (used to check if prototype exists)
|
||||
# PROTOTYPE- The prototype to check.
|
||||
# RETURN - The return value of the function.
|
||||
# HEADER - The header files required.
|
||||
# VARIABLE - The variable to store the result.
|
||||
# Example:
|
||||
# check_prototype_definition(getpwent_r
|
||||
# "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
|
||||
# "NULL"
|
||||
# "unistd.h;pwd.h"
|
||||
# SOLARIS_GETPWENT_R)
|
||||
# The following variables may be set before calling this macro to
|
||||
# modify the way the check is run:
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
# Copyright 2010-2011 Andreas Schneider <asn@cryptomilk.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.)
|
||||
#
|
||||
|
||||
get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
|
||||
|
||||
if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
|
||||
set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
|
||||
|
||||
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||
if (CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_PROTOTYPE_DEFINITION_LIBS
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
else(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_PROTOTYPE_DEFINITION_LIBS)
|
||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||
if (CMAKE_REQUIRED_INCLUDES)
|
||||
set(CMAKE_SYMBOL_EXISTS_INCLUDES
|
||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||
else(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CMAKE_SYMBOL_EXISTS_INCLUDES)
|
||||
endif(CMAKE_REQUIRED_INCLUDES)
|
||||
|
||||
foreach(_FILE ${_HEADER})
|
||||
set(CHECK_PROTOTYPE_DEFINITION_HEADER
|
||||
"${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
|
||||
endforeach(_FILE)
|
||||
|
||||
set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
|
||||
set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
|
||||
set(CHECK_PROTOTYPE_DEFINITION_RETURN ${_RETURN})
|
||||
|
||||
configure_file("${__check_proto_def_dir}/CheckPrototypeDefinition.c.in"
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c" @ONLY)
|
||||
|
||||
file(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c _SOURCE)
|
||||
|
||||
try_compile(${_VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS}
|
||||
"${CHECK_PROTOTYPE_DEFINITION_LIBS}"
|
||||
"${CMAKE_SYMBOL_EXISTS_INCLUDES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
|
||||
if (${_VARIABLE})
|
||||
set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
|
||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else (${_VARIABLE})
|
||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
|
||||
set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
|
||||
"${OUTPUT}\n\n${_SOURCE}\n\n")
|
||||
endif (${_VARIABLE})
|
||||
endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
|
||||
|
||||
endfunction(CHECK_PROTOTYPE_DEFINITION)
|
8
Modules/Compiler/Absoft-Fortran.cmake
Normal file
8
Modules/Compiler/Absoft-Fortran.cmake
Normal file
@ -0,0 +1,8 @@
|
||||
SET(CMAKE_Fortran_FLAGS_INIT "")
|
||||
SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
|
||||
SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "")
|
||||
SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
|
||||
SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
|
||||
SET(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
|
||||
SET(CMAKE_Fortran_MODPATH_FLAG "-p")
|
||||
SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
|
6
Modules/Compiler/GNU-ASM.cmake
Normal file
6
Modules/Compiler/GNU-ASM.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
# This file is loaded when gcc/g++ is used for assembler files (the "ASM" cmake language)
|
||||
include(Compiler/GNU)
|
||||
|
||||
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
|
||||
|
||||
__compiler_gnu(ASM)
|
@ -33,6 +33,6 @@ macro(__compiler_gnu lang)
|
||||
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
if(NOT APPLE)
|
||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
|
||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
|
||||
endif(NOT APPLE)
|
||||
endmacro()
|
||||
|
3
Modules/Compiler/HP-ASM.cmake
Normal file
3
Modules/Compiler/HP-ASM.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
SET(CMAKE_ASM_VERBOSE_FLAG "-v")
|
||||
|
||||
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
|
@ -1 +1,4 @@
|
||||
SET(CMAKE_C_VERBOSE_FLAG "-v")
|
||||
|
||||
SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
|
@ -1 +1,4 @@
|
||||
SET(CMAKE_CXX_VERBOSE_FLAG "-v")
|
||||
|
||||
SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
|
13
Modules/Compiler/Intel-ASM.cmake
Normal file
13
Modules/Compiler/Intel-ASM.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
SET(CMAKE_ASM_VERBOSE_FLAG "-v")
|
||||
|
||||
SET(CMAKE_ASM_FLAGS_INIT "")
|
||||
SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
|
||||
SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
|
||||
SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
|
||||
SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
|
||||
|
||||
IF(UNIX)
|
||||
SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
|
||||
ELSE(UNIX)
|
||||
SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
|
||||
ENDIF(UNIX)
|
24
Modules/Compiler/SunPro-ASM.cmake
Normal file
24
Modules/Compiler/SunPro-ASM.cmake
Normal file
@ -0,0 +1,24 @@
|
||||
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
|
||||
|
||||
SET(CMAKE_ASM_VERBOSE_FLAG "-#")
|
||||
|
||||
SET(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC")
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G")
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R")
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":")
|
||||
SET(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h")
|
||||
|
||||
SET(CMAKE_ASM_FLAGS_INIT "")
|
||||
SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
|
||||
SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
|
||||
SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
|
||||
SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
|
||||
|
||||
# Initialize ASM link type selection flags. These flags are used when
|
||||
# building a shared library, shared module, or executable that links
|
||||
# to other libraries to select whether to use the static or shared
|
||||
# versions of the libraries.
|
||||
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
|
||||
SET(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
|
||||
SET(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
|
||||
ENDFOREACH(type)
|
13
Modules/Compiler/XL-ASM.cmake
Normal file
13
Modules/Compiler/XL-ASM.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
SET(CMAKE_ASM_VERBOSE_FLAG "-V")
|
||||
|
||||
# -qthreaded = Ensures that all optimizations will be thread-safe
|
||||
# -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
|
||||
# -qhalt=e = Halt on error messages (rather than just severe errors)
|
||||
SET(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assembler")
|
||||
|
||||
SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
|
||||
SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG")
|
||||
SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
|
||||
SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g")
|
||||
|
||||
SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
|
@ -1,14 +1,9 @@
|
||||
SET(CMAKE_C_VERBOSE_FLAG "-V")
|
||||
include(Compiler/XL)
|
||||
__compiler_xl(C)
|
||||
set(CMAKE_C_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT} -DNDEBUG")
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
|
||||
|
||||
# -qthreaded = Ensures that all optimizations will be thread-safe
|
||||
# -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
|
||||
# -qhalt=e = Halt on error messages (rather than just severe errors)
|
||||
SET(CMAKE_C_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e")
|
||||
|
||||
SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
|
||||
SET(CMAKE_C_FLAGS_RELEASE_INIT "-O -DNDEBUG")
|
||||
SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
|
||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
|
||||
|
||||
SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
|
@ -1,12 +1,11 @@
|
||||
SET(CMAKE_CXX_VERBOSE_FLAG "-V")
|
||||
include(Compiler/XL)
|
||||
__compiler_xl(CXX)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT} -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O -DNDEBUG")
|
||||
SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
|
||||
# -qthreaded = Ensures that all optimizations will be thread-safe
|
||||
# -qhalt=e = Halt on error messages (rather than just severe errors)
|
||||
SET(CMAKE_CXX_FLAGS_INIT "-qthreaded -qhalt=e")
|
||||
|
||||
SET(CMAKE_CXX_COMPILE_OBJECT
|
||||
"<CMAKE_CXX_COMPILER> -+ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
|
||||
SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
|
@ -1,8 +1,14 @@
|
||||
SET(CMAKE_Fortran_VERBOSE_FLAG "-V")
|
||||
include(Compiler/XL)
|
||||
__compiler_xl(Fortran)
|
||||
|
||||
SET(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
|
||||
|
||||
SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
|
||||
|
||||
SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
|
||||
SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O")
|
||||
SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-O")
|
||||
SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g")
|
||||
# -qthreaded = Ensures that all optimizations will be thread-safe
|
||||
# -qhalt=e = Halt on error messages (rather than just severe errors)
|
||||
SET(CMAKE_Fortran_FLAGS_INIT "-qthreaded -qhalt=e")
|
||||
|
||||
# We require updates to CMake C++ code to support preprocessing rules for Fortran.
|
||||
SET(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
|
||||
SET(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
|
||||
|
48
Modules/Compiler/XL.cmake
Normal file
48
Modules/Compiler/XL.cmake
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-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.)
|
||||
|
||||
# This module is shared by multiple languages; use include blocker.
|
||||
if(__COMPILER_XL)
|
||||
return()
|
||||
endif()
|
||||
set(__COMPILER_XL 1)
|
||||
|
||||
# Find the CreateExportList program that comes with this toolchain.
|
||||
find_program(CMAKE_XL_CreateExportList
|
||||
NAMES CreateExportList
|
||||
DOC "IBM XL CreateExportList tool"
|
||||
)
|
||||
|
||||
macro(__compiler_xl lang)
|
||||
# Feature flags.
|
||||
set(CMAKE_${lang}_VERBOSE_FLAG "-V")
|
||||
|
||||
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
|
||||
set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O")
|
||||
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-O")
|
||||
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-g")
|
||||
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
|
||||
# The compiler front-end passes all object files, archive files, and shared
|
||||
# library files named on the command line to CreateExportList to create a
|
||||
# list of all symbols to be exported from the shared library. This causes
|
||||
# all archive members to be copied into the shared library whether they are
|
||||
# needed or not. Instead we run the tool ourselves to pass only the object
|
||||
# files so that we export only the symbols actually provided by the sources.
|
||||
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
|
||||
"${CMAKE_XL_CreateExportList} <OBJECT_DIR>/objects.exp <OBJECTS>"
|
||||
"<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
|
||||
)
|
||||
endmacro()
|
@ -18,6 +18,7 @@
|
||||
# [SVN_REVISION rev] # Revision to checkout from Subversion repo
|
||||
# [SVN_USERNAME john ] # Username for Subversion checkout and update
|
||||
# [SVN_PASSWORD doe ] # Password for Subversion checkout and update
|
||||
# [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate
|
||||
# [GIT_REPOSITORY url] # URL of git repo
|
||||
# [GIT_TAG tag] # Git branch name, commit id or tag
|
||||
# [URL /.../src.tgz] # Full path or URL of source
|
||||
@ -403,11 +404,11 @@ endfunction(_ep_write_verifyfile_script)
|
||||
function(_ep_write_extractfile_script script_filename name filename directory)
|
||||
set(args "")
|
||||
|
||||
if(filename MATCHES "(\\.bz2|\\.tar\\.gz|\\.tgz|\\.zip)$")
|
||||
if(filename MATCHES "(\\.|=)(bz2|tar\\.gz|tgz|zip)$")
|
||||
set(args xfz)
|
||||
endif()
|
||||
|
||||
if(filename MATCHES "\\.tar$")
|
||||
if(filename MATCHES "(\\.|=)tar$")
|
||||
set(args xf)
|
||||
endif()
|
||||
|
||||
@ -1026,6 +1027,7 @@ function(_ep_add_download_command name)
|
||||
get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION)
|
||||
get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME)
|
||||
get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
|
||||
get_property(svn_trust_cert TARGET ${name} PROPERTY _EP_SVN_TRUST_CERT)
|
||||
|
||||
set(repository "${svn_repository} user=${svn_username} password=${svn_password}")
|
||||
set(module)
|
||||
@ -1046,8 +1048,11 @@ function(_ep_add_download_command name)
|
||||
if(svn_password)
|
||||
set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
|
||||
endif()
|
||||
if(svn_trust_cert)
|
||||
set(svn_trust_cert_args --trust-server-cert)
|
||||
endif()
|
||||
set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision}
|
||||
${svn_user_pw_args} ${src_name})
|
||||
--non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name})
|
||||
list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
|
||||
elseif(git_repository)
|
||||
find_package(Git)
|
||||
@ -1109,10 +1114,15 @@ function(_ep_add_download_command name)
|
||||
else()
|
||||
if("${url}" MATCHES "^[a-z]+://")
|
||||
# TODO: Should download and extraction be different steps?
|
||||
string(REGEX MATCH "[^/]*$" fname "${url}")
|
||||
if(NOT "${fname}" MATCHES "\\.(bz2|tar|tgz|tar\\.gz|zip)$")
|
||||
string(REGEX MATCH "[^/\\?]*$" fname "${url}")
|
||||
if(NOT "${fname}" MATCHES "(\\.|=)(bz2|tar|tgz|tar\\.gz|zip)$")
|
||||
string(REGEX MATCH "([^/\\?]+(\\.|=)(bz2|tar|tgz|tar\\.gz|zip))/.*$" match_result "${url}")
|
||||
set(fname "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if(NOT "${fname}" MATCHES "(\\.|=)(bz2|tar|tgz|tar\\.gz|zip)$")
|
||||
message(FATAL_ERROR "Could not extract tarball filename from url:\n ${url}")
|
||||
endif()
|
||||
string(REPLACE ";" "-" fname "${fname}")
|
||||
set(file ${download_dir}/${fname})
|
||||
get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT)
|
||||
_ep_write_downloadfile_script("${stamp_dir}/download-${name}.cmake" "${url}" "${file}" "${timeout}" "${md5}")
|
||||
@ -1186,6 +1196,7 @@ function(_ep_add_update_command name)
|
||||
get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION)
|
||||
get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME)
|
||||
get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
|
||||
get_property(svn_trust_cert TARGET ${name} PROPERTY _EP_SVN_TRUST_CERT)
|
||||
set(svn_user_pw_args "")
|
||||
if(svn_username)
|
||||
set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}")
|
||||
@ -1193,8 +1204,11 @@ function(_ep_add_update_command name)
|
||||
if(svn_password)
|
||||
set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
|
||||
endif()
|
||||
if(svn_trust_cert)
|
||||
set(svn_trust_cert_args --trust-server-cert)
|
||||
endif()
|
||||
set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision}
|
||||
${svn_user_pw_args})
|
||||
--non-interactive ${svn_trust_cert_args} ${svn_user_pw_args})
|
||||
set(always 1)
|
||||
elseif(git_repository)
|
||||
if(NOT GIT_EXECUTABLE)
|
||||
|
100
Modules/FindArmadillo.cmake
Normal file
100
Modules/FindArmadillo.cmake
Normal file
@ -0,0 +1,100 @@
|
||||
# - Find Armadillo
|
||||
# Find the Armadillo C++ library
|
||||
#
|
||||
#
|
||||
# == Using Armadillo: ==
|
||||
# find_package(Armadillo RECQUIRED)
|
||||
# include_directories(${ARMADILLO_INCLUDE_DIRS})
|
||||
# add_executable(foo foo.cc)
|
||||
# target_link_libraries(foo ${ARMADILLO_LIBRARIES})
|
||||
#
|
||||
#=============================================================================
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# ARMADILLO_FOUND - set to true if the library is found
|
||||
# ARMADILLO_INCLUDE_DIRS - list of required include directories
|
||||
# ARMADILLO_LIBRARIES - list of libraries to be linked
|
||||
# ARMADILLO_VERSION_MAJOR - major version number
|
||||
# ARMADILLO_VERSION_MINOR - minor version number
|
||||
# ARMADILLO_VERSION_PATCH - patch version number
|
||||
# ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
|
||||
# ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
|
||||
#
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Clement Creusot <creusot@cs.york.ac.uk>
|
||||
#
|
||||
# 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.)
|
||||
|
||||
|
||||
# UNIX paths are standard, no need to write.
|
||||
find_library(ARMADILLO_LIBRARY
|
||||
NAMES armadillo
|
||||
PATHS "$ENV{ProgramFiles}/Armadillo/lib" "$ENV{ProgramFiles}/Armadillo/lib64" "$ENV{ProgramFiles}/Armadillo"
|
||||
)
|
||||
find_path(ARMADILLO_INCLUDE_DIR
|
||||
NAMES armadillo
|
||||
PATHS "$ENV{ProgramFiles}/Armadillo/include"
|
||||
)
|
||||
|
||||
|
||||
if(ARMADILLO_INCLUDE_DIR)
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Extract version information from <armadillo>
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
# WARNING: Early releases of Armadillo didn't have the arma_version.hpp file.
|
||||
# (e.g. v.0.9.8-1 in ubuntu maverick packages (2001-03-15))
|
||||
# If the file is missing, set all values to 0
|
||||
set(ARMADILLO_VERSION_MAJOR 0)
|
||||
set(ARMADILLO_VERSION_MINOR 0)
|
||||
set(ARMADILLO_VERSION_PATCH 0)
|
||||
set(ARMADILLO_VERSION_NAME "EARLY RELEASE")
|
||||
|
||||
if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
|
||||
|
||||
# Read and parse armdillo version header file for version number
|
||||
file(READ "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS)
|
||||
string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
|
||||
string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
|
||||
string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
|
||||
|
||||
# WARNING: The number of spaces before the version name is not one.
|
||||
string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
|
||||
|
||||
endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
|
||||
|
||||
set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
|
||||
endif (ARMADILLO_INCLUDE_DIR)
|
||||
|
||||
#======================
|
||||
|
||||
|
||||
# Checks 'RECQUIRED', 'QUIET' and versions.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Armadillo
|
||||
REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR
|
||||
VERSION_VAR ARMADILLO_VERSION_STRING)
|
||||
# version_var fails with cmake < 2.8.4.
|
||||
|
||||
if (ARMADILLO_FOUND)
|
||||
set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
|
||||
set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY})
|
||||
endif (ARMADILLO_FOUND)
|
||||
|
||||
|
||||
# Hide internal variables
|
||||
mark_as_advanced(
|
||||
ARMADILLO_INCLUDE_DIR
|
||||
ARMADILLO_LIBRARY)
|
||||
|
||||
#======================
|
@ -23,7 +23,7 @@
|
||||
##########
|
||||
### List of vendors (BLA_VENDOR) valid in this module
|
||||
## 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),
|
||||
## Intel( older versions of mkl 32 and 64 bit), ACML,Apple, NAS, Generic
|
||||
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,Apple, NAS, Generic
|
||||
# C/CXX should be enabled to use Intel mkl
|
||||
|
||||
#=============================================================================
|
||||
@ -39,12 +39,23 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
if (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
include(CheckFunctionExists)
|
||||
else ()
|
||||
include(CheckFortranFunctionExists)
|
||||
endif()
|
||||
|
||||
# Check the language being used
|
||||
get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES )
|
||||
if( _LANGUAGES_ MATCHES Fortran )
|
||||
set( _CHECK_FORTRAN TRUE )
|
||||
elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
|
||||
set( _CHECK_FORTRAN FALSE )
|
||||
else()
|
||||
if(BLAS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
|
||||
else(BLAS_FIND_REQUIRED)
|
||||
message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
|
||||
return()
|
||||
endif(BLAS_FIND_REQUIRED)
|
||||
endif( )
|
||||
|
||||
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads)
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
@ -102,7 +113,7 @@ if(_libraries_work)
|
||||
# Test this combination of libraries.
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads})
|
||||
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
if (_LANGUAGES_ MATCHES Fortran)
|
||||
if (_CHECK_FORTRAN)
|
||||
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
|
||||
else()
|
||||
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
|
||||
@ -244,7 +255,76 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
|
||||
endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
|
||||
|
||||
#BLAS in acml library?
|
||||
if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "ACML_MP" OR BLA_VENDOR STREQUAL "All")
|
||||
# the patch from Chuck Atkins:
|
||||
if( ((_BLAS_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR
|
||||
((_BLAS_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) )
|
||||
if( WIN32 )
|
||||
file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" )
|
||||
else()
|
||||
file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" )
|
||||
endif()
|
||||
if( _ACML_ROOT )
|
||||
get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH )
|
||||
if( SIZEOF_INTEGER EQUAL 8 )
|
||||
set( _ACML_PATH_SUFFIX "_int64" )
|
||||
else()
|
||||
set( _ACML_PATH_SUFFIX "" )
|
||||
endif()
|
||||
if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
|
||||
set( _ACML_COMPILER32 "ifort32" )
|
||||
set( _ACML_COMPILER64 "ifort64" )
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" )
|
||||
set( _ACML_COMPILER32 "sun32" )
|
||||
set( _ACML_COMPILER64 "sun64" )
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
|
||||
set( _ACML_COMPILER32 "pgi32" )
|
||||
if( WIN32 )
|
||||
set( _ACML_COMPILER64 "win64" )
|
||||
else()
|
||||
set( _ACML_COMPILER64 "pgi64" )
|
||||
endif()
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Open64" )
|
||||
# 32 bit builds not supported on Open64 but for code simplicity
|
||||
# We'll just use the same directory twice
|
||||
set( _ACML_COMPILER32 "open64_64" )
|
||||
set( _ACML_COMPILER64 "open64_64" )
|
||||
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
|
||||
set( _ACML_COMPILER32 "nag32" )
|
||||
set( _ACML_COMPILER64 "nag64" )
|
||||
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
|
||||
set( _ACML_COMPILER32 "gfortran32" )
|
||||
set( _ACML_COMPILER64 "gfortran64" )
|
||||
endif()
|
||||
|
||||
if( _BLAS_VENDOR STREQUAL "ACML_MP" )
|
||||
set(_ACML_MP_LIB_DIRS
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
|
||||
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
|
||||
set(_ACML_LIB_DIRS
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
|
||||
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( _BLAS_VENDOR STREQUAL "ACML_MP" )
|
||||
foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS} )
|
||||
_BLAS_LOCATE_AND_TEST( ${_BLAS_VENDOR} "acml_mp;acml_mv" "" )
|
||||
if( BLAS_${_BLAS_VENDOR}_FOUND )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
|
||||
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
|
||||
_BLAS_LOCATE_AND_TEST( ${_BLAS_VENDOR} "acml;acml_mv" "" )
|
||||
if( BLAS_${_BLAS_VENDOR}_FOUND )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
@ -266,7 +346,7 @@ if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
|
||||
""
|
||||
)
|
||||
endif(NOT BLAS_LIBRARIES)
|
||||
endif (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
|
||||
endif () # ACML
|
||||
|
||||
# Apple BLAS library?
|
||||
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||
|
@ -9,10 +9,9 @@
|
||||
# The module will optionally accept the COMPONENTS argument. If no COMPONENTS
|
||||
# are specified, then the find module will default to finding only the HDF5 C
|
||||
# library. If one or more COMPONENTS are specified, the module will attempt to
|
||||
# find the language bindings for the specified components. Currently, the only
|
||||
# valid components are C and CXX. The module does not yet support finding the
|
||||
# Fortran bindings. If the COMPONENTS argument is not given, the module will
|
||||
# attempt to find only the C bindings.
|
||||
# find the language bindings for the specified components. The only valid
|
||||
# components are C, CXX, Fortran, and HL. If the COMPONENTS argument is not
|
||||
# given, the module will attempt to find only the C bindings.
|
||||
#
|
||||
# On UNIX systems, this module will read the variable HDF5_USE_STATIC_LIBRARIES
|
||||
# to determine whether or not to prefer a static link to a dynamic link for HDF5
|
||||
@ -33,12 +32,15 @@
|
||||
# HDF5_DEFINITIONS - Required compiler definitions for HDF5
|
||||
# HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
|
||||
# HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
|
||||
# HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
|
||||
# HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API
|
||||
# HDF5_LIBRARIES - Required libraries for all requested bindings
|
||||
# HDF5_FOUND - true if HDF5 was found on the system
|
||||
# HDF5_LIBRARY_DIRS - the full set of library directories
|
||||
# HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
|
||||
# HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
|
||||
# HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
|
||||
# HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
|
||||
# HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
|
||||
|
||||
#=============================================================================
|
||||
@ -63,8 +65,26 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
set( HDF5_VALID_COMPONENTS
|
||||
C
|
||||
CXX
|
||||
Fortran
|
||||
HL
|
||||
)
|
||||
|
||||
# Validate the list of find components.
|
||||
if( NOT HDF5_FIND_COMPONENTS )
|
||||
set( HDF5_LANGUAGE_BINDINGS "C" )
|
||||
else()
|
||||
# add the extra specified components, ensuring that they are valid.
|
||||
foreach( component ${HDF5_FIND_COMPONENTS} )
|
||||
list( FIND HDF5_VALID_COMPONENTS ${component} component_location )
|
||||
if( ${component_location} EQUAL -1 )
|
||||
message( FATAL_ERROR
|
||||
"\"${component}\" is not a valid HDF5 component." )
|
||||
else()
|
||||
list( APPEND HDF5_LANGUAGE_BINDINGS ${component} )
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# try to find the HDF5 wrapper compilers
|
||||
find_program( HDF5_C_COMPILER_EXECUTABLE
|
||||
NAMES h5cc h5pcc
|
||||
@ -80,6 +100,13 @@ find_program( HDF5_CXX_COMPILER_EXECUTABLE
|
||||
DOC "HDF5 C++ Wrapper compiler. Used only to detect HDF5 compile flags." )
|
||||
mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE )
|
||||
|
||||
find_program( HDF5_Fortran_COMPILER_EXECUTABLE
|
||||
NAMES h5fc h5pfc
|
||||
HINTS ENV HDF5_ROOT
|
||||
PATH_SUFFIXES bin Bin
|
||||
DOC "HDF5 Fortran Wrapper compiler. Used only to detect HDF5 compile flags." )
|
||||
mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
|
||||
|
||||
find_program( HDF5_DIFF_EXECUTABLE
|
||||
NAMES h5diff
|
||||
HINTS ENV HDF5_ROOT
|
||||
@ -152,31 +179,39 @@ macro( _HDF5_parse_compile_line
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
if( HDF5_INCLUDE_DIRS AND HDF5_LIBRARIES )
|
||||
# Do nothing: we already have HDF5_INCLUDE_PATH and HDF5_LIBRARIES in the
|
||||
# cache, it would be a shame to override them
|
||||
else()
|
||||
_HDF5_invoke_compiler( C HDF5_C_COMPILE_LINE HDF5_C_RETURN_VALUE )
|
||||
_HDF5_invoke_compiler( CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE )
|
||||
|
||||
if( NOT HDF5_FIND_COMPONENTS )
|
||||
set( HDF5_LANGUAGE_BINDINGS "C" )
|
||||
else()
|
||||
# add the extra specified components, ensuring that they are valid.
|
||||
foreach( component ${HDF5_FIND_COMPONENTS} )
|
||||
list( FIND HDF5_VALID_COMPONENTS ${component} component_location )
|
||||
if( ${component_location} EQUAL -1 )
|
||||
message( FATAL_ERROR
|
||||
"\"${component}\" is not a valid HDF5 component." )
|
||||
else()
|
||||
list( APPEND HDF5_LANGUAGE_BINDINGS ${component} )
|
||||
# Try to find HDF5 using an installed hdf5-config.cmake
|
||||
if( NOT HDF5_FOUND )
|
||||
find_package( HDF5 QUIET NO_MODULE )
|
||||
if( HDF5_FOUND )
|
||||
set( HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR} )
|
||||
set( HDF5_LIBRARIES )
|
||||
set( HDF5_C_TARGET hdf5 )
|
||||
set( HDF5_CXX_TARGET hdf5_cpp )
|
||||
set( HDF5_HL_TARGET hdf5_hl )
|
||||
set( HDF5_Fortran_TARGET hdf5_fortran )
|
||||
foreach( _component ${HDF5_LANGUAGE_BINDINGS} )
|
||||
list( FIND HDF5_VALID_COMPONENTS ${_component} _component_location )
|
||||
get_target_property( _comp_location ${HDF5_${_component}_TARGET} LOCATION )
|
||||
if( _comp_location )
|
||||
set( HDF5_${_component}_LIBRARY ${_comp_location} CACHE PATH
|
||||
"HDF5 ${_component} library" )
|
||||
mark_as_advanced( HDF5_${_component}_LIBRARY )
|
||||
list( APPEND HDF5_LIBRARIES ${HDF5_${_component}_LIBRARY} )
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if( NOT HDF5_FOUND )
|
||||
_HDF5_invoke_compiler( C HDF5_C_COMPILE_LINE HDF5_C_RETURN_VALUE )
|
||||
_HDF5_invoke_compiler( CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE )
|
||||
_HDF5_invoke_compiler( Fortran HDF5_Fortran_COMPILE_LINE HDF5_Fortran_RETURN_VALUE )
|
||||
|
||||
# seed the initial lists of libraries to find with items we know we need
|
||||
set( HDF5_C_LIBRARY_NAMES_INIT hdf5_hl hdf5 )
|
||||
set( HDF5_C_LIBRARY_NAMES_INIT hdf5 )
|
||||
set( HDF5_HL_LIBRARY_NAMES_INIT hdf5_hl ${HDF5_C_LIBRARY_NAMES_INIT} )
|
||||
set( HDF5_CXX_LIBRARY_NAMES_INIT hdf5_cpp ${HDF5_C_LIBRARY_NAMES_INIT} )
|
||||
set( HDF5_Fortran_LIBRARY_NAMES_INIT hdf5_fortran ${HDF5_C_LIBRARY_NAMES_INIT} )
|
||||
|
||||
foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} )
|
||||
if( HDF5_${LANGUAGE}_COMPILE_LINE )
|
||||
@ -198,7 +233,13 @@ else()
|
||||
list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} )
|
||||
|
||||
# find the HDF5 include directories
|
||||
find_path( HDF5_${LANGUAGE}_INCLUDE_DIR hdf5.h
|
||||
if(${LANGUAGE} STREQUAL "Fortran")
|
||||
set(HDF5_INCLUDE_FILENAME hdf5.mod)
|
||||
else()
|
||||
set(HDF5_INCLUDE_FILENAME hdf5.h)
|
||||
endif()
|
||||
|
||||
find_path( HDF5_${LANGUAGE}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME}
|
||||
HINTS
|
||||
${HDF5_${LANGUAGE}_INCLUDE_FLAGS}
|
||||
ENV
|
||||
@ -266,26 +307,41 @@ else()
|
||||
|
||||
# We may have picked up some duplicates in various lists during the above
|
||||
# process for the language bindings (both the C and C++ bindings depend on
|
||||
# libz for example). Remove the duplicates.
|
||||
# libz for example). Remove the duplicates. It appears that the default
|
||||
# CMake behavior is to remove duplicates from the end of a list. However,
|
||||
# for link lines, this is incorrect since unresolved symbols are searched
|
||||
# for down the link line. Therefore, we reverse the list, remove the
|
||||
# duplicates, and then reverse it again to get the duplicates removed from
|
||||
# the beginning.
|
||||
macro( _remove_duplicates_from_beginning _list_name )
|
||||
list( REVERSE ${_list_name} )
|
||||
list( REMOVE_DUPLICATES ${_list_name} )
|
||||
list( REVERSE ${_list_name} )
|
||||
endmacro()
|
||||
|
||||
if( HDF5_INCLUDE_DIRS )
|
||||
list( REMOVE_DUPLICATES HDF5_INCLUDE_DIRS )
|
||||
_remove_duplicates_from_beginning( HDF5_INCLUDE_DIRS )
|
||||
endif()
|
||||
if( HDF5_LIBRARIES_DEBUG )
|
||||
list( REMOVE_DUPLICATES HDF5_LIBRARIES_DEBUG )
|
||||
_remove_duplicates_from_beginning( HDF5_LIBRARIES_DEBUG )
|
||||
endif()
|
||||
if( HDF5_LIBRARIES_RELEASE )
|
||||
list( REMOVE_DUPLICATES HDF5_LIBRARIES_RELEASE )
|
||||
_remove_duplicates_from_beginning( HDF5_LIBRARIES_RELEASE )
|
||||
endif()
|
||||
if( HDF5_LIBRARY_DIRS )
|
||||
list( REMOVE_DUPLICATES HDF5_LIBRARY_DIRS )
|
||||
_remove_duplicates_from_beginning( HDF5_LIBRARY_DIRS )
|
||||
endif()
|
||||
|
||||
# Construct the complete list of HDF5 libraries with debug and optimized
|
||||
# variants when the generator supports them.
|
||||
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
set( HDF5_LIBRARIES
|
||||
debug ${HDF5_LIBRARIES_DEBUG}
|
||||
optimized ${HDF5_LIBRARIES_RELEASE} )
|
||||
set( HDF5_LIBRARIES )
|
||||
foreach( _lib ${HDF5_LIBRARIES_DEBUG} )
|
||||
list( APPEND HDF5_LIBRARIES debug ${_lib} )
|
||||
endforeach()
|
||||
foreach( _lib ${HDF5_LIBRARIES_RELEASE} )
|
||||
list( APPEND HDF5_LIBRARIES optimized ${_lib} )
|
||||
endforeach()
|
||||
else()
|
||||
set( HDF5_LIBRARIES ${HDF5_LIBRARIES_RELEASE} )
|
||||
endif()
|
||||
@ -307,6 +363,12 @@ else()
|
||||
"HDF5 library compiled with parallel IO support" )
|
||||
mark_as_advanced( HDF5_IS_PARALLEL )
|
||||
|
||||
# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
|
||||
# HDF5_INCLUDE_DIRS
|
||||
if( HDF5_INCLUDE_DIRS )
|
||||
set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args( HDF5 DEFAULT_MSG
|
||||
@ -314,15 +376,3 @@ find_package_handle_standard_args( HDF5 DEFAULT_MSG
|
||||
HDF5_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
HDF5_INCLUDE_DIRS
|
||||
HDF5_LIBRARIES
|
||||
HDF5_DEFINTIONS
|
||||
HDF5_LIBRARY_DIRS
|
||||
HDF5_C_COMPILER_EXECUTABLE
|
||||
HDF5_CXX_COMPILER_EXECUTABLE )
|
||||
|
||||
# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
|
||||
# HDF5_INCLUDE_DIRS
|
||||
set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
|
||||
|
||||
|
@ -37,19 +37,21 @@
|
||||
# If this succeeds (possibly because ITK_DIR is already set), the
|
||||
# command will have already loaded ITKConfig.cmake and set ITK_FOUND.
|
||||
IF(NOT ITK_FOUND)
|
||||
FIND_PACKAGE(ITK QUIET NO_MODULE
|
||||
SET(_ITK_REQUIRED "")
|
||||
IF(ITK_FIND_REQUIRED)
|
||||
SET(_ITK_REQUIRED REQUIRED)
|
||||
ENDIF()
|
||||
SET(_ITK_QUIET "")
|
||||
IF(ITK_FIND_QUIETLY)
|
||||
SET(_ITK_QUIET QUIET)
|
||||
ENDIF()
|
||||
FIND_PACKAGE(ITK ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE
|
||||
NAMES ITK InsightToolkit
|
||||
CONFIGS ITKConfig.cmake
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET(ITK_DIR_MESSAGE "Please set ITK_DIR to the directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.")
|
||||
|
||||
IF(ITK_FOUND)
|
||||
# Set USE_ITK_FILE for backward-compatability.
|
||||
SET(USE_ITK_FILE ${ITK_USE_FILE})
|
||||
ELSEIF(ITK_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR ${ITK_DIR_MESSAGE})
|
||||
ELSEIF(NOT ITK_FIND_QUIETLY)
|
||||
MESSAGE(STATUS ${ITK_DIR_MESSAGE})
|
||||
ENDIF()
|
||||
|
@ -114,6 +114,7 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
||||
/usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
|
||||
/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
|
||||
/usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
|
||||
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
|
||||
# Debian specific paths for default JVM
|
||||
/usr/lib/jvm/default-java/jre/lib/{libarch}
|
||||
/usr/lib/jvm/default-java/jre/lib
|
||||
@ -226,6 +227,8 @@ FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
|
||||
${JAVA_INCLUDE_PATH}/linux
|
||||
${JAVA_INCLUDE_PATH}/freebsd
|
||||
${JAVA_INCLUDE_PATH}/solaris
|
||||
${JAVA_INCLUDE_PATH}/hp-ux
|
||||
${JAVA_INCLUDE_PATH}/alpha
|
||||
)
|
||||
|
||||
FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
# Copyright 2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@ -105,9 +105,9 @@ IF(Java_JAVA_EXECUTABLE)
|
||||
# 2. OpenJDK 1.6
|
||||
# 3. GCJ 1.5
|
||||
# 4. Kaffe 1.4.2
|
||||
IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_]+[oem-]*\".*")
|
||||
IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+[oem-]*\".*")
|
||||
# This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
|
||||
STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_]+)[oem-]*\".*"
|
||||
STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+)[oem-]*\".*"
|
||||
"\\1" Java_VERSION_STRING "${var}" )
|
||||
ELSEIF(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
|
||||
# Kaffe style
|
||||
@ -122,7 +122,7 @@ IF(Java_JAVA_EXECUTABLE)
|
||||
STRING( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
|
||||
STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
|
||||
# warning tweak version can be empty:
|
||||
STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+\\_?([0-9]*)$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
|
||||
STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+\\_?\\.?([0-9]*)$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
|
||||
if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
|
||||
set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
|
||||
else( )
|
||||
|
@ -1,59 +1,70 @@
|
||||
# - Message Passing Interface (MPI) module.
|
||||
#
|
||||
# - Find a Message Passing Interface (MPI) implementation
|
||||
# The Message Passing Interface (MPI) is a library used to write
|
||||
# high-performance parallel applications that use message passing, and
|
||||
# high-performance distributed-memory parallel applications, and
|
||||
# is typically deployed on a cluster. MPI is a standard interface
|
||||
# (defined by the MPI forum) for which many implementations are
|
||||
# available. All of these implementations have somewhat different
|
||||
# compilation approaches (different include paths, libraries to link
|
||||
# against, etc.), and this module tries to smooth out those differences.
|
||||
# available. All of them have somewhat different include paths,
|
||||
# libraries to link against, etc., and this module tries to smooth
|
||||
# out those differences.
|
||||
#
|
||||
# This module will set the following variables:
|
||||
# MPI_FOUND TRUE if we have found MPI
|
||||
# MPI_COMPILE_FLAGS Compilation flags for MPI programs
|
||||
# MPI_INCLUDE_PATH Include path(s) for MPI header
|
||||
# MPI_LINK_FLAGS Linking flags for MPI programs
|
||||
# MPI_LIBRARY First MPI library to link against (cached)
|
||||
# MPI_EXTRA_LIBRARY Extra MPI libraries to link against (cached)
|
||||
# MPI_LIBRARIES All libraries to link MPI programs against
|
||||
# === Variables ===
|
||||
#
|
||||
# This module will set the following variables per language in your project,
|
||||
# where <lang> is one of C, CXX, or Fortran:
|
||||
# MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang>
|
||||
# MPI_<lang>_COMPILER MPI Compiler wrapper for <lang>
|
||||
# MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs
|
||||
# MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header
|
||||
# MPI_<lang>_LINK_FLAGS Linking flags for MPI programs
|
||||
# MPI_<lang>_LIBRARIES All libraries to link MPI programs against
|
||||
# Additionally, FindMPI sets the following variables for running MPI
|
||||
# programs from the command line:
|
||||
# MPIEXEC Executable for running MPI programs
|
||||
# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving it the
|
||||
# number of processors to run on
|
||||
# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly before the
|
||||
# executable to run.
|
||||
# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after all other flags.
|
||||
# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving
|
||||
# it the number of processors to run on
|
||||
# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly
|
||||
# before the executable to run.
|
||||
# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
|
||||
# === Usage ===
|
||||
#
|
||||
# This module will attempt to auto-detect these settings, first by
|
||||
# looking for a MPI compiler, which many MPI implementations provide
|
||||
# as a pass-through to the native compiler to simplify the compilation
|
||||
# of MPI programs. The MPI compiler is stored in the cache variable
|
||||
# MPI_COMPILER, and will attempt to look for commonly-named drivers
|
||||
# mpic++, mpicxx, mpiCC, or mpicc. If the compiler driver is found and
|
||||
# recognized, it will be used to set all of the module variables. To
|
||||
# skip this auto-detection, set MPI_LIBRARY and MPI_INCLUDE_PATH in
|
||||
# the CMake cache.
|
||||
# To use this module, simply call FindMPI from a CMakeLists.txt file, or
|
||||
# run find_package(MPI), then run CMake. If you are happy with the auto-
|
||||
# detected configuration for your language, then you're done. If not, you
|
||||
# have two options:
|
||||
# 1. Set MPI_<lang>_COMPILER to the MPI wrapper (mpicc, etc.) of your
|
||||
# choice and reconfigure. FindMPI will attempt to determine all the
|
||||
# necessary variables using THAT compiler's compile and link flags.
|
||||
# 2. If this fails, or if your MPI implementation does not come with
|
||||
# a compiler wrapper, then set both MPI_<lang>_LIBRARIES and
|
||||
# MPI_<lang>_INCLUDE_PATH. You may also set any other variables
|
||||
# listed above, but these two are required. This will circumvent
|
||||
# autodetection entirely.
|
||||
# When configuration is successful, MPI_<lang>_COMPILER will be set to the
|
||||
# compiler wrapper for <lang>, if it was found. MPI_<lang>_FOUND and other
|
||||
# variables above will be set if any MPI implementation was found for <lang>,
|
||||
# regardless of whether a compiler was found.
|
||||
#
|
||||
# If no compiler driver is found or the compiler driver is not
|
||||
# recognized, this module will then search for common include paths
|
||||
# and library names to try to detect MPI.
|
||||
#
|
||||
# If CMake initially finds a different MPI than was intended, and you
|
||||
# want to use the MPI compiler auto-detection for a different MPI
|
||||
# implementation, set MPI_COMPILER to the MPI compiler driver you want
|
||||
# to use (e.g., mpicxx) and then set MPI_LIBRARY to the string
|
||||
# MPI_LIBRARY-NOTFOUND. When you re-configure, auto-detection of MPI
|
||||
# will run again with the newly-specified MPI_COMPILER.
|
||||
#
|
||||
# When using MPIEXEC to execute MPI applications, you should typically
|
||||
# use all of the MPIEXEC flags as follows:
|
||||
# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS ${MPIEXEC_PREFLAGS} EXECUTABLE
|
||||
# ${MPIEXEC_POSTFLAGS} ARGS
|
||||
# When using MPIEXEC to execute MPI applications, you should typically use
|
||||
# all of the MPIEXEC flags as follows:
|
||||
# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
|
||||
# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
|
||||
# where PROCS is the number of processors on which to execute the program,
|
||||
# EXECUTABLE is the MPI program, and ARGS are the arguments to pass to the
|
||||
# MPI program.
|
||||
#
|
||||
# === Backward Compatibility ===
|
||||
#
|
||||
# For backward compatibility with older versions of FindMPI, these
|
||||
# variables are set, but deprecated:
|
||||
# MPI_FOUND MPI_COMPILER MPI_LIBRARY
|
||||
# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY
|
||||
# MPI_LINK_FLAGS MPI_LIBRARIES
|
||||
# In new projects, please use the MPI_<lang>_XXX equivalents.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2001-2009 Kitware, Inc.
|
||||
# Copyright 2001-2011 Kitware, Inc.
|
||||
# Copyright 2010-2011 Todd Gamblin tgamblin@llnl.gov
|
||||
# Copyright 2001-2009 Dave Partyka
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@ -65,295 +76,484 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# This module is maintained by David Partyka <dave.partyka@kitware.com>.
|
||||
# include this to handle the QUIETLY and REQUIRED arguments
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
include(GetPrerequisites)
|
||||
|
||||
# A set of directories to search through in addition to the standard system paths
|
||||
# that find_program will search through.
|
||||
# Microsoft HPC SDK is automatically added to the system path
|
||||
# Argonne National Labs MPICH2 sets a registry key that we can use.
|
||||
#
|
||||
# This part detects MPI compilers, attempting to wade through the mess of compiler names in
|
||||
# a sensible way.
|
||||
#
|
||||
# The compilers are detected in this order:
|
||||
#
|
||||
# 1. Try to find the most generic availble MPI compiler, as this is usually set up by
|
||||
# cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's
|
||||
# the right compiler.
|
||||
#
|
||||
# 2. If a generic mpicc is NOT found, then we attempt to find one that matches
|
||||
# CMAKE_<lang>_COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc
|
||||
# and company, but not mpiicc. This hopefully prevents toolchain mismatches.
|
||||
#
|
||||
# If you want to force a particular MPI compiler other than what we autodetect (e.g. if you
|
||||
# want to compile regular stuff with GNU and parallel stuff with Intel), you can always set
|
||||
# your favorite MPI_<lang>_COMPILER explicitly and this stuff will be ignored.
|
||||
#
|
||||
|
||||
set(_MPI_PACKAGE_DIR
|
||||
mpi
|
||||
mpich
|
||||
openmpi
|
||||
lib/mpi
|
||||
lib/mpich
|
||||
lib/openmpi
|
||||
"MPICH/SDK"
|
||||
"Microsoft Compute Cluster Pack"
|
||||
"Microsoft HPC Pack 2008 R2"
|
||||
)
|
||||
# Start out with the generic MPI compiler names, as these are most commonly used.
|
||||
set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r)
|
||||
set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++
|
||||
mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r)
|
||||
set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r
|
||||
mpif90 mpif90_r mpf90 mpf90_r
|
||||
mpif77 mpif77_r mpf77 mpf77_r)
|
||||
|
||||
# GNU compiler names
|
||||
set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r)
|
||||
set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r)
|
||||
set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r
|
||||
mpig77 mpig77_r mpg77 mpg77_r)
|
||||
|
||||
# Intel MPI compiler names
|
||||
set(_MPI_Intel_C_COMPILER_NAMES mpiicc)
|
||||
set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC)
|
||||
set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77)
|
||||
|
||||
# PGI compiler names
|
||||
set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc)
|
||||
set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC)
|
||||
set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77)
|
||||
|
||||
# XLC MPI Compiler names
|
||||
set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r)
|
||||
set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC
|
||||
mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r)
|
||||
set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r
|
||||
mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r
|
||||
mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r
|
||||
mpixlf mpixlf_r mpxlf mpxlf_r)
|
||||
|
||||
# append vendor-specific compilers to the list if we either don't know the compiler id,
|
||||
# or if we know it matches the regular compiler.
|
||||
foreach (lang C CXX Fortran)
|
||||
foreach (id GNU Intel PGI XL)
|
||||
if (NOT CMAKE_${lang}_COMPILER_ID OR "${CMAKE_${lang}_COMPILER_ID}" STREQUAL "${id}")
|
||||
list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES})
|
||||
endif()
|
||||
unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
|
||||
# Names to try for MPI exec
|
||||
set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun)
|
||||
|
||||
# Grab the path to MPI from the registry if we're on windows.
|
||||
set(_MPI_PREFIX_PATH)
|
||||
if(WIN32)
|
||||
list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..")
|
||||
list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]")
|
||||
list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/")
|
||||
endif()
|
||||
|
||||
# Build a list of prefixes to search for MPI.
|
||||
foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH})
|
||||
foreach(MpiPackageDir ${_MPI_PREFIX_PATH})
|
||||
if(EXISTS ${SystemPrefixDir}/${MpiPackageDir})
|
||||
list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}")
|
||||
endif()
|
||||
endforeach(MpiPackageDir)
|
||||
endforeach(SystemPrefixDir)
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
|
||||
#
|
||||
# interrogate_mpi_compiler(lang try_libs)
|
||||
#
|
||||
# Attempts to extract compiler and linker args from an MPI compiler. The arguments set
|
||||
# by this function are:
|
||||
#
|
||||
# MPI_<lang>_INCLUDE_PATH MPI_<lang>_LINK_FLAGS MPI_<lang>_FOUND
|
||||
# MPI_<lang>_COMPILE_FLAGS MPI_<lang>_LIBRARIES
|
||||
#
|
||||
# MPI_<lang>_COMPILER must be set beforehand to the absolute path to an MPI compiler for
|
||||
# <lang>. Additionally, MPI_<lang>_INCLUDE_PATH and MPI_<lang>_LIBRARIES may be set
|
||||
# to skip autodetection.
|
||||
#
|
||||
# If try_libs is TRUE, this will also attempt to find plain MPI libraries in the usual
|
||||
# way. In general, this is not as effective as interrogating the compilers, as it
|
||||
# ignores language-specific flags and libraries. However, some MPI implementations
|
||||
# (Windows implementations) do not have compiler wrappers, so this approach must be used.
|
||||
#
|
||||
function (interrogate_mpi_compiler lang try_libs)
|
||||
# if it's already in the cache, don't bother with any of this stuff
|
||||
if ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))
|
||||
if (MPI_${lang}_COMPILER)
|
||||
# Check whether the -showme:compile option works. This indicates that we have either OpenMPI
|
||||
# or a newer version of LAM-MPI, and implies that -showme:link will also work.
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -showme:compile
|
||||
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE MPI_COMPILER_RETURN)
|
||||
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# If we appear to have -showme:compile, then we should
|
||||
# also have -showme:link. Try it.
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -showme:link
|
||||
OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE MPI_COMPILER_RETURN)
|
||||
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# We probably have -showme:incdirs and -showme:libdirs as well,
|
||||
# so grab that while we're at it.
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -showme:incdirs
|
||||
OUTPUT_VARIABLE MPI_INCDIRS OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_INCDIRS ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -showme:libdirs
|
||||
OUTPUT_VARIABLE MPI_LIBDIRS OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_LIBDIRS ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
else()
|
||||
# reset things here if something went wrong.
|
||||
set(MPI_COMPILE_CMDLINE)
|
||||
set(MPI_LINK_CMDLINE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
# Older versions of LAM-MPI have "-showme". Try to find that.
|
||||
if (NOT MPI_COMPILER_RETURN EQUAL 0)
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -showme
|
||||
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE MPI_COMPILER_RETURN)
|
||||
endif()
|
||||
|
||||
# MVAPICH uses -compile-info and -link-info. Try them.
|
||||
if (NOT MPI_COMPILER_RETURN EQUAL 0)
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -compile-info
|
||||
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE MPI_COMPILER_RETURN)
|
||||
|
||||
# If we have compile-info, also have link-info.
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -link-info
|
||||
OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE MPI_COMPILER_RETURN)
|
||||
endif()
|
||||
|
||||
# make sure we got compile and link. Reset vars if something's wrong.
|
||||
if (NOT MPI_COMPILER_RETURN EQUAL 0)
|
||||
set(MPI_COMPILE_CMDLINE)
|
||||
set(MPI_LINK_CMDLINE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# MPICH just uses "-show". Try it.
|
||||
if (NOT MPI_COMPILER_RETURN EQUAL 0)
|
||||
execute_process(
|
||||
COMMAND ${MPI_${lang}_COMPILER} -show
|
||||
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE MPI_COMPILER_RETURN)
|
||||
endif()
|
||||
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE
|
||||
# into MPI_LINK_CMDLINE, if we didn't find the link line.
|
||||
if (NOT MPI_LINK_CMDLINE)
|
||||
set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE})
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Unable to determine MPI from MPI driver ${MPI_${lang}_COMPILER}")
|
||||
set(MPI_COMPILE_CMDLINE)
|
||||
set(MPI_LINK_CMDLINE)
|
||||
endif()
|
||||
|
||||
# Here, we're done with the interrogation part, and we'll try to extract args we care
|
||||
# about from what we learned from the compiler wrapper scripts.
|
||||
|
||||
# If interrogation came back with something, extract our variable from the MPI command line
|
||||
if (MPI_COMPILE_CMDLINE OR MPI_LINK_CMDLINE)
|
||||
# Extract compile flags from the compile command line.
|
||||
string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
|
||||
set(MPI_COMPILE_FLAGS_WORK)
|
||||
|
||||
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
|
||||
if (MPI_COMPILE_FLAGS_WORK)
|
||||
set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}")
|
||||
else()
|
||||
set(MPI_COMPILE_FLAGS_WORK ${FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Extract include paths from compile command line
|
||||
string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
|
||||
foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
|
||||
string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH})
|
||||
string(REGEX REPLACE "//" "/" IPATH ${IPATH})
|
||||
list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
|
||||
endforeach()
|
||||
|
||||
# try using showme:incdirs if extracting didn't work.
|
||||
if (NOT MPI_INCLUDE_PATH_WORK)
|
||||
set(MPI_INCLUDE_PATH_WORK ${MPI_INCDIRS})
|
||||
separate_arguments(MPI_INCLUDE_PATH_WORK)
|
||||
endif()
|
||||
|
||||
# If all else fails, just search for mpi.h in the normal include paths.
|
||||
if (NOT MPI_INCLUDE_PATH_WORK)
|
||||
set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
|
||||
find_path(MPI_HEADER_PATH mpi.h
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES include)
|
||||
set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH})
|
||||
endif()
|
||||
|
||||
# Extract linker paths from the link command line
|
||||
string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
|
||||
set(MPI_LINK_PATH)
|
||||
foreach(LPATH ${MPI_ALL_LINK_PATHS})
|
||||
string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
|
||||
string(REGEX REPLACE "//" "/" LPATH ${LPATH})
|
||||
list(APPEND MPI_LINK_PATH ${LPATH})
|
||||
endforeach()
|
||||
|
||||
# try using showme:libdirs if extracting didn't work.
|
||||
if (NOT MPI_LINK_PATH)
|
||||
set(MPI_LINK_PATH ${MPI_LIBDIRS})
|
||||
separate_arguments(MPI_LINK_PATH)
|
||||
endif()
|
||||
|
||||
# Extract linker flags from the link command line
|
||||
string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
|
||||
set(MPI_LINK_FLAGS_WORK)
|
||||
foreach(FLAG ${MPI_ALL_LINK_FLAGS})
|
||||
if (MPI_LINK_FLAGS_WORK)
|
||||
set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}")
|
||||
else()
|
||||
set(MPI_LINK_FLAGS_WORK ${FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Extract the set of libraries to link against from the link command
|
||||
# line
|
||||
string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
|
||||
|
||||
# Determine full path names for all of the libraries that one needs
|
||||
# to link against in an MPI program
|
||||
foreach(LIB ${MPI_LIBNAMES})
|
||||
string(REGEX REPLACE "^ ?-l" "" LIB ${LIB})
|
||||
# MPI_LIB is cached by find_library, but we don't want that. Clear it first.
|
||||
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
|
||||
find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH})
|
||||
|
||||
if (MPI_LIB)
|
||||
list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
|
||||
elseif (NOT MPI_FIND_QUIETLY)
|
||||
message(WARNING "Unable to find MPI library ${LIB}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Sanity check MPI_LIBRARIES to make sure there are enough libraries
|
||||
list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS)
|
||||
list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED)
|
||||
if (NOT MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
|
||||
set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
elseif(try_libs)
|
||||
# If we didn't have an MPI compiler script to interrogate, attempt to find everything
|
||||
# with plain old find functions. This is nasty because MPI implementations have LOTS of
|
||||
# different library names, so this section isn't going to be very generic. We need to
|
||||
# make sure it works for MS MPI, though, since there are no compiler wrappers for that.
|
||||
find_path(MPI_HEADER_PATH mpi.h
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES include Inc)
|
||||
set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH})
|
||||
|
||||
# Decide between 32-bit and 64-bit libraries for Microsoft's MPI
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
|
||||
set(MS_MPI_ARCH_DIR amd64)
|
||||
else()
|
||||
set(MS_MPI_ARCH_DIR i386)
|
||||
endif()
|
||||
|
||||
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
|
||||
find_library(MPI_LIB
|
||||
NAMES mpi mpich mpich2 msmpi
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR})
|
||||
set(MPI_LIBRARIES_WORK ${MPI_LIB})
|
||||
|
||||
# Right now, we only know about the extra libs for C++.
|
||||
# We could add Fortran here (as there is usually libfmpich, etc.), but
|
||||
# this really only has to work with MS MPI on Windows.
|
||||
# Assume that other MPI's are covered by the compiler wrappers.
|
||||
if (${lang} STREQUAL CXX)
|
||||
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
|
||||
find_library(MPI_LIB
|
||||
NAMES mpi++ mpicxx cxx mpi_cxx
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES lib)
|
||||
if (MPI_LIBRARIES_WORK AND MPI_LIB)
|
||||
set(MPI_LIBRARIES_WORK "${MPI_LIBRARIES_WORK} ${MPI_LIB}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT MPI_LIBRARIES_WORK)
|
||||
set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If we found MPI, set up all of the appropriate cache entries
|
||||
set(MPI_${lang}_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI ${lang} compilation flags" FORCE)
|
||||
set(MPI_${lang}_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI ${lang} include path" FORCE)
|
||||
set(MPI_${lang}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${lang} linking flags" FORCE)
|
||||
set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE)
|
||||
mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES)
|
||||
|
||||
# clear out our temporary lib/header detectionv variable here.
|
||||
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE)
|
||||
set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE)
|
||||
endif()
|
||||
|
||||
# finally set a found variable for each MPI language
|
||||
if (MPI_${lang}_INCLUDE_PATH AND MPI_${lang}_LIBRARIES)
|
||||
set(MPI_${lang}_FOUND TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(MPI_${lang}_FOUND FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
# End definitions, commence real work here.
|
||||
|
||||
# Most mpi distros have some form of mpiexec which gives us something we can reliably look for.
|
||||
find_program(MPIEXEC
|
||||
NAMES mpiexec mpirun lamexec
|
||||
NAMES ${_MPI_EXEC_NAMES}
|
||||
PATHS ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES bin
|
||||
DOC "Executable for running MPI programs."
|
||||
)
|
||||
DOC "Executable for running MPI programs.")
|
||||
|
||||
# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin).
|
||||
# This gives us a fairly reliable base directory to search for /bin /lib and /include from.
|
||||
get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH)
|
||||
get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH)
|
||||
|
||||
# If there is an mpi compiler find it and interogate (farther below) it for the include
|
||||
# and lib dirs otherwise we will continue to search from ${_MPI_BASE_DIR}.
|
||||
find_program(MPI_COMPILER
|
||||
NAMES mpic++ mpicxx mpiCC mpicc
|
||||
HINTS "${_MPI_BASE_DIR}"
|
||||
PATH_SUFFIXES bin
|
||||
DOC "MPI compiler. Used only to detect MPI compilation flags.")
|
||||
mark_as_advanced(MPI_COMPILER)
|
||||
|
||||
set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.")
|
||||
set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.")
|
||||
set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.")
|
||||
set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.")
|
||||
mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS
|
||||
MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS)
|
||||
set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.")
|
||||
set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.")
|
||||
set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.")
|
||||
mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS)
|
||||
|
||||
if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
|
||||
# Do nothing: we already have MPI_INCLUDE_PATH and MPI_LIBRARY in
|
||||
# the cache, and we don't want to override those settings.
|
||||
elseif (MPI_COMPILER)
|
||||
# Check whether the -showme:compile option works. This indicates
|
||||
# that we have either Open MPI or a newer version of LAM-MPI, and
|
||||
# implies that -showme:link will also work.
|
||||
# Note that Windows distros do not have an mpi compiler to interogate.
|
||||
exec_program(${MPI_COMPILER}
|
||||
ARGS -showme:compile
|
||||
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
|
||||
RETURN_VALUE MPI_COMPILER_RETURN)
|
||||
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# If we appear to have -showme:compile, then we should also have
|
||||
# -showme:link. Try it.
|
||||
exec_program(${MPI_COMPILER}
|
||||
ARGS -showme:link
|
||||
OUTPUT_VARIABLE MPI_LINK_CMDLINE
|
||||
RETURN_VALUE MPI_COMPILER_RETURN)
|
||||
#=============================================================================
|
||||
# Backward compatibility input hacks. Propagate the FindMPI hints to C and
|
||||
# CXX if the respective new versions are not defined. Translate the old
|
||||
# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES.
|
||||
#
|
||||
# Once we find the new variables, we translate them back into their old
|
||||
# equivalents below.
|
||||
foreach (lang C CXX)
|
||||
# Old input variables.
|
||||
set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
|
||||
|
||||
# Note that we probably have -showme:incdirs and -showme:libdirs
|
||||
# as well.
|
||||
set(MPI_COMPILER_MAY_HAVE_INCLIBDIRS TRUE)
|
||||
endif (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# Set new vars based on their old equivalents, if the new versions are not already set.
|
||||
foreach (var ${_MPI_OLD_INPUT_VARS})
|
||||
if (NOT MPI_${lang}_${var} AND MPI_${var})
|
||||
set(MPI_${lang}_${var} "${MPI_${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# Do nothing: we have our command lines now
|
||||
else (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# Older versions of LAM-MPI have "-showme". Try it.
|
||||
exec_program(${MPI_COMPILER}
|
||||
ARGS -showme
|
||||
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
|
||||
RETURN_VALUE MPI_COMPILER_RETURN)
|
||||
endif (MPI_COMPILER_RETURN EQUAL 0)
|
||||
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# Do nothing: we have our command lines now
|
||||
else (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# MPICH uses "-show". Try it.
|
||||
exec_program(${MPI_COMPILER}
|
||||
ARGS -show
|
||||
OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
|
||||
RETURN_VALUE MPI_COMPILER_RETURN)
|
||||
endif (MPI_COMPILER_RETURN EQUAL 0)
|
||||
|
||||
if (MPI_COMPILER_RETURN EQUAL 0)
|
||||
# We have our command lines, but we might need to copy
|
||||
# MPI_COMPILE_CMDLINE into MPI_LINK_CMDLINE, if the underlying
|
||||
if (NOT MPI_LINK_CMDLINE)
|
||||
SET(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE})
|
||||
endif (NOT MPI_LINK_CMDLINE)
|
||||
else (MPI_COMPILER_RETURN EQUAL 0)
|
||||
message(STATUS "Unable to determine MPI from MPI driver ${MPI_COMPILER}")
|
||||
endif (MPI_COMPILER_RETURN EQUAL 0)
|
||||
endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
|
||||
|
||||
if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
|
||||
# Do nothing: we already have MPI_INCLUDE_PATH and MPI_LIBRARY in
|
||||
# the cache, and we don't want to override those settings.
|
||||
elseif (MPI_COMPILE_CMDLINE)
|
||||
# Extract compile flags from the compile command line.
|
||||
string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
|
||||
set(MPI_COMPILE_FLAGS_WORK)
|
||||
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
|
||||
if (MPI_COMPILE_FLAGS_WORK)
|
||||
set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}")
|
||||
else(MPI_COMPILE_FLAGS_WORK)
|
||||
set(MPI_COMPILE_FLAGS_WORK ${FLAG})
|
||||
endif(MPI_COMPILE_FLAGS_WORK)
|
||||
endforeach(FLAG)
|
||||
|
||||
# Extract include paths from compile command line
|
||||
string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
|
||||
set(MPI_INCLUDE_PATH_WORK)
|
||||
foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
|
||||
string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH})
|
||||
string(REGEX REPLACE "//" "/" IPATH ${IPATH})
|
||||
list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
|
||||
endforeach(IPATH)
|
||||
|
||||
if (NOT MPI_INCLUDE_PATH_WORK)
|
||||
if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
|
||||
# The compile command line didn't have any include paths on it,
|
||||
# but we may have -showme:incdirs. Use it.
|
||||
exec_program(${MPI_COMPILER}
|
||||
ARGS -showme:incdirs
|
||||
OUTPUT_VARIABLE MPI_INCLUDE_PATH_WORK
|
||||
RETURN_VALUE MPI_COMPILER_RETURN)
|
||||
separate_arguments(MPI_INCLUDE_PATH_WORK)
|
||||
endif (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
|
||||
endif (NOT MPI_INCLUDE_PATH_WORK)
|
||||
|
||||
if (NOT MPI_INCLUDE_PATH_WORK)
|
||||
# If all else fails, just search for mpi.h in the normal include
|
||||
# paths.
|
||||
find_path(MPI_INCLUDE_PATH mpi.h
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
set(MPI_INCLUDE_PATH_WORK ${MPI_INCLUDE_PATH})
|
||||
endif (NOT MPI_INCLUDE_PATH_WORK)
|
||||
|
||||
# Extract linker paths from the link command line
|
||||
string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
|
||||
set(MPI_LINK_PATH)
|
||||
foreach(LPATH ${MPI_ALL_LINK_PATHS})
|
||||
string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
|
||||
string(REGEX REPLACE "//" "/" LPATH ${LPATH})
|
||||
list(APPEND MPI_LINK_PATH ${LPATH})
|
||||
endforeach(LPATH)
|
||||
|
||||
if (NOT MPI_LINK_PATH)
|
||||
if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
|
||||
# The compile command line didn't have any linking paths on it,
|
||||
# but we may have -showme:libdirs. Use it.
|
||||
exec_program(${MPI_COMPILER}
|
||||
ARGS -showme:libdirs
|
||||
OUTPUT_VARIABLE MPI_LINK_PATH
|
||||
RETURN_VALUE MPI_COMPILER_RETURN)
|
||||
separate_arguments(MPI_LINK_PATH)
|
||||
endif (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
|
||||
endif (NOT MPI_LINK_PATH)
|
||||
|
||||
# Extract linker flags from the link command line
|
||||
string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
|
||||
set(MPI_LINK_FLAGS_WORK)
|
||||
foreach(FLAG ${MPI_ALL_LINK_FLAGS})
|
||||
if (MPI_LINK_FLAGS_WORK)
|
||||
set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}")
|
||||
else(MPI_LINK_FLAGS_WORK)
|
||||
set(MPI_LINK_FLAGS_WORK ${FLAG})
|
||||
endif(MPI_LINK_FLAGS_WORK)
|
||||
endforeach(FLAG)
|
||||
|
||||
# Extract the set of libraries to link against from the link command
|
||||
# line
|
||||
string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
|
||||
|
||||
# Determine full path names for all of the libraries that one needs
|
||||
# to link against in an MPI program
|
||||
set(MPI_LIBRARIES)
|
||||
foreach(LIB ${MPI_LIBNAMES})
|
||||
string(REGEX REPLACE "^ ?-l" "" LIB ${LIB})
|
||||
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
|
||||
find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH})
|
||||
if (MPI_LIB)
|
||||
list(APPEND MPI_LIBRARIES ${MPI_LIB})
|
||||
elseif (NOT MPI_FIND_QUIETLY)
|
||||
message(WARNING "Unable to find MPI library ${LIB}")
|
||||
endif ()
|
||||
endforeach(LIB)
|
||||
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE)
|
||||
|
||||
# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and
|
||||
# MPI_EXTRA_LIBRARY.
|
||||
list(LENGTH MPI_LIBRARIES MPI_NUMLIBS)
|
||||
list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED)
|
||||
if (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
|
||||
list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK)
|
||||
set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE)
|
||||
else (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
|
||||
set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE)
|
||||
endif (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
|
||||
if (MPI_NUMLIBS GREATER 1)
|
||||
set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES})
|
||||
list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0)
|
||||
set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE)
|
||||
else (MPI_NUMLIBS GREATER 1)
|
||||
set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE)
|
||||
endif (MPI_NUMLIBS GREATER 1)
|
||||
|
||||
# Set up all of the appropriate cache entries
|
||||
set(MPI_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI compilation flags" FORCE)
|
||||
set(MPI_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI include path" FORCE)
|
||||
set(MPI_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI linking flags" FORCE)
|
||||
else (MPI_COMPILE_CMDLINE)
|
||||
# No MPI compiler to interogate so attempt to find everything with find functions.
|
||||
find_path(MPI_INCLUDE_PATH mpi.h
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES include Inc
|
||||
)
|
||||
|
||||
# Decide between 32-bit and 64-bit libraries for Microsoft's MPI
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
|
||||
set(MS_MPI_ARCH_DIR amd64)
|
||||
else()
|
||||
set(MS_MPI_ARCH_DIR i386)
|
||||
# Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the
|
||||
# new FindMPI. These need to be merged into MPI_<lang>_LIBRARIES
|
||||
if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY))
|
||||
set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
|
||||
endif()
|
||||
endforeach()
|
||||
#=============================================================================
|
||||
|
||||
find_library(MPI_LIBRARY
|
||||
NAMES mpi mpich msmpi
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}
|
||||
)
|
||||
|
||||
find_library(MPI_EXTRA_LIBRARY
|
||||
NAMES mpi++
|
||||
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||
PATH_SUFFIXES lib
|
||||
DOC "Extra MPI libraries to link against.")
|
||||
# This loop finds the compilers and sends them off for interrogation.
|
||||
foreach (lang C CXX Fortran)
|
||||
if (CMAKE_${lang}_COMPILER_WORKS)
|
||||
# If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
|
||||
if (MPI_${lang}_COMPILER)
|
||||
is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE)
|
||||
if (NOT MPI_COMPILER_IS_EXECUTABLE)
|
||||
# Get rid of our default list of names and just search for the name the user wants.
|
||||
set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER})
|
||||
set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
|
||||
# If the user specifies a compiler, we don't want to try to search libraries either.
|
||||
set(try_libs FALSE)
|
||||
endif()
|
||||
else()
|
||||
set(try_libs TRUE)
|
||||
endif()
|
||||
|
||||
set(MPI_COMPILE_FLAGS "" CACHE STRING "MPI compilation flags")
|
||||
set(MPI_LINK_FLAGS "" CACHE STRING "MPI linking flags")
|
||||
endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
|
||||
find_program(MPI_${lang}_COMPILER
|
||||
NAMES ${_MPI_${lang}_COMPILER_NAMES}
|
||||
PATHS "${MPI_HOME}/bin" "$ENV{MPI_HOME}/bin" ${_MPI_PREFIX_PATH})
|
||||
interrogate_mpi_compiler(${lang} ${try_libs})
|
||||
mark_as_advanced(MPI_${lang}_COMPILER)
|
||||
|
||||
# Set up extra variables to conform to
|
||||
if (MPI_EXTRA_LIBRARY)
|
||||
set(MPI_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
|
||||
else (MPI_EXTRA_LIBRARY)
|
||||
set(MPI_LIBRARIES ${MPI_LIBRARY})
|
||||
endif (MPI_EXTRA_LIBRARY)
|
||||
# Treat each language separately as far as outputting whether we found support for it and setting MPI_<lang>_FOUND.
|
||||
find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
|
||||
set(MPI_FOUND TRUE)
|
||||
else (MPI_INCLUDE_PATH AND MPI_LIBRARY)
|
||||
|
||||
#=============================================================================
|
||||
# More backward compatibility stuff
|
||||
#
|
||||
# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found.
|
||||
# This mimics the behavior of the old language-oblivious FindMPI.
|
||||
set(_MPI_OLD_VARS FOUND COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES)
|
||||
if (MPI_CXX_FOUND)
|
||||
foreach (var ${_MPI_OLD_VARS})
|
||||
set(MPI_${var} ${MPI_CXX_${var}})
|
||||
endforeach()
|
||||
elseif (MPI_C_FOUND)
|
||||
foreach (var ${_MPI_OLD_VARS})
|
||||
set(MPI_${var} ${MPI_C_${var}})
|
||||
endforeach()
|
||||
else()
|
||||
# Note that we might still have found Fortran, but you'll need to use MPI_Fortran_FOUND
|
||||
set(MPI_FOUND FALSE)
|
||||
endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
# handle the QUIETLY and REQUIRED arguments
|
||||
find_package_handle_standard_args(MPI DEFAULT_MSG MPI_LIBRARY MPI_INCLUDE_PATH)
|
||||
# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache.
|
||||
if (MPI_LIBRARIES)
|
||||
list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK)
|
||||
set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE)
|
||||
else()
|
||||
set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MPI_INCLUDE_PATH MPI_COMPILE_FLAGS MPI_LINK_FLAGS MPI_LIBRARY
|
||||
MPI_EXTRA_LIBRARY)
|
||||
list(LENGTH MPI_LIBRARIES MPI_NUMLIBS)
|
||||
if (MPI_NUMLIBS GREATER 1)
|
||||
set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES})
|
||||
list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0)
|
||||
set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE)
|
||||
else()
|
||||
set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE)
|
||||
endif()
|
||||
#=============================================================================
|
||||
|
||||
# unset to cleanup namespace
|
||||
unset(_MPI_PACKAGE_DIR)
|
||||
# unset these vars to cleanup namespace
|
||||
unset(_MPI_OLD_VARS)
|
||||
unset(_MPI_PREFIX_PATH)
|
||||
unset(_MPI_BASE_DIR)
|
||||
foreach (lang C CXX Fortran)
|
||||
unset(_MPI_${lang}_COMPILER_NAMES)
|
||||
endforeach()
|
||||
|
@ -7,11 +7,12 @@
|
||||
# OPENSSL_FOUND - system has the OpenSSL library
|
||||
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
|
||||
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
|
||||
# OPENSSL_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8)
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
|
||||
# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@ -23,24 +24,41 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
if (UNIX)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_OPENSSL openssl)
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
endif (UNIX)
|
||||
|
||||
# http://www.slproweb.com/products/Win32OpenSSL.html
|
||||
SET(_OPENSSL_ROOT_HINTS
|
||||
$ENV{OPENSSL_ROOT_DIR}
|
||||
${OPENSSL_ROOT_DIR}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
|
||||
)
|
||||
SET(_OPENSSL_ROOT_PATHS
|
||||
"$ENV{PROGRAMFILES}/OpenSSL"
|
||||
"$ENV{PROGRAMFILES}/OpenSSL-Win32"
|
||||
"$ENV{PROGRAMFILES}/OpenSSL-Win64"
|
||||
"C:/OpenSSL/"
|
||||
"C:/OpenSSL-Win32/"
|
||||
"C:/OpenSSL-Win64/"
|
||||
)
|
||||
FIND_PATH(OPENSSL_ROOT_DIR
|
||||
NAMES include/openssl/ssl.h
|
||||
SET(_OPENSSL_ROOT_HINTS_AND_PATHS
|
||||
HINTS ${_OPENSSL_ROOT_HINTS}
|
||||
PATHS ${_OPENSSL_ROOT_PATHS}
|
||||
)
|
||||
MARK_AS_ADVANCED(OPENSSL_ROOT_DIR)
|
||||
)
|
||||
|
||||
# Re-use the previous path:
|
||||
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
|
||||
PATHS ${OPENSSL_ROOT_DIR}/include
|
||||
FIND_PATH(OPENSSL_INCLUDE_DIR
|
||||
NAMES
|
||||
openssl/ssl.h
|
||||
HINTS
|
||||
${_OPENSSL_INCLUDEDIR}
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
@ -60,18 +78,52 @@ IF(WIN32 AND NOT CYGWIN)
|
||||
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
|
||||
# libeay32MD.lib is identical to ../libeay32.lib, and
|
||||
# ssleay32MD.lib is identical to ../ssleay32.lib
|
||||
FIND_LIBRARY(LIB_EAY_DEBUG NAMES libeay32MDd libeay32
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
FIND_LIBRARY(LIB_EAY_RELEASE NAMES libeay32MD libeay32
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssleay32 ssl
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssleay32 ssl
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
FIND_LIBRARY(LIB_EAY_DEBUG
|
||||
NAMES
|
||||
libeay32MDd
|
||||
libeay32
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"VC"
|
||||
"lib/VC"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIB_EAY_RELEASE
|
||||
NAMES
|
||||
libeay32MD
|
||||
libeay32
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"VC"
|
||||
"lib/VC"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY_DEBUG
|
||||
NAMES
|
||||
ssleay32MDd
|
||||
ssleay32
|
||||
ssl
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"VC"
|
||||
"lib/VC"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY_RELEASE
|
||||
NAMES
|
||||
ssleay32MD
|
||||
ssleay32
|
||||
ssl
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"VC"
|
||||
"lib/VC"
|
||||
)
|
||||
|
||||
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
set( OPENSSL_LIBRARIES
|
||||
optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG}
|
||||
@ -84,40 +136,115 @@ IF(WIN32 AND NOT CYGWIN)
|
||||
MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
|
||||
ELSEIF(MINGW)
|
||||
# same player, for MingW
|
||||
FIND_LIBRARY(LIB_EAY NAMES libeay32
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib/MinGW
|
||||
)
|
||||
FIND_LIBRARY(SSL_EAY NAMES ssleay32
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib/MinGW
|
||||
)
|
||||
FIND_LIBRARY(LIB_EAY
|
||||
NAMES
|
||||
libeay32
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"lib/MinGW"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY
|
||||
NAMES
|
||||
ssleay32
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"lib/MinGW"
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
|
||||
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
|
||||
ELSE(MSVC)
|
||||
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
|
||||
FIND_LIBRARY(LIB_EAY NAMES libeay32
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib
|
||||
)
|
||||
FIND_LIBRARY(SSL_EAY NAMES ssleay32
|
||||
PATHS ${OPENSSL_ROOT_DIR}/lib
|
||||
)
|
||||
FIND_LIBRARY(LIB_EAY
|
||||
NAMES
|
||||
libeay32
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY
|
||||
NAMES
|
||||
ssleay32
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
|
||||
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
|
||||
ENDIF(MSVC)
|
||||
ELSE(WIN32 AND NOT CYGWIN)
|
||||
|
||||
FIND_LIBRARY(OPENSSL_SSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD)
|
||||
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES NAMES crypto)
|
||||
MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARIES OPENSSL_SSL_LIBRARIES)
|
||||
FIND_LIBRARY(OPENSSL_SSL_LIBRARY
|
||||
NAMES
|
||||
ssl
|
||||
ssleay32
|
||||
ssleay32MD
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
|
||||
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
|
||||
NAMES
|
||||
crypto
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
|
||||
|
||||
# compat defines
|
||||
SET(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
|
||||
SET(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
||||
|
||||
SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
|
||||
|
||||
ENDIF(WIN32 AND NOT CYGWIN)
|
||||
|
||||
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].*")
|
||||
|
||||
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-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_MINOR "${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}")
|
||||
|
||||
string(REGEX REPLACE "^0" "" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}")
|
||||
string(REGEX REPLACE "^0" "" OPENSSL_VERSION_PATCH "${OPENSSL_VERSION_PATCH}")
|
||||
|
||||
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_PATCH}")
|
||||
endif (OPENSSL_INCLUDE_DIR)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
find_package_handle_standard_args(OpenSSL DEFAULT_MSG
|
||||
OPENSSL_LIBRARIES
|
||||
OPENSSL_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if (OPENSSL_VERSION)
|
||||
find_package_handle_standard_args(OpenSSL
|
||||
REQUIRED_VARS
|
||||
OPENSSL_LIBRARIES
|
||||
OPENSSL_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
OPENSSL_VERSION
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
||||
)
|
||||
else (OPENSSL_VERSION)
|
||||
find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
||||
OPENSSL_LIBRARIES
|
||||
OPENSSL_INCLUDE_DIR
|
||||
)
|
||||
endif (OPENSSL_VERSION)
|
||||
|
||||
MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
# Find the PostgreSQL installation.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# - Find the PostgreSQL installation.
|
||||
# Usage:
|
||||
# In your CMakeLists.txt file do something like this:
|
||||
# ...
|
||||
|
@ -1,15 +1,31 @@
|
||||
# Locate and configure the Google Protocol Buffers library.
|
||||
#
|
||||
# The following variables can be set and are optional:
|
||||
#
|
||||
# PROTOBUF_SRC_ROOT_FOLDER - When compiling with MSVC, if this cache variable is set
|
||||
# the protobuf-default VS project build locations
|
||||
# (vsprojects/Debug & vsprojects/Release) will be searched
|
||||
# for libraries and binaries.
|
||||
#
|
||||
# Defines the following variables:
|
||||
#
|
||||
# PROTOBUF_FOUND - Found the Google Protocol Buffers library
|
||||
# PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files)
|
||||
# PROTOBUF_INCLUDE_DIRS - Include directories for Google Protocol Buffers
|
||||
# PROTOBUF_LIBRARIES - The protobuf library
|
||||
# PROTOBUF_LIBRARIES - The protobuf libraries
|
||||
# [New in CMake 2.8.5]
|
||||
# PROTOBUF_PROTOC_LIBRARIES - The protoc libraries
|
||||
# PROTOBUF_LITE_LIBRARIES - The protobuf-lite libraries
|
||||
#
|
||||
# The following cache variables are also defined:
|
||||
# The following cache variables are also available to set or use:
|
||||
# PROTOBUF_LIBRARY - The protobuf library
|
||||
# PROTOBUF_PROTOC_LIBRARY - The protoc library
|
||||
# PROTOBUF_INCLUDE_DIR - The include directory for protocol buffers
|
||||
# PROTOBUF_PROTOC_EXECUTABLE - The protoc compiler
|
||||
# [New in CMake 2.8.5]
|
||||
# PROTOBUF_LIBRARY_DEBUG - The protobuf library (debug)
|
||||
# PROTOBUF_PROTOC_LIBRARY_DEBUG - The protoc library (debug)
|
||||
# PROTOBUF_LITE_LIBRARY - The protobuf lite library
|
||||
# PROTOBUF_LITE_LIBRARY_DEBUG - The protobuf lite library (debug)
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
@ -20,7 +36,7 @@
|
||||
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
# PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS foo.proto)
|
||||
# add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
|
||||
# target_link_libraries(bar ${PROTOBUF_LIBRARY})
|
||||
# target_link_libraries(bar ${PROTOBUF_LIBRARIES})
|
||||
#
|
||||
# NOTE: You may need to link against pthreads, depending
|
||||
# on the platform.
|
||||
@ -38,7 +54,7 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2009 Philip Lowman <philip@yhbt.com>
|
||||
# Copyright 2009-2011 Philip Lowman <philip@yhbt.com>
|
||||
# Copyright 2008 Esben Mose Hansen, Ange Optimization ApS
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
@ -57,6 +73,20 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
|
||||
return()
|
||||
endif(NOT ARGN)
|
||||
|
||||
if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
|
||||
# Create an include path for each file specified
|
||||
foreach(FIL ${ARGN})
|
||||
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
|
||||
get_filename_component(ABS_PATH ${ABS_FIL} PATH)
|
||||
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
|
||||
if(${_contains_already} EQUAL -1)
|
||||
list(APPEND _protobuf_include_path -I ${ABS_PATH})
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
set(${SRCS})
|
||||
set(${HDRS})
|
||||
foreach(FIL ${ARGN})
|
||||
@ -70,7 +100,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
|
||||
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
|
||||
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL}
|
||||
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
|
||||
DEPENDS ${ABS_FIL}
|
||||
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
|
||||
VERBATIM )
|
||||
@ -81,41 +111,91 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
|
||||
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Internal function: search for normal library as well as a debug one
|
||||
# if the debug one is specified also include debug/optimized keywords
|
||||
# in *_LIBRARIES variable
|
||||
function(_protobuf_find_libraries name filename)
|
||||
find_library(${name}_LIBRARY
|
||||
NAMES ${filename}
|
||||
PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/Release)
|
||||
mark_as_advanced(${name}_LIBRARY)
|
||||
|
||||
find_library(${name}_LIBRARY_DEBUG
|
||||
NAMES ${filename}
|
||||
PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/Debug)
|
||||
mark_as_advanced(${name}_LIBRARY_DEBUG)
|
||||
|
||||
if(NOT ${name}_LIBRARY_DEBUG)
|
||||
# There is no debug library
|
||||
set(${name}_LIBRARY_DEBUG ${${name}_LIBRARY} PARENT_SCOPE)
|
||||
set(${name}_LIBRARIES ${${name}_LIBRARY} PARENT_SCOPE)
|
||||
else()
|
||||
# There IS a debug library
|
||||
set(${name}_LIBRARIES
|
||||
optimized ${${name}_LIBRARY}
|
||||
debug ${${name}_LIBRARY_DEBUG}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Main.
|
||||
#
|
||||
|
||||
# By default have PROTOBUF_GENERATE_CPP macro pass -I to protoc
|
||||
# for each directory where a proto file is referenced.
|
||||
if(NOT DEFINED PROTOBUF_GENERATE_CPP_APPEND_PATH)
|
||||
set(PROTOBUF_GENERATE_CPP_APPEND_PATH TRUE)
|
||||
endif()
|
||||
|
||||
find_path(PROTOBUF_INCLUDE_DIR google/protobuf/service.h)
|
||||
|
||||
# Google's provided vcproj files generate libraries with a "lib"
|
||||
# prefix on Windows
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
set(PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
|
||||
|
||||
find_path(PROTOBUF_SRC_ROOT_FOLDER protobuf.pc.in)
|
||||
endif()
|
||||
|
||||
find_library(PROTOBUF_LIBRARY NAMES protobuf
|
||||
DOC "The Google Protocol Buffers Library"
|
||||
)
|
||||
find_library(PROTOBUF_PROTOC_LIBRARY NAMES protoc
|
||||
DOC "The Google Protocol Buffers Compiler Library"
|
||||
)
|
||||
find_program(PROTOBUF_PROTOC_EXECUTABLE NAMES protoc
|
||||
DOC "The Google Protocol Buffers Compiler"
|
||||
)
|
||||
# The Protobuf library
|
||||
_protobuf_find_libraries(PROTOBUF protobuf)
|
||||
#DOC "The Google Protocol Buffers RELEASE Library"
|
||||
|
||||
mark_as_advanced(PROTOBUF_INCLUDE_DIR
|
||||
PROTOBUF_LIBRARY
|
||||
PROTOBUF_PROTOC_LIBRARY
|
||||
PROTOBUF_PROTOC_EXECUTABLE)
|
||||
_protobuf_find_libraries(PROTOBUF_LITE protobuf-lite)
|
||||
|
||||
# The Protobuf Protoc Library
|
||||
_protobuf_find_libraries(PROTOBUF_PROTOC protoc)
|
||||
|
||||
# Restore original find library prefixes
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "${PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES}")
|
||||
endif()
|
||||
|
||||
|
||||
# Find the include directory
|
||||
find_path(PROTOBUF_INCLUDE_DIR
|
||||
google/protobuf/service.h
|
||||
PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/src
|
||||
)
|
||||
mark_as_advanced(PROTOBUF_INCLUDE_DIR)
|
||||
|
||||
# Find the protoc Executable
|
||||
find_program(PROTOBUF_PROTOC_EXECUTABLE
|
||||
NAMES protoc
|
||||
DOC "The Google Protocol Buffers Compiler"
|
||||
PATHS
|
||||
${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/Release
|
||||
${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/Debug
|
||||
)
|
||||
mark_as_advanced(PROTOBUF_PROTOC_EXECUTABLE)
|
||||
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROTOBUF DEFAULT_MSG
|
||||
PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
|
||||
|
||||
if(PROTOBUF_FOUND)
|
||||
set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIR})
|
||||
set(PROTOBUF_LIBRARIES ${PROTOBUF_LIBRARY})
|
||||
endif()
|
||||
|
@ -9,7 +9,7 @@
|
||||
# QT_LIBRARIES variable.
|
||||
#
|
||||
# Typical usage could be something like:
|
||||
# find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml REQUIRED )
|
||||
# find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml)
|
||||
# include(${QT_USE_FILE})
|
||||
# add_executable(myexe main.cpp)
|
||||
# target_link_libraries(myexe ${QT_LIBRARIES})
|
||||
@ -354,6 +354,7 @@ ENDIF(QT_QT_LIBRARY)
|
||||
|
||||
INCLUDE(CheckSymbolExists)
|
||||
INCLUDE(MacroAddFileDependencies)
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
|
||||
SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
|
||||
|
||||
@ -374,12 +375,20 @@ MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
|
||||
|
||||
IF (QT_${basename}_LIBRARY_RELEASE)
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
|
||||
if(QT_USE_FRAMEWORKS)
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" )
|
||||
else()
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
|
||||
endif()
|
||||
ENDIF (QT_${basename}_LIBRARY_RELEASE)
|
||||
|
||||
IF (QT_${basename}_LIBRARY_DEBUG)
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
|
||||
if(QT_USE_FRAMEWORKS)
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" )
|
||||
else()
|
||||
SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
ENDIF (QT_${basename}_LIBRARY_DEBUG)
|
||||
ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
|
||||
|
||||
@ -472,6 +481,7 @@ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
|
||||
DOC "The qmake executable for the Qt installation to use"
|
||||
)
|
||||
|
||||
# double check that it was a Qt4 qmake, if not, re-find with different names
|
||||
IF (QT_QMAKE_EXECUTABLE)
|
||||
|
||||
IF(QT_QMAKE_EXECUTABLE_LAST)
|
||||
@ -480,8 +490,6 @@ IF (QT_QMAKE_EXECUTABLE)
|
||||
|
||||
SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
SET(QT4_QMAKE_FOUND FALSE)
|
||||
|
||||
_qt4_query_qmake(QT_VERSION QTVERSION)
|
||||
|
||||
# check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
|
||||
@ -498,74 +506,9 @@ IF (QT_QMAKE_EXECUTABLE)
|
||||
ENDIF(QT_QMAKE_EXECUTABLE)
|
||||
ENDIF(NOT QTVERSION)
|
||||
|
||||
# check that we found the Qt4 qmake, Qt3 qmake output won't match here
|
||||
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
|
||||
IF (qt_version_tmp)
|
||||
|
||||
# we need at least version 4.0.0
|
||||
IF (NOT QT_MIN_VERSION)
|
||||
SET(QT_MIN_VERSION "4.0.0")
|
||||
ENDIF (NOT QT_MIN_VERSION)
|
||||
|
||||
#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)
|
||||
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"")
|
||||
ENDIF (NOT req_qt_major_vers)
|
||||
|
||||
# now parse the parts of the user given version string into variables
|
||||
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}")
|
||||
|
||||
# Suppport finding at least a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 )
|
||||
# This implementation is a hack to avoid duplicating code and make sure we stay
|
||||
# source-compatible with CMake 2.6.x
|
||||
IF( Qt4_FIND_VERSION )
|
||||
SET( QT_MIN_VERSION ${Qt4_FIND_VERSION} )
|
||||
SET( req_qt_major_vers ${Qt4_FIND_VERSION_MAJOR} )
|
||||
SET( req_qt_minor_vers ${Qt4_FIND_VERSION_MINOR} )
|
||||
SET( req_qt_patch_vers ${Qt4_FIND_VERSION_PATCH} )
|
||||
ENDIF( Qt4_FIND_VERSION )
|
||||
|
||||
IF (NOT req_qt_major_vers EQUAL 4)
|
||||
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
|
||||
ENDIF (NOT req_qt_major_vers EQUAL 4)
|
||||
|
||||
# and now the version string given by qmake
|
||||
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
|
||||
|
||||
# compute an overall version number which can be compared at once
|
||||
MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
|
||||
MATH(EXPR found_vers "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100 + ${QT_VERSION_PATCH}")
|
||||
|
||||
# Support finding *exactly* a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 EXACT )
|
||||
IF( Qt4_FIND_VERSION_EXACT )
|
||||
IF(found_vers EQUAL req_vers)
|
||||
SET( QT4_QMAKE_FOUND TRUE )
|
||||
ELSE(found_vers EQUAL req_vers)
|
||||
SET( QT4_QMAKE_FOUND FALSE )
|
||||
IF (found_vers LESS req_vers)
|
||||
SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
|
||||
ELSE (found_vers LESS req_vers)
|
||||
SET(QT4_INSTALLED_VERSION_TOO_NEW TRUE)
|
||||
ENDIF (found_vers LESS req_vers)
|
||||
ENDIF(found_vers EQUAL req_vers)
|
||||
ELSE( Qt4_FIND_VERSION_EXACT )
|
||||
IF (found_vers LESS req_vers)
|
||||
SET(QT4_QMAKE_FOUND FALSE)
|
||||
SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
|
||||
ELSE (found_vers LESS req_vers)
|
||||
SET(QT4_QMAKE_FOUND TRUE)
|
||||
ENDIF (found_vers LESS req_vers)
|
||||
ENDIF( Qt4_FIND_VERSION_EXACT )
|
||||
ENDIF (qt_version_tmp)
|
||||
|
||||
ENDIF (QT_QMAKE_EXECUTABLE)
|
||||
|
||||
IF (QT4_QMAKE_FOUND)
|
||||
IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
|
||||
|
||||
# ask qmake for the mkspecs directory
|
||||
# we do this first because QT_LIBINFIX might be set
|
||||
@ -600,21 +543,32 @@ IF (QT4_QMAKE_FOUND)
|
||||
|
||||
# ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
|
||||
# others and for setting QT_LIBRARY_DIR
|
||||
IF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
|
||||
IF (NOT (QT_QTCORE_LIBRARY_RELEASE OR QT_QTCORE_LIBRARY_DEBUG) OR QT_QMAKE_CHANGED)
|
||||
_qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP)
|
||||
SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
|
||||
SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
|
||||
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
|
||||
NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
|
||||
HINTS ${QT_LIBRARY_DIR_TMP}
|
||||
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
|
||||
NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
|
||||
HINTS ${QT_LIBRARY_DIR_TMP}
|
||||
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
IF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
|
||||
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
|
||||
NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
|
||||
HINTS ${QT_LIBRARY_DIR_TMP}
|
||||
)
|
||||
FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
|
||||
NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
|
||||
HINTS ${QT_LIBRARY_DIR_TMP}
|
||||
)
|
||||
ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
|
||||
|
||||
# try dropping a hint if trying to use Visual Studio with Qt built by mingw
|
||||
IF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
|
||||
IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
|
||||
@ -622,7 +576,18 @@ IF (QT4_QMAKE_FOUND)
|
||||
ENDIF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
|
||||
ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
|
||||
|
||||
ENDIF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
|
||||
ENDIF ()
|
||||
|
||||
IF (APPLE)
|
||||
SET(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
|
||||
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
|
||||
SET(CMAKE_FIND_FRAMEWORK FIRST)
|
||||
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
|
||||
SET(CMAKE_FIND_FRAMEWORK LAST)
|
||||
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
ENDIF (APPLE)
|
||||
|
||||
_QT4_ADJUST_LIB_VARS(QtCore)
|
||||
|
||||
@ -643,15 +608,6 @@ IF (QT4_QMAKE_FOUND)
|
||||
ENDIF(Qt4_FIND_REQUIRED)
|
||||
ENDIF()
|
||||
|
||||
IF (APPLE)
|
||||
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
|
||||
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
|
||||
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
|
||||
ENDIF (APPLE)
|
||||
|
||||
# ask qmake for the binary dir
|
||||
IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
|
||||
_qt4_query_qmake(QT_INSTALL_BINS qt_bins)
|
||||
@ -663,8 +619,7 @@ IF (QT4_QMAKE_FOUND)
|
||||
_qt4_query_qmake(QT_INSTALL_HEADERS qt_headers)
|
||||
SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
|
||||
FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
|
||||
HINTS ${qt_headers}
|
||||
${QT_LIBRARY_DIR}/QtCore.framework/Headers
|
||||
HINTS ${qt_headers} ${QT_LIBRARY_DIR}
|
||||
PATH_SUFFIXES QtCore
|
||||
)
|
||||
|
||||
@ -682,13 +637,17 @@ IF (QT4_QMAKE_FOUND)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(APPLE)
|
||||
SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
|
||||
ENDIF(APPLE)
|
||||
|
||||
# Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
|
||||
IF(QT_HEADERS_DIR)
|
||||
IF(QT_USE_FRAMEWORKS)
|
||||
# Qt/Mac frameworks has two include dirs.
|
||||
# One is the framework include for which CMake will add a -F flag
|
||||
# and the other is an include dir for non-framework Qt modules
|
||||
SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY} )
|
||||
SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} )
|
||||
ELSE(QT_USE_FRAMEWORKS)
|
||||
SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
|
||||
ENDIF(QT_USE_FRAMEWORKS)
|
||||
@ -835,7 +794,7 @@ IF (QT4_QMAKE_FOUND)
|
||||
PATHS
|
||||
${QT_HEADERS_DIR}/${QT_MODULE}
|
||||
${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
# phonon doesn't seem consistent, let's try phonondefs.h for some
|
||||
# installations
|
||||
@ -844,7 +803,7 @@ IF (QT4_QMAKE_FOUND)
|
||||
PATHS
|
||||
${QT_HEADERS_DIR}/${QT_MODULE}
|
||||
${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
ENDIF(${QT_MODULE} STREQUAL "phonon")
|
||||
ENDFOREACH(QT_MODULE)
|
||||
@ -854,11 +813,11 @@ IF (QT4_QMAKE_FOUND)
|
||||
# Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
|
||||
FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
|
||||
PATHS ${QT_HEADERS_DIR}/ActiveQt
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt
|
||||
PATHS ${QT_HEADERS_DIR}/ActiveQt
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
ENDIF(Q_WS_WIN)
|
||||
|
||||
@ -867,7 +826,7 @@ IF (QT4_QMAKE_FOUND)
|
||||
PATHS
|
||||
${QT_HEADERS_DIR}/QtDesigner
|
||||
${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
# Set QT_QTASSISTANT_INCLUDE_DIR
|
||||
@ -875,7 +834,7 @@ IF (QT4_QMAKE_FOUND)
|
||||
PATHS
|
||||
${QT_HEADERS_DIR}/QtAssistant
|
||||
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
# Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
|
||||
@ -883,7 +842,7 @@ IF (QT4_QMAKE_FOUND)
|
||||
PATHS
|
||||
${QT_HEADERS_DIR}/QtAssistant
|
||||
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
########################################
|
||||
@ -897,11 +856,11 @@ IF (QT4_QMAKE_FOUND)
|
||||
STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
|
||||
FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE
|
||||
NAMES ${QT_MODULE}${QT_LIBINFIX} ${QT_MODULE}${QT_LIBINFIX}4
|
||||
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH
|
||||
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG
|
||||
NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4
|
||||
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH
|
||||
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
ENDFOREACH(QT_MODULE)
|
||||
|
||||
@ -911,26 +870,26 @@ IF (QT4_QMAKE_FOUND)
|
||||
ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
|
||||
|
||||
# Set QT_QTDESIGNERCOMPONENTS_LIBRARY
|
||||
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
|
||||
# Set QT_QTMAIN_LIBRARY
|
||||
IF(Q_WS_WIN)
|
||||
FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
ENDIF(Q_WS_WIN)
|
||||
|
||||
# Set QT_QTASSISTANTCLIENT_LIBRARY
|
||||
FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
|
||||
# Set QT_QTASSISTANT_LIBRARY
|
||||
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
|
||||
# Set QT_QTHELP_LIBRARY
|
||||
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
|
||||
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
|
||||
ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
|
||||
@ -942,12 +901,6 @@ IF (QT4_QMAKE_FOUND)
|
||||
#
|
||||
############################################
|
||||
|
||||
# On OSX when Qt is found as framework, never use the imported targets for now, since
|
||||
# in this case the handling of the framework directory currently does not work correctly.
|
||||
IF(QT_USE_FRAMEWORKS)
|
||||
SET(QT_USE_IMPORTED_TARGETS FALSE)
|
||||
ENDIF(QT_USE_FRAMEWORKS)
|
||||
|
||||
|
||||
# Set QT_xyz_LIBRARY variable and add
|
||||
# library include path to QT_INCLUDES
|
||||
@ -993,67 +946,67 @@ IF (QT4_QMAKE_FOUND)
|
||||
FIND_PROGRAM(QT_MOC_EXECUTABLE
|
||||
NAMES moc-qt4 moc
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_UIC_EXECUTABLE
|
||||
NAMES uic-qt4 uic
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_UIC3_EXECUTABLE
|
||||
NAMES uic3
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_RCC_EXECUTABLE
|
||||
NAMES rcc
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
|
||||
NAMES qdbuscpp2xml
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
|
||||
NAMES qdbusxml2cpp
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
|
||||
NAMES lupdate-qt4 lupdate
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
|
||||
NAMES lrelease-qt4 lrelease
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_QCOLLECTIONGENERATOR_EXECUTABLE
|
||||
NAMES qcollectiongenerator-qt4 qcollectiongenerator
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_DESIGNER_EXECUTABLE
|
||||
NAMES designer-qt4 designer
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(QT_LINGUIST_EXECUTABLE
|
||||
NAMES linguist-qt4 linguist
|
||||
PATHS ${QT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
IF (QT_MOC_EXECUTABLE)
|
||||
@ -1075,32 +1028,7 @@ IF (QT4_QMAKE_FOUND)
|
||||
# get the directory of the current file, used later on in the file
|
||||
GET_FILENAME_COMPONENT( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
######################################
|
||||
#
|
||||
# decide if Qt got found
|
||||
#
|
||||
######################################
|
||||
|
||||
# if the includes,libraries,moc,uic and rcc are found then we have it
|
||||
IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
|
||||
QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
|
||||
SET( QT4_FOUND "YES" )
|
||||
INCLUDE(FindPackageMessage)
|
||||
FIND_PACKAGE_MESSAGE(Qt4 "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})"
|
||||
"[${QT_LIBRARY_DIR}][${QT_INCLUDE_DIR}][${QT_MOC_EXECUTABLE}][${QT_UIC_EXECUTABLE}][${QT_RCC_EXECUTABLE}]")
|
||||
ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
|
||||
QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
|
||||
SET( QT4_FOUND "NO")
|
||||
SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
|
||||
IF( Qt4_FIND_REQUIRED)
|
||||
MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
|
||||
ENDIF( Qt4_FIND_REQUIRED)
|
||||
ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
|
||||
QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
|
||||
|
||||
SET(QT_FOUND ${QT4_FOUND})
|
||||
|
||||
|
||||
###############################################
|
||||
#
|
||||
# configuration/system dependent settings
|
||||
@ -1158,11 +1086,11 @@ IF (QT4_QMAKE_FOUND)
|
||||
IF(QT_IS_STATIC)
|
||||
FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE
|
||||
NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG
|
||||
NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
_QT4_ADJUST_LIB_VARS(${QT_PLUGIN})
|
||||
ELSE(QT_IS_STATIC)
|
||||
@ -1171,11 +1099,11 @@ IF (QT4_QMAKE_FOUND)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE
|
||||
NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG
|
||||
NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH
|
||||
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
|
||||
@ -1192,44 +1120,58 @@ IF (QT4_QMAKE_FOUND)
|
||||
|
||||
INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake")
|
||||
|
||||
# set version variables
|
||||
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
|
||||
|
||||
#######################################
|
||||
#
|
||||
# compatibility settings
|
||||
#
|
||||
#######################################
|
||||
# Backwards compatibility for CMake1.4 and 1.2
|
||||
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
|
||||
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
|
||||
ENDIF(QT_QMAKE_EXECUTABLE AND QTVERSION)
|
||||
|
||||
SET( QT_QT_LIBRARY "")
|
||||
#support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
|
||||
IF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
|
||||
SET(Qt4_FIND_VERSION ${QT_MIN_VERSION})
|
||||
ENDIF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
|
||||
|
||||
ELSE(QT4_QMAKE_FOUND)
|
||||
|
||||
SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
|
||||
|
||||
# The code below is overly complex to make sure we do not break compatibility with CMake 2.6.x
|
||||
# For CMake 2.8, it should be simplified by getting rid of QT4_INSTALLED_VERSION_TOO_OLD and
|
||||
# QT4_INSTALLED_VERSION_TOO_NEW
|
||||
IF(Qt4_FIND_REQUIRED)
|
||||
IF(QT4_INSTALLED_VERSION_TOO_OLD)
|
||||
IF( Qt4_FIND_VERSION_EXACT )
|
||||
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, version ${QT_MIN_VERSION} is required")
|
||||
ELSE( Qt4_FIND_VERSION_EXACT )
|
||||
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
|
||||
ENDIF( Qt4_FIND_VERSION_EXACT )
|
||||
ELSE(QT4_INSTALLED_VERSION_TOO_OLD)
|
||||
IF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
|
||||
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too new, version ${QT_MIN_VERSION} is required")
|
||||
ELSE( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
|
||||
MESSAGE( FATAL_ERROR "Qt qmake not found!")
|
||||
ENDIF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
|
||||
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD)
|
||||
ELSE(Qt4_FIND_REQUIRED)
|
||||
IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
|
||||
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
|
||||
ENDIF(Qt4_FIND_REQUIRED)
|
||||
|
||||
ENDIF (QT4_QMAKE_FOUND)
|
||||
IF( Qt4_FIND_COMPONENTS )
|
||||
|
||||
# if components specified in find_package(), make sure each of those pieces were found
|
||||
SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR)
|
||||
FOREACH( component ${Qt4_FIND_COMPONENTS} )
|
||||
STRING( TOUPPER ${component} _COMPONENT )
|
||||
if(${_COMPONENT} STREQUAL "QTMAIN")
|
||||
IF(Q_WS_WIN)
|
||||
SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY)
|
||||
ENDIF(Q_WS_WIN)
|
||||
else(${_COMPONENT} STREQUAL "QTMAIN")
|
||||
SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY)
|
||||
endif(${_COMPONENT} STREQUAL "QTMAIN")
|
||||
ENDFOREACH( component )
|
||||
|
||||
if(Qt4_FIND_COMPONENTS MATCHES QtGui)
|
||||
SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE)
|
||||
endif(Qt4_FIND_COMPONENTS MATCHES QtGui)
|
||||
|
||||
ELSE( Qt4_FIND_COMPONENTS )
|
||||
|
||||
# if no components specified, we'll make a default set of required variables to say Qt is found
|
||||
SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR
|
||||
QT_LIBRARY_DIR QT_QTCORE_LIBRARY)
|
||||
|
||||
ENDIF( Qt4_FIND_COMPONENTS )
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4
|
||||
REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS}
|
||||
VERSION_VAR QTVERSION
|
||||
)
|
||||
|
||||
#######################################
|
||||
#
|
||||
# compatibility settings
|
||||
#
|
||||
#######################################
|
||||
# Backwards compatibility for CMake1.4 and 1.2
|
||||
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
|
||||
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
|
||||
SET( QT_QT_LIBRARY "")
|
||||
SET(QT_FOUND ${QT4_FOUND})
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2004-2009 Kitware, Inc.
|
||||
# Copyright 2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@ -26,7 +27,7 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
FIND_PROGRAM(SWIG_EXECUTABLE swig)
|
||||
FIND_PROGRAM(SWIG_EXECUTABLE swig2.0 swig)
|
||||
|
||||
IF(SWIG_EXECUTABLE)
|
||||
EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -swiglib
|
||||
|
@ -67,7 +67,7 @@ ENDIF()
|
||||
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_INCLUDE_DIR ZLIB_LIBRARY
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
|
||||
VERSION_VAR ZLIB_VERSION_STRING)
|
||||
|
||||
IF(ZLIB_FOUND)
|
||||
|
@ -70,6 +70,17 @@ else()
|
||||
endif()
|
||||
|
||||
# Generate C symbol sources.
|
||||
set(symbol_sources)
|
||||
if(NOT "${CMAKE_Fortran_COMPILER_ID}" MATCHES "^(PathScale|Cray)$")
|
||||
# Provide mymodule_ and my_module_ init symbols because:
|
||||
# - PGI Fortran uses module init symbols
|
||||
# but not for:
|
||||
# - PathScale Fortran uses module init symbols but module symbols
|
||||
# use '.in.' so we cannot provide them anyway.
|
||||
# - Cray Fortran >= 7.3.2 uses module init symbols but module symbols
|
||||
# use 'mysub$mymodule_' so we cannot provide them anyway.
|
||||
list(APPEND symbol_sources mymodule_.c my_module_.c)
|
||||
endif()
|
||||
foreach(symbol IN LISTS global_symbols module_symbols)
|
||||
# Skip symbols with '$' if C cannot handle them.
|
||||
if(C_SUPPORTS_DOLLAR OR NOT "${symbol}" MATCHES "\\$")
|
||||
@ -89,7 +100,7 @@ endforeach()
|
||||
add_library(myfort STATIC mysub.f my_sub.f ${myfort_modules})
|
||||
|
||||
# Provide symbols through C but fall back to Fortran.
|
||||
add_library(symbols STATIC mymodule_.c my_module_.c ${symbol_sources})
|
||||
add_library(symbols STATIC ${symbol_sources})
|
||||
target_link_libraries(symbols myfort)
|
||||
|
||||
# Require symbols through Fortran.
|
||||
|
@ -1,8 +1 @@
|
||||
#if defined(__PATHSCALE__)
|
||||
/* PathScale Fortran wants my_module_ when calling any my_module symbol,
|
||||
but module symbols use '.in.' so we cannot provide them anyway. */
|
||||
void pathscale_my_module_(void) {}
|
||||
#else
|
||||
/* PGI Fortran wants my_module_ when calling any my_module symbol. */
|
||||
void my_module_(void) {}
|
||||
#endif
|
||||
|
@ -1,8 +1 @@
|
||||
#if defined(__PATHSCALE__)
|
||||
/* PathScale Fortran wants mymodule_ when calling any mymodule symbol,
|
||||
but module symbols use '.in.' so we cannot provide them anyway. */
|
||||
void pathscale_mymodule_(void) {}
|
||||
#else
|
||||
/* PGI Fortran wants mymodule_ when calling any mymodule symbol. */
|
||||
void mymodule_(void) {}
|
||||
#endif
|
||||
|
182
Modules/GNUInstallDirs.cmake
Normal file
182
Modules/GNUInstallDirs.cmake
Normal file
@ -0,0 +1,182 @@
|
||||
# - Define GNU standard installation directories
|
||||
# Provides install directory variables as defined for GNU software:
|
||||
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
# Inclusion of this module defines the following variables:
|
||||
# CMAKE_INSTALL_<dir> - destination for files of a given type
|
||||
# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
|
||||
# where <dir> is one of:
|
||||
# BINDIR - user executables (bin)
|
||||
# SBINDIR - system admin executables (sbin)
|
||||
# LIBEXECDIR - program executables (libexec)
|
||||
# SYSCONFDIR - read-only single-machine data (etc)
|
||||
# SHAREDSTATEDIR - modifiable architecture-independent data (com)
|
||||
# LOCALSTATEDIR - modifiable single-machine data (var)
|
||||
# LIBDIR - object code libraries (lib or lib64)
|
||||
# INCLUDEDIR - C header files (include)
|
||||
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
|
||||
# DATAROOTDIR - read-only architecture-independent data root (share)
|
||||
# DATADIR - read-only architecture-independent data (DATAROOTDIR)
|
||||
# INFODIR - info documentation (DATAROOTDIR/info)
|
||||
# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
|
||||
# MANDIR - man documentation (DATAROOTDIR/man)
|
||||
# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
|
||||
# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
|
||||
# install() commands for the corresponding file type. If the includer does
|
||||
# not define a value the above-shown default will be used and the value will
|
||||
# appear in the cache for editing by the user.
|
||||
# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
|
||||
# from the corresponding destination by prepending (if necessary) the value
|
||||
# of CMAKE_INSTALL_PREFIX.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
|
||||
# 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.)
|
||||
|
||||
# Installation directories
|
||||
#
|
||||
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
|
||||
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
|
||||
set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
|
||||
set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
|
||||
set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
|
||||
set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
|
||||
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(_LIBDIR_DEFAULT "lib")
|
||||
# Override this default 'lib' with 'lib64' iff:
|
||||
# - we are on Linux system but NOT cross-compiling
|
||||
# - we are NOT on debian
|
||||
# - we are on a 64 bits system
|
||||
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
|
||||
# Note that the future of multi-arch handling may be even
|
||||
# more complicated than that: http://wiki.debian.org/Multiarch
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
|
||||
AND NOT CMAKE_CROSSCOMPILING
|
||||
AND NOT EXISTS "/etc/debian_version")
|
||||
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
|
||||
message(AUTHOR_WARNING
|
||||
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
|
||||
"Please enable at least one language before including GNUInstallDirs.")
|
||||
else()
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set(_LIBDIR_DEFAULT "lib64")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
|
||||
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
|
||||
set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
|
||||
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
|
||||
# the cache and store the defaults in local variables if the cache values are
|
||||
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
|
||||
|
||||
if(NOT CMAKE_INSTALL_DATADIR)
|
||||
set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
|
||||
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_INFODIR)
|
||||
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
|
||||
set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_LOCALEDIR)
|
||||
set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
|
||||
set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_MANDIR)
|
||||
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
|
||||
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_DOCDIR)
|
||||
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
|
||||
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
mark_as_advanced(
|
||||
CMAKE_INSTALL_BINDIR
|
||||
CMAKE_INSTALL_SBINDIR
|
||||
CMAKE_INSTALL_LIBEXECDIR
|
||||
CMAKE_INSTALL_SYSCONFDIR
|
||||
CMAKE_INSTALL_SHAREDSTATEDIR
|
||||
CMAKE_INSTALL_LOCALSTATEDIR
|
||||
CMAKE_INSTALL_LIBDIR
|
||||
CMAKE_INSTALL_INCLUDEDIR
|
||||
CMAKE_INSTALL_OLDINCLUDEDIR
|
||||
CMAKE_INSTALL_DATAROOTDIR
|
||||
CMAKE_INSTALL_DATADIR
|
||||
CMAKE_INSTALL_INFODIR
|
||||
CMAKE_INSTALL_LOCALEDIR
|
||||
CMAKE_INSTALL_MANDIR
|
||||
CMAKE_INSTALL_DOCDIR
|
||||
)
|
||||
|
||||
# Result directories
|
||||
#
|
||||
foreach(dir
|
||||
BINDIR
|
||||
SBINDIR
|
||||
LIBEXECDIR
|
||||
SYSCONFDIR
|
||||
SHAREDSTATEDIR
|
||||
LOCALSTATEDIR
|
||||
LIBDIR
|
||||
INCLUDEDIR
|
||||
OLDINCLUDEDIR
|
||||
DATAROOTDIR
|
||||
DATADIR
|
||||
INFODIR
|
||||
LOCALEDIR
|
||||
MANDIR
|
||||
DOCDIR
|
||||
)
|
||||
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
|
||||
endif()
|
||||
endforeach()
|
@ -261,9 +261,9 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
|
||||
|
||||
# Is it already resolved?
|
||||
#
|
||||
if(EXISTS "${resolved_item}")
|
||||
if(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}")
|
||||
set(resolved 1)
|
||||
endif(EXISTS "${resolved_item}")
|
||||
endif(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}")
|
||||
|
||||
if(NOT resolved)
|
||||
if(item MATCHES "@executable_path")
|
||||
@ -548,7 +548,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
|
||||
|
||||
if("${gp_tool}" STREQUAL "ldd")
|
||||
set(gp_cmd_args "")
|
||||
set(gp_regex "^[\t ]*[^\t ]+ => ([^\t ]+).*${eol_char}$")
|
||||
set(gp_regex "^[\t ]*[^\t ]+ => ([^\t\(]+) .*${eol_char}$")
|
||||
set(gp_regex_error "not found${eol_char}$")
|
||||
set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
|
||||
set(gp_regex_cmp_count 1)
|
||||
|
@ -70,9 +70,11 @@ IF(MSVC)
|
||||
|
||||
IF(MSVC80)
|
||||
# Find the runtime library redistribution directory.
|
||||
GET_FILENAME_COMPONENT(msvc_install_dir
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
|
||||
FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
|
||||
PATHS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
|
||||
"${msvc_install_dir}/../../VC/redist"
|
||||
"${base_dir}/VC/redist"
|
||||
)
|
||||
MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
|
||||
@ -103,10 +105,14 @@ IF(MSVC)
|
||||
|
||||
IF(MSVC90)
|
||||
# Find the runtime library redistribution directory.
|
||||
GET_FILENAME_COMPONENT(msvc_install_dir
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(msvc_express_install_dir
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
|
||||
FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
|
||||
PATHS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist"
|
||||
"${msvc_install_dir}/../../VC/redist"
|
||||
"${msvc_express_install_dir}/../../VC/redist"
|
||||
"${base_dir}/VC/redist"
|
||||
)
|
||||
MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
|
||||
@ -137,9 +143,11 @@ IF(MSVC)
|
||||
|
||||
IF(MSVC10)
|
||||
# Find the runtime library redistribution directory.
|
||||
GET_FILENAME_COMPONENT(msvc_install_dir
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]" ABSOLUTE)
|
||||
FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT
|
||||
PATHS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"
|
||||
"${msvc_install_dir}/../../VC/redist"
|
||||
"${base_dir}/VC/redist"
|
||||
"$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/VC/redist"
|
||||
"$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10.0/VC/redist"
|
||||
|
@ -19,5 +19,7 @@ endif()
|
||||
set(__AIX_COMPILER_GNU 1)
|
||||
|
||||
macro(__aix_compiler_gnu lang)
|
||||
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
|
||||
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G")
|
||||
endmacro()
|
||||
|
2
Modules/Platform/AIX-XL-ASM.cmake
Normal file
2
Modules/Platform/AIX-XL-ASM.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
include(Platform/AIX-XL)
|
||||
__aix_compiler_xl(ASM)
|
@ -1,4 +1,2 @@
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
|
||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ")
|
||||
SET(CMAKE_SHARED_MODULE_C_FLAGS " ")
|
||||
include(Platform/AIX-XL)
|
||||
__aix_compiler_xl(C)
|
||||
|
@ -1,4 +1,2 @@
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
|
||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ")
|
||||
SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ")
|
||||
include(Platform/AIX-XL)
|
||||
__aix_compiler_xl(CXX)
|
||||
|
@ -1,4 +1,2 @@
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
|
||||
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS " ")
|
||||
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS " ")
|
||||
include(Platform/AIX-XL)
|
||||
__aix_compiler_xl(Fortran)
|
||||
|
28
Modules/Platform/AIX-XL.cmake
Normal file
28
Modules/Platform/AIX-XL.cmake
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-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.)
|
||||
|
||||
# This module is shared by multiple languages; use include blocker.
|
||||
if(__AIX_COMPILER_XL)
|
||||
return()
|
||||
endif()
|
||||
set(__AIX_COMPILER_XL 1)
|
||||
|
||||
macro(__aix_compiler_xl lang)
|
||||
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
|
||||
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
|
||||
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ")
|
||||
set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
|
||||
endmacro()
|
@ -9,8 +9,6 @@ SET(CMAKE_DL_LIBS "-lld")
|
||||
# When our own RPATH is to be added it may be inserted before the
|
||||
# "always" paths.
|
||||
SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib)
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-blibpath:")
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
|
||||
|
||||
# Files named "libfoo.a" may actually be shared libraries.
|
||||
SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
|
||||
|
1
Modules/Platform/Darwin-Absoft-Fortran.cmake
Normal file
1
Modules/Platform/Darwin-Absoft-Fortran.cmake
Normal file
@ -0,0 +1 @@
|
||||
set(CMAKE_Fortran_VERBOSE_FLAG "-X -v") # Runs gcc under the hood.
|
@ -68,7 +68,8 @@ IF(NOT _CMAKE_OSX_SDKS)
|
||||
FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select)
|
||||
IF(CMAKE_XCODE_SELECT)
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path"
|
||||
OUTPUT_VARIABLE OSX_DEVELOPER_ROOT)
|
||||
OUTPUT_VARIABLE OSX_DEVELOPER_ROOT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*")
|
||||
ENDIF(CMAKE_XCODE_SELECT)
|
||||
ENDIF(NOT _CMAKE_OSX_SDKS)
|
||||
|
@ -8,4 +8,6 @@ SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
|
||||
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
|
||||
SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
|
||||
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
|
||||
|
||||
INCLUDE(Platform/UnixPaths)
|
||||
|
6
Modules/Platform/HP-UX-HP-ASM.cmake
Normal file
6
Modules/Platform/HP-UX-HP-ASM.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
include(Platform/HP-UX-HP)
|
||||
__hpux_compiler_hp(ASM)
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-E -b +nodefaultrpath -L/usr/lib")
|
||||
|
||||
set(CMAKE_ASM_CREATE_SHARED_LIBRARY "ld <CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
11
Modules/Platform/HP-UX-HP-C.cmake
Normal file
11
Modules/Platform/HP-UX-HP-C.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
include(Platform/HP-UX-HP)
|
||||
__hpux_compiler_hp(C)
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-E -b +nodefaultrpath -L/usr/lib")
|
||||
|
||||
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> -Aa -Ae <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
|
||||
# use ld directly to create shared libraries for hp cc
|
||||
set(CMAKE_C_CREATE_SHARED_LIBRARY "ld <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
16
Modules/Platform/HP-UX-HP-CXX.cmake
Normal file
16
Modules/Platform/HP-UX-HP-CXX.cmake
Normal file
@ -0,0 +1,16 @@
|
||||
include(Platform/HP-UX-HP)
|
||||
__hpux_compiler_hp(CXX)
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "+Z -Wl,-E,+nodefaultrpath -b -L/usr/lib")
|
||||
|
||||
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
|
||||
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>"
|
||||
"mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
|
||||
"rm -f `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.o"
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3 -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE_INIT "+O2 -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
|
7
Modules/Platform/HP-UX-HP-Fortran.cmake
Normal file
7
Modules/Platform/HP-UX-HP-Fortran.cmake
Normal file
@ -0,0 +1,7 @@
|
||||
include(Platform/HP-UX-HP)
|
||||
__hpux_compiler_hp(Fortran)
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-E -b -L/usr/lib")
|
||||
|
||||
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
|
||||
"ld <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
34
Modules/Platform/HP-UX-HP.cmake
Normal file
34
Modules/Platform/HP-UX-HP.cmake
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-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.)
|
||||
|
||||
# This module is shared by multiple languages; use include blocker.
|
||||
if(__HPUX_COMPILER_HP)
|
||||
return()
|
||||
endif()
|
||||
set(__HPUX_COMPILER_HP 1)
|
||||
set(_Wl_C "")
|
||||
set(_Wl_CXX "-Wl,")
|
||||
set(_Wl_Fortran "")
|
||||
set(_Wl_ASM "")
|
||||
|
||||
macro(__hpux_compiler_hp lang)
|
||||
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "+Z")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,+s,-E,+nodefaultrpath")
|
||||
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "${_Wl_${lang}}+b")
|
||||
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
|
||||
set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "${_Wl_${lang}}+h")
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_${lang}_FLAG "-Wl,+b")
|
||||
|
||||
set(CMAKE_${lang}_FLAGS_INIT "")
|
||||
endmacro()
|
@ -15,57 +15,6 @@ SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
|
||||
# specifying the file path.
|
||||
SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
|
||||
|
||||
# fortran
|
||||
IF(CMAKE_COMPILER_IS_GNUG77)
|
||||
ELSE(CMAKE_COMPILER_IS_GNUG77)
|
||||
# use ld directly to create shared libraries for hp cc
|
||||
SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
|
||||
"ld <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "+Z") # -pic
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-E -b -L/usr/lib") # -shared
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,+s,-E,+nodefaultrpath") # +s, flag for exe link to use shared lib
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "+b") # -rpath
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":") # : or empty
|
||||
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "+h")
|
||||
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG "-Wl,+b") # -rpath
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUG77)
|
||||
|
||||
# C compiler
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCC)
|
||||
# hp cc
|
||||
# use ld directly to create shared libraries for hp cc
|
||||
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||
"ld <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "+Z") # -pic
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-E -b +nodefaultrpath -L/usr/lib") # -shared
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,+s,-E,+nodefaultrpath") # +s, flag for exe link to use shared lib
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "+b") # -rpath
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
|
||||
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "+h")
|
||||
SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG "-Wl,+b") # -rpath
|
||||
SET(CMAKE_C_FLAGS_INIT "")
|
||||
SET(CMAKE_C_COMPILE_OBJECT
|
||||
"<CMAKE_C_COMPILER> <DEFINES> -Aa -Ae <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# CXX compiler
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# for hp aCC
|
||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "+Z") # -pic
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "+Z -Wl,-E,+nodefaultrpath -b -L/usr/lib") # -shared
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,+s,-E,+nodefaultrpath") # +s, flag for exe link to use shared lib
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath
|
||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":") # : or empty
|
||||
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,+h")
|
||||
SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath
|
||||
SET (CMAKE_CXX_FLAGS_INIT "")
|
||||
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
|
||||
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3 -DNDEBUG")
|
||||
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "+O2 -DNDEBUG")
|
||||
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# set flags for gcc support
|
||||
INCLUDE(Platform/UnixPaths)
|
||||
|
||||
@ -81,20 +30,6 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
|
||||
LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
|
||||
/usr/lib/hpux32 /usr/lib/hpux64)
|
||||
|
||||
IF(NOT CMAKE_COMPILER_IS_GNUCC)
|
||||
SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
|
||||
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>"
|
||||
"mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
|
||||
"rm -f `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.o"
|
||||
)
|
||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# Initialize C and CXX link type selection flags. These flags are
|
||||
# used when building a shared library, shared module, or executable
|
||||
# that links to other libraries to select whether to use the static or
|
||||
|
1
Modules/Platform/Linux-Absoft-Fortran.cmake
Normal file
1
Modules/Platform/Linux-Absoft-Fortran.cmake
Normal file
@ -0,0 +1 @@
|
||||
set(CMAKE_Fortran_VERBOSE_FLAG "-X -v") # Runs gcc under the hood.
|
@ -45,6 +45,9 @@ ELSE(DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
ENDIF(EXISTS "/etc/debian_version")
|
||||
ENDIF(DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
|
||||
# Match multiarch library directory names.
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
|
||||
|
||||
INCLUDE(Platform/UnixPaths)
|
||||
|
||||
# Debian has lib64 paths only for compatibility so they should not be
|
||||
|
@ -43,6 +43,7 @@ endif()
|
||||
set(CMAKE_DL_LIBS "")
|
||||
set(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||
set(CMAKE_LINK_LIBRARY_FLAG "-l")
|
||||
set(CMAKE_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough
|
||||
set(CMAKE_LINK_LIBRARY_SUFFIX "")
|
||||
set(CMAKE_CREATE_WIN32_EXE "-mwindows")
|
||||
|
||||
@ -78,6 +79,7 @@ macro(__windows_compiler_gnu lang)
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
|
||||
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
|
||||
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
|
||||
|
||||
# We prefer "@" for response files but it is not supported by gcc 3.
|
||||
execute_process(COMMAND ${CMAKE_${lang}_COMPILER} --version OUTPUT_VARIABLE _ver ERROR_VARIABLE _ver)
|
||||
@ -91,6 +93,8 @@ macro(__windows_compiler_gnu lang)
|
||||
# Use "-Wl,@" to pass the response file to the linker.
|
||||
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
|
||||
endif()
|
||||
# The GNU 3.x compilers do not support response files (only linkers).
|
||||
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 0)
|
||||
elseif(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS)
|
||||
# Use "@" to pass the response file to the front-end.
|
||||
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
|
||||
|
2
Modules/Platform/Windows-Intel-ASM.cmake
Normal file
2
Modules/Platform/Windows-Intel-ASM.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
include(Platform/Windows-Intel)
|
||||
__windows_compiler_intel(ASM)
|
@ -1,2 +1,4 @@
|
||||
# kFreeBSD looks just like Linux.
|
||||
INCLUDE(Platform/Linux)
|
||||
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")
|
||||
|
183
Modules/ProcessorCount.cmake
Normal file
183
Modules/ProcessorCount.cmake
Normal file
@ -0,0 +1,183 @@
|
||||
# - ProcessorCount(var)
|
||||
# Determine the number of processors/cores and save value in ${var}
|
||||
#
|
||||
# Sets the variable named ${var} to the number of physical cores available on
|
||||
# the machine if the information can be determined. Otherwise it is set to 0.
|
||||
# Currently this functionality is implemented for AIX, cygwin, FreeBSD, HPUX,
|
||||
# IRIX, Linux, Mac OS X, QNX, Sun and Windows.
|
||||
#
|
||||
# This function is guaranteed to return a positive integer (>=1) if it
|
||||
# succeeds. It returns 0 if there's a problem determining the processor count.
|
||||
#
|
||||
# Example use, in a ctest -S dashboard script:
|
||||
#
|
||||
# include(ProcessorCount)
|
||||
# ProcessorCount(N)
|
||||
# if(NOT N EQUAL 0)
|
||||
# set(CTEST_BUILD_FLAGS -j${N})
|
||||
# set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
|
||||
# endif()
|
||||
#
|
||||
# This function is intended to offer an approximation of the value of the
|
||||
# number of compute cores available on the current machine, such that you
|
||||
# may use that value for parallel building and parallel testing. It is meant
|
||||
# to help utilize as much of the machine as seems reasonable. Of course,
|
||||
# knowledge of what else might be running on the machine simultaneously
|
||||
# should be used when deciding whether to request a machine's full capacity
|
||||
# all for yourself.
|
||||
|
||||
# A more reliable way might be to compile a small C program that uses the CPUID
|
||||
# instruction, but that again requires compiler support or compiling assembler
|
||||
# code.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010-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.)
|
||||
|
||||
function(ProcessorCount var)
|
||||
# Unknown:
|
||||
set(count 0)
|
||||
|
||||
if(WIN32)
|
||||
# Windows:
|
||||
set(count "$ENV{NUMBER_OF_PROCESSORS}")
|
||||
#message("ProcessorCount: WIN32, trying environment variable")
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# Mac, FreeBSD, OpenBSD (systems with sysctl):
|
||||
find_program(ProcessorCount_cmd_sysctl sysctl
|
||||
PATHS /usr/sbin /sbin)
|
||||
if(ProcessorCount_cmd_sysctl)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE count)
|
||||
#message("ProcessorCount: trying sysctl '${ProcessorCount_cmd_sysctl}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# Linux (systems with getconf):
|
||||
find_program(ProcessorCount_cmd_getconf getconf)
|
||||
if(ProcessorCount_cmd_getconf)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE count)
|
||||
#message("ProcessorCount: trying getconf '${ProcessorCount_cmd_getconf}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# HPUX (systems with machinfo):
|
||||
find_program(ProcessorCount_cmd_machinfo machinfo
|
||||
PATHS /usr/contrib/bin)
|
||||
if(ProcessorCount_cmd_machinfo)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_machinfo}
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE machinfo_output)
|
||||
string(REGEX MATCHALL "Number of CPUs = ([0-9]+)" procs "${machinfo_output}")
|
||||
set(count "${CMAKE_MATCH_1}")
|
||||
#message("ProcessorCount: trying machinfo '${ProcessorCount_cmd_machinfo}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# IRIX (systems with hinv):
|
||||
find_program(ProcessorCount_cmd_hinv hinv
|
||||
PATHS /sbin)
|
||||
if(ProcessorCount_cmd_hinv)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_hinv}
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE hinv_output)
|
||||
string(REGEX MATCHALL "([0-9]+) .* Processors" procs "${hinv_output}")
|
||||
set(count "${CMAKE_MATCH_1}")
|
||||
#message("ProcessorCount: trying hinv '${ProcessorCount_cmd_hinv}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# AIX (systems with lsconf):
|
||||
find_program(ProcessorCount_cmd_lsconf lsconf
|
||||
PATHS /usr/sbin)
|
||||
if(ProcessorCount_cmd_lsconf)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_lsconf}
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE lsconf_output)
|
||||
string(REGEX MATCHALL "Number Of Processors: ([0-9]+)" procs "${lsconf_output}")
|
||||
set(count "${CMAKE_MATCH_1}")
|
||||
#message("ProcessorCount: trying lsconf '${ProcessorCount_cmd_lsconf}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# QNX (systems with pidin):
|
||||
find_program(ProcessorCount_cmd_pidin pidin)
|
||||
if(ProcessorCount_cmd_pidin)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_pidin} info
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE pidin_output)
|
||||
string(REGEX MATCHALL "Processor[0-9]+: " procs "${pidin_output}")
|
||||
list(LENGTH procs count)
|
||||
#message("ProcessorCount: trying pidin '${ProcessorCount_cmd_pidin}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# Sun (systems where uname -X emits "NumCPU" in its output):
|
||||
find_program(ProcessorCount_cmd_uname uname)
|
||||
if(ProcessorCount_cmd_uname)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE uname_X_output)
|
||||
string(REGEX MATCHALL "NumCPU = ([0-9]+)" procs "${uname_X_output}")
|
||||
set(count "${CMAKE_MATCH_1}")
|
||||
#message("ProcessorCount: trying uname -X '${ProcessorCount_cmd_uname}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Execute this code when all previously attempted methods return empty
|
||||
# output:
|
||||
#
|
||||
if(NOT count)
|
||||
# Systems with /proc/cpuinfo:
|
||||
set(cpuinfo_file /proc/cpuinfo)
|
||||
if(EXISTS "${cpuinfo_file}")
|
||||
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
|
||||
list(LENGTH procs count)
|
||||
#message("ProcessorCount: trying cpuinfo '${cpuinfo_file}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Since cygwin builds of CMake do not define WIN32 anymore, but they still
|
||||
# run on Windows, and will still have this env var defined:
|
||||
#
|
||||
if(NOT count)
|
||||
set(count "$ENV{NUMBER_OF_PROCESSORS}")
|
||||
#message("ProcessorCount: last fallback, trying environment variable")
|
||||
endif()
|
||||
|
||||
# Ensure an integer return (avoid inadvertently returning an empty string
|
||||
# or an error string)... If it's not a decimal integer, return 0:
|
||||
#
|
||||
if(NOT count MATCHES "^[0-9]+$")
|
||||
set(count 0)
|
||||
endif()
|
||||
|
||||
set(${var} ${count} PARENT_SCOPE)
|
||||
endfunction()
|
@ -107,10 +107,8 @@ MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
|
||||
ENDIF(_moc_outfile_dir)
|
||||
SET (_moc_parameters_file ${outfile}_parameters)
|
||||
SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
|
||||
FILE (REMOVE ${_moc_parameters_file})
|
||||
FOREACH(arg ${_moc_parameters})
|
||||
FILE (APPEND ${_moc_parameters_file} "${arg}\n")
|
||||
ENDFOREACH(arg)
|
||||
STRING (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
|
||||
FILE (WRITE ${_moc_parameters_file} "${_moc_parameters}")
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
|
||||
DEPENDS ${infile}
|
||||
|
@ -66,6 +66,13 @@ SET(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
|
||||
SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
|
||||
SET(QT_QTDECLARATIVE_MODULE_DEPENDS QTWEBKIT QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTXML QTOPENGL QTGUI QTNETWORK QTCORE)
|
||||
SET(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
|
||||
SET(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
|
||||
SET(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
|
||||
SET(QT_QTGUI_MODULE_DEPENDS QTCORE)
|
||||
SET(QT_QTTEST_MODULE_DEPENDS QTCORE)
|
||||
SET(QT_QTXML_MODULE_DEPENDS QTCORE)
|
||||
SET(QT_QTSQL_MODULE_DEPENDS QTCORE)
|
||||
SET(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
|
||||
|
||||
# Qt modules (in order of dependence)
|
||||
FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
|
||||
|
@ -4,6 +4,9 @@
|
||||
# - Define swig module with given name and specified language
|
||||
# SWIG_LINK_LIBRARIES(name [ libraries ])
|
||||
# - Link libraries to swig module
|
||||
# SWIG_GET_WRAPPER_DEPENDENCIES(swigFile genWrapper language DEST_VARIABLE)
|
||||
# - Put dependencies of the wrapper genWrapper generated by swig from
|
||||
# swigFile in DEST_VARIABLE
|
||||
# All other macros are for internal use only.
|
||||
# To get the actual name of the swig module,
|
||||
# use: ${SWIG_MODULE_${name}_REAL_NAME}.
|
||||
@ -38,6 +41,58 @@ SET(SWIG_EXTRA_LIBRARIES "")
|
||||
|
||||
SET(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py")
|
||||
|
||||
#
|
||||
# Get dependencies of the generated wrapper.
|
||||
#
|
||||
MACRO(SWIG_GET_WRAPPER_DEPENDENCIES swigFile genWrapper language DEST_VARIABLE)
|
||||
GET_FILENAME_COMPONENT(swig_getdeps_basename ${swigFile} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(swig_getdeps_outdir ${genWrapper} PATH)
|
||||
GET_SOURCE_FILE_PROPERTY(swig_getdeps_extra_flags "${swigFile}" SWIG_FLAGS)
|
||||
IF("${swig_getdeps_extra_flags}" STREQUAL "NOTFOUND")
|
||||
SET(swig_getdeps_extra_flags "")
|
||||
ENDIF("${swig_getdeps_extra_flags}" STREQUAL "NOTFOUND")
|
||||
|
||||
IF(NOT swig_getdeps_outdir)
|
||||
SET(swig_getdeps_outdir ${CMAKE_CURRENT_BINARY_DIR})
|
||||
ENDIF(NOT swig_getdeps_outdir)
|
||||
SET(swig_getdeps_depsfile
|
||||
${swig_getdeps_outdir}/swig_${swig_getdeps_basename}_deps.txt)
|
||||
GET_DIRECTORY_PROPERTY(swig_getdeps_include_directories INCLUDE_DIRECTORIES)
|
||||
SET(swig_getdeps_include_dirs)
|
||||
FOREACH(it ${swig_getdeps_include_directories})
|
||||
SET(swig_getdeps_include_dirs ${swig_getdeps_include_dirs} "-I${it}")
|
||||
ENDFOREACH(it)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${SWIG_EXECUTABLE}
|
||||
-MM -MF ${swig_getdeps_depsfile} ${swig_getdeps_extra_flags}
|
||||
${CMAKE_SWIG_FLAGS} -${language}
|
||||
-o ${genWrapper} ${swig_getdeps_include_dirs} ${swigFile}
|
||||
RESULT_VARIABLE swig_getdeps_result
|
||||
ERROR_VARIABLE swig_getdeps_error
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
IF(NOT ${swig_getdeps_error} EQUAL 0)
|
||||
MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -MM -MF ${swig_getdeps_depsfile} ${swig_getdeps_extra_flags} ${CMAKE_SWIG_FLAGS} -${language} -o ${genWrapper} ${swig_getdeps_include_dirs} ${swigFile}\" failed with output:\n${swig_getdeps_error}")
|
||||
SET(swig_getdeps_dependencies "")
|
||||
ELSE(NOT ${swig_getdeps_error} EQUAL 0)
|
||||
FILE(READ ${swig_getdeps_depsfile} ${DEST_VARIABLE})
|
||||
# Remove the first line
|
||||
STRING(REGEX REPLACE "^.+: +\\\\\n +" ""
|
||||
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
|
||||
# Clean the end of each line
|
||||
STRING(REGEX REPLACE " +(\\\\)?\n" "\n" ${DEST_VARIABLE}
|
||||
"${${DEST_VARIABLE}}")
|
||||
# Clean beginning of each line
|
||||
STRING(REGEX REPLACE "\n +" "\n"
|
||||
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
|
||||
# clean paths
|
||||
STRING(REGEX REPLACE "\\\\\\\\" "/" ${DEST_VARIABLE}
|
||||
"${${DEST_VARIABLE}}")
|
||||
STRING(REGEX REPLACE "\n" ";"
|
||||
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
|
||||
ENDIF(NOT ${swig_getdeps_error} EQUAL 0)
|
||||
ENDMACRO(SWIG_GET_WRAPPER_DEPENDENCIES)
|
||||
|
||||
|
||||
#
|
||||
# For given swig module initialize variables associated with it
|
||||
#
|
||||
@ -69,6 +124,7 @@ ENDMACRO(SWIG_MODULE_INITIALIZE)
|
||||
#
|
||||
|
||||
MACRO(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
|
||||
SET(${outfiles} "")
|
||||
GET_SOURCE_FILE_PROPERTY(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
|
||||
${infile} SWIG_MODULE_NAME)
|
||||
IF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
|
||||
@ -125,8 +181,6 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
|
||||
# If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
|
||||
IF(CMAKE_SWIG_OUTDIR)
|
||||
SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
|
||||
# it may not exist, so create it:
|
||||
file(MAKE_DIRECTORY ${CMAKE_SWIG_OUTDIR})
|
||||
ELSE(CMAKE_SWIG_OUTDIR)
|
||||
SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
|
||||
ENDIF(CMAKE_SWIG_OUTDIR)
|
||||
@ -166,8 +220,14 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
|
||||
IF(SWIG_MODULE_${name}_EXTRA_FLAGS)
|
||||
SET(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
|
||||
ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS)
|
||||
SWIG_GET_WRAPPER_DEPENDENCIES("${swig_source_file_fullname}"
|
||||
"${swig_generated_file_fullname}" ${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}
|
||||
swig_extra_dependencies)
|
||||
LIST(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${swig_extra_dependencies})
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files}
|
||||
# Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir)
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${swig_outdir}
|
||||
COMMAND "${SWIG_EXECUTABLE}"
|
||||
ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}"
|
||||
${swig_source_file_flags}
|
||||
|
@ -6,7 +6,7 @@
|
||||
# # Note that for MinGW users the order of libs is important!
|
||||
# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
|
||||
# INCLUDE(${wxWidgets_USE_FILE})
|
||||
# # and for each of your dependant executable/library targets:
|
||||
# # and for each of your dependent executable/library targets:
|
||||
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
|
||||
#
|
||||
# DEPRECATED
|
||||
|
@ -64,10 +64,32 @@ For example:
|
||||
# VAR_REALLY_COOL - cool right?
|
||||
#
|
||||
|
||||
Test the documentation formatting by running "cmake --help-module FindXXX".
|
||||
Edit the comments until the output of this command looks satisfactory.
|
||||
|
||||
To have a .cmake file in this directory NOT show up in the
|
||||
modules documentation, you should start the file with a blank
|
||||
line.
|
||||
|
||||
After the documentation, leave a *BLANK* line, and then add a
|
||||
copyright and licence notice block like this one:
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009-2011 Your Name
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
The layout of the notice block is strictly enforced by the ModuleNotices test.
|
||||
Only the year range and name may be changed freely.
|
||||
|
||||
A FindXXX.cmake module will typically be loaded by the command
|
||||
|
||||
FIND_PACKAGE(XXX [major[.minor[.patch[.tweak]]]] [EXACT]
|
||||
|
@ -266,7 +266,7 @@ IF(UNIX)
|
||||
SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
|
||||
ENDIF(UNIX)
|
||||
|
||||
# XCode only works on apple
|
||||
# Xcode only works on Apple
|
||||
IF(APPLE)
|
||||
SET(SRCS ${SRCS}
|
||||
cmXCodeObject.cxx
|
||||
@ -343,7 +343,7 @@ TARGET_LINK_LIBRARIES(CMakeLib cmsys
|
||||
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
|
||||
${CMAKE_CURL_LIBRARIES} )
|
||||
|
||||
# On Apple we need Carbon
|
||||
# On Apple we need CoreFoundation
|
||||
IF(APPLE)
|
||||
TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
|
||||
ENDIF(APPLE)
|
||||
@ -394,6 +394,8 @@ SET(CTEST_SRCS cmCTest.cxx
|
||||
CTest/cmCTestTestHandler.cxx
|
||||
CTest/cmCTestUpdateCommand.cxx
|
||||
CTest/cmCTestUpdateHandler.cxx
|
||||
CTest/cmCTestUploadCommand.cxx
|
||||
CTest/cmCTestUploadHandler.cxx
|
||||
|
||||
CTest/cmCTestVC.cxx
|
||||
CTest/cmCTestVC.h
|
||||
@ -465,7 +467,7 @@ IF(APPLE)
|
||||
ADD_EXECUTABLE(OSXScriptLauncher
|
||||
CPack/OSXScriptLauncher.cxx)
|
||||
TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
|
||||
TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon")
|
||||
TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# Build CMake executable
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <cmsys/ios/fstream>
|
||||
#include <cmsys/ios/iostream>
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
// For the PATH_MAX constant
|
||||
|
@ -121,9 +121,11 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
|
||||
<< std::endl);
|
||||
// Begin the archive for this group
|
||||
std::string packageFileName= std::string(toplevel);
|
||||
packageFileName += "/"
|
||||
+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
|
||||
+"-"+compGIt->first + this->GetOutputExtension();
|
||||
packageFileName += "/"+
|
||||
GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
|
||||
compGIt->first,
|
||||
true)
|
||||
+ this->GetOutputExtension();
|
||||
// open a block in order to automatically close archive
|
||||
// at the end of the block
|
||||
{
|
||||
@ -141,6 +143,39 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
|
||||
// add the generated package to package file names list
|
||||
packageFileNames.push_back(packageFileName);
|
||||
}
|
||||
// Handle Orphan components (components not belonging to any groups)
|
||||
std::map<std::string, cmCPackComponent>::iterator compIt;
|
||||
for (compIt=this->Components.begin();
|
||||
compIt!=this->Components.end(); ++compIt )
|
||||
{
|
||||
// Does the component belong to a group?
|
||||
if (compIt->second.Group==NULL)
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||
"Component <"
|
||||
<< compIt->second.Name
|
||||
<< "> does not belong to any group, package it separately."
|
||||
<< std::endl);
|
||||
std::string localToplevel(
|
||||
this->GetOption("CPACK_TEMPORARY_DIRECTORY")
|
||||
);
|
||||
std::string packageFileName = std::string(toplevel);
|
||||
|
||||
localToplevel += "/"+ compIt->first;
|
||||
packageFileName += "/"+
|
||||
GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
|
||||
compIt->first,
|
||||
false)
|
||||
+ this->GetOutputExtension();
|
||||
{
|
||||
DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive);
|
||||
// Add the files of this component to the archive
|
||||
addOneComponentToArchive(archive,&(compIt->second));
|
||||
}
|
||||
// add the generated package to package file names list
|
||||
packageFileNames.push_back(packageFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
// CPACK_COMPONENTS_IGNORE_GROUPS is set
|
||||
// We build 1 package per component
|
||||
@ -154,9 +189,11 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
|
||||
std::string packageFileName = std::string(toplevel);
|
||||
|
||||
localToplevel += "/"+ compIt->first;
|
||||
packageFileName += "/"
|
||||
+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
|
||||
+"-"+compIt->first + this->GetOutputExtension();
|
||||
packageFileName += "/"+
|
||||
GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
|
||||
compIt->first,
|
||||
false)
|
||||
+ this->GetOutputExtension();
|
||||
{
|
||||
DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive);
|
||||
// Add the files of this component to the archive
|
||||
@ -170,52 +207,29 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponent)
|
||||
int cmCPackArchiveGenerator::PackageComponentsAllInOne()
|
||||
{
|
||||
// reset the package file names
|
||||
packageFileNames.clear();
|
||||
packageFileNames.push_back(std::string(toplevel));
|
||||
packageFileNames[0] += "/"
|
||||
+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
|
||||
+"-ALL" + this->GetOutputExtension();
|
||||
+ this->GetOutputExtension();
|
||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||
"Packaging all groups in one package..."
|
||||
"(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)"
|
||||
<< std::endl);
|
||||
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
|
||||
|
||||
// The ALL GROUP in ONE package case
|
||||
if (! allComponent) {
|
||||
// iterate over the component groups
|
||||
std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
|
||||
for (compGIt=this->ComponentGroups.begin();
|
||||
compGIt!=this->ComponentGroups.end(); ++compGIt)
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: "
|
||||
<< compGIt->first
|
||||
<< std::endl);
|
||||
// now iterate over the component of this group
|
||||
std::vector<cmCPackComponent*>::iterator compIt;
|
||||
for (compIt=(compGIt->second).Components.begin();
|
||||
compIt!=(compGIt->second).Components.end();
|
||||
++compIt)
|
||||
{
|
||||
// Add the files of this component to the archive
|
||||
addOneComponentToArchive(archive,*compIt);
|
||||
}
|
||||
}
|
||||
}
|
||||
// The ALL COMPONENT in ONE package case
|
||||
else
|
||||
// The ALL COMPONENTS in ONE package case
|
||||
std::map<std::string, cmCPackComponent>::iterator compIt;
|
||||
for (compIt=this->Components.begin();compIt!=this->Components.end();
|
||||
++compIt )
|
||||
{
|
||||
std::map<std::string, cmCPackComponent>::iterator compIt;
|
||||
for (compIt=this->Components.begin();compIt!=this->Components.end();
|
||||
++compIt )
|
||||
{
|
||||
// Add the files of this component to the archive
|
||||
addOneComponentToArchive(archive,&(compIt->second));
|
||||
}
|
||||
// Add the files of this component to the archive
|
||||
addOneComponentToArchive(archive,&(compIt->second));
|
||||
}
|
||||
|
||||
// archive goes out of scope so it will finalized and closed.
|
||||
return 1;
|
||||
}
|
||||
@ -226,25 +240,22 @@ int cmCPackArchiveGenerator::PackageFiles()
|
||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
|
||||
<< toplevel << std::endl);
|
||||
|
||||
PrepareGroupingKind();
|
||||
|
||||
if (SupportsComponentInstallation()) {
|
||||
// CASE 1 : COMPONENT ALL-IN-ONE package
|
||||
// If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
|
||||
// If ALL COMPONENTS in ONE package has been requested
|
||||
// then the package file is unique and should be open here.
|
||||
if (allComponentInOne ||
|
||||
(allGroupInOne && (!this->ComponentGroups.empty()))
|
||||
)
|
||||
if (componentPackageMethod == ONE_PACKAGE)
|
||||
{
|
||||
return PackageComponentsAllInOne(allComponentInOne);
|
||||
return PackageComponentsAllInOne();
|
||||
}
|
||||
// CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
|
||||
// There will be 1 package for each component group
|
||||
// however one may require to ignore component group and
|
||||
// in this case you'll get 1 package for each component.
|
||||
else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup))
|
||||
else
|
||||
{
|
||||
return PackageComponents(ignoreComponentGroup);
|
||||
return PackageComponents(componentPackageMethod ==
|
||||
ONE_PACKAGE_PER_COMPONENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ protected:
|
||||
* Special case of component install where all
|
||||
* components will be put in a single installer.
|
||||
*/
|
||||
int PackageComponentsAllInOne(bool allComponent);
|
||||
int PackageComponentsAllInOne();
|
||||
virtual const char* GetOutputExtension() = 0;
|
||||
cmArchiveWrite::Compress Compress;
|
||||
cmArchiveWrite::Type Archive;
|
||||
|
@ -165,5 +165,10 @@ int cmCPackBundleGenerator::PackageFiles()
|
||||
cmSystemTools::SetPermissions(command_target.str().c_str(), 0777);
|
||||
}
|
||||
|
||||
return this->CreateDMG();
|
||||
return this->CreateDMG(toplevel, packageFileNames[0]);
|
||||
}
|
||||
|
||||
bool cmCPackBundleGenerator::SupportsComponentInstallation() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ protected:
|
||||
virtual int InitializeInternal();
|
||||
virtual const char* GetPackagingInstallPrefix();
|
||||
int PackageFiles();
|
||||
bool SupportsComponentInstallation() const;
|
||||
|
||||
std::string InstallPrefix;
|
||||
};
|
||||
|
@ -50,15 +50,235 @@ int cmCPackDebGenerator::InitializeInternal()
|
||||
return this->Superclass::InitializeInternal();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel,
|
||||
std::string packageName)
|
||||
{
|
||||
int retval = 1;
|
||||
// Begin the archive for this pack
|
||||
std::string localToplevel(initialTopLevel);
|
||||
std::string packageFileName(
|
||||
cmSystemTools::GetParentDirectory(toplevel.c_str())
|
||||
);
|
||||
std::string outputFileName(
|
||||
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
|
||||
+"-"+packageName + this->GetOutputExtension()
|
||||
);
|
||||
|
||||
localToplevel += "/"+ packageName;
|
||||
/* replace the TEMP DIRECTORY with the component one */
|
||||
this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str());
|
||||
packageFileName += "/"+ outputFileName;
|
||||
/* replace proposed CPACK_OUTPUT_FILE_NAME */
|
||||
this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str());
|
||||
/* replace the TEMPORARY package file name */
|
||||
this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME",
|
||||
packageFileName.c_str());
|
||||
// Tell CPackDeb.cmake the name of the component GROUP.
|
||||
this->SetOption("CPACK_DEB_PACKAGE_COMPONENT",packageName.c_str());
|
||||
if (!this->ReadListFile("CPackDeb.cmake"))
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||
"Error while execution CPackDeb.cmake" << std::endl);
|
||||
retval = 0;
|
||||
return retval;
|
||||
}
|
||||
|
||||
cmsys::Glob gl;
|
||||
std::string findExpr(this->GetOption("WDIR"));
|
||||
findExpr += "/*";
|
||||
gl.RecurseOn();
|
||||
if ( !gl.FindFiles(findExpr) )
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||
"Cannot find any files in the installed directory" << std::endl);
|
||||
return 0;
|
||||
}
|
||||
packageFiles = gl.GetFiles();
|
||||
|
||||
int res = createDeb();
|
||||
if (res != 1)
|
||||
{
|
||||
retval = 0;
|
||||
}
|
||||
// add the generated package to package file names list
|
||||
packageFileNames.push_back(packageFileName);
|
||||
return retval;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
|
||||
{
|
||||
int retval = 1;
|
||||
/* Reset package file name list it will be populated during the
|
||||
* component packaging run*/
|
||||
packageFileNames.clear();
|
||||
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
|
||||
|
||||
// The default behavior is to have one package by component group
|
||||
// unless CPACK_COMPONENTS_IGNORE_GROUP is specified.
|
||||
if (!ignoreGroup)
|
||||
{
|
||||
std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
|
||||
for (compGIt=this->ComponentGroups.begin();
|
||||
compGIt!=this->ComponentGroups.end(); ++compGIt)
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: "
|
||||
<< compGIt->first
|
||||
<< std::endl);
|
||||
// Begin the archive for this group
|
||||
retval &= PackageOnePack(initialTopLevel,compGIt->first);
|
||||
}
|
||||
// Handle Orphan components (components not belonging to any groups)
|
||||
std::map<std::string, cmCPackComponent>::iterator compIt;
|
||||
for (compIt=this->Components.begin();
|
||||
compIt!=this->Components.end(); ++compIt )
|
||||
{
|
||||
// Does the component belong to a group?
|
||||
if (compIt->second.Group==NULL)
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||
"Component <"
|
||||
<< compIt->second.Name
|
||||
<< "> does not belong to any group, package it separately."
|
||||
<< std::endl);
|
||||
// Begin the archive for this orphan component
|
||||
retval &= PackageOnePack(initialTopLevel,compIt->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
// CPACK_COMPONENTS_IGNORE_GROUPS is set
|
||||
// We build 1 package per component
|
||||
else
|
||||
{
|
||||
std::map<std::string, cmCPackComponent>::iterator compIt;
|
||||
for (compIt=this->Components.begin();
|
||||
compIt!=this->Components.end(); ++compIt )
|
||||
{
|
||||
retval &= PackageOnePack(initialTopLevel,compIt->first);
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackDebGenerator::PackageComponentsAllInOne()
|
||||
{
|
||||
int retval = 1;
|
||||
std::string compInstDirName;
|
||||
/* Reset package file name list it will be populated during the
|
||||
* component packaging run*/
|
||||
packageFileNames.clear();
|
||||
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
|
||||
|
||||
compInstDirName = "ALL_COMPONENTS_IN_ONE";
|
||||
|
||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||
"Packaging all groups in one package..."
|
||||
"(CPACK_COMPONENTS_ALL_[GROUPS_]IN_ONE_PACKAGE is set)"
|
||||
<< std::endl);
|
||||
|
||||
// The ALL GROUPS in ONE package case
|
||||
std::string localToplevel(initialTopLevel);
|
||||
std::string packageFileName(
|
||||
cmSystemTools::GetParentDirectory(toplevel.c_str())
|
||||
);
|
||||
std::string outputFileName(
|
||||
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
|
||||
+ this->GetOutputExtension()
|
||||
);
|
||||
// all GROUP in one vs all COMPONENT in one
|
||||
localToplevel += "/"+compInstDirName;
|
||||
|
||||
/* replace the TEMP DIRECTORY with the component one */
|
||||
this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str());
|
||||
packageFileName += "/"+ outputFileName;
|
||||
/* replace proposed CPACK_OUTPUT_FILE_NAME */
|
||||
this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str());
|
||||
/* replace the TEMPORARY package file name */
|
||||
this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME",
|
||||
packageFileName.c_str());
|
||||
// Tell CPackDeb.cmake the name of the component GROUP.
|
||||
this->SetOption("CPACK_DEB_PACKAGE_COMPONENT",compInstDirName.c_str());
|
||||
if (!this->ReadListFile("CPackDeb.cmake"))
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||
"Error while execution CPackDeb.cmake" << std::endl);
|
||||
retval = 0;
|
||||
return retval;
|
||||
}
|
||||
|
||||
cmsys::Glob gl;
|
||||
std::string findExpr(this->GetOption("WDIR"));
|
||||
findExpr += "/*";
|
||||
gl.RecurseOn();
|
||||
if ( !gl.FindFiles(findExpr) )
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||
"Cannot find any files in the installed directory" << std::endl);
|
||||
return 0;
|
||||
}
|
||||
packageFiles = gl.GetFiles();
|
||||
|
||||
int res = createDeb();
|
||||
if (res != 1)
|
||||
{
|
||||
retval = 0;
|
||||
}
|
||||
// add the generated package to package file names list
|
||||
packageFileNames.push_back(packageFileName);
|
||||
return retval;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackDebGenerator::PackageFiles()
|
||||
{
|
||||
this->ReadListFile("CPackDeb.cmake");
|
||||
int retval = -1;
|
||||
|
||||
/* Are we in the component packaging case */
|
||||
if (SupportsComponentInstallation()) {
|
||||
// CASE 1 : COMPONENT ALL-IN-ONE package
|
||||
// If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
|
||||
// then the package file is unique and should be open here.
|
||||
if (componentPackageMethod == ONE_PACKAGE)
|
||||
{
|
||||
return PackageComponentsAllInOne();
|
||||
}
|
||||
// CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
|
||||
// There will be 1 package for each component group
|
||||
// however one may require to ignore component group and
|
||||
// in this case you'll get 1 package for each component.
|
||||
else
|
||||
{
|
||||
return PackageComponents(componentPackageMethod ==
|
||||
ONE_PACKAGE_PER_COMPONENT);
|
||||
}
|
||||
}
|
||||
// CASE 3 : NON COMPONENT package.
|
||||
else
|
||||
{
|
||||
if (!this->ReadListFile("CPackDeb.cmake"))
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||
"Error while execution CPackDeb.cmake" << std::endl);
|
||||
retval = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
packageFiles = files;
|
||||
return createDeb();
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int cmCPackDebGenerator::createDeb()
|
||||
{
|
||||
const char* cmakeExecutable = this->GetOption("CMAKE_COMMAND");
|
||||
|
||||
// debian-binary file
|
||||
std::string dbfilename;
|
||||
dbfilename = toplevel;
|
||||
dbfilename += this->GetOption("WDIR");
|
||||
dbfilename += "/debian-binary";
|
||||
{ // the scope is needed for cmGeneratedFileStream
|
||||
cmGeneratedFileStream out(dbfilename.c_str());
|
||||
@ -68,7 +288,7 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
|
||||
// control file
|
||||
std::string ctlfilename;
|
||||
ctlfilename = toplevel;
|
||||
ctlfilename = this->GetOption("WDIR");
|
||||
ctlfilename += "/control";
|
||||
|
||||
// debian policy enforce lower case for package name
|
||||
@ -158,8 +378,9 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
{
|
||||
std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
|
||||
dirName += '/';
|
||||
for (std::vector<std::string>::const_iterator fileIt = files.begin();
|
||||
fileIt != files.end(); ++ fileIt )
|
||||
for (std::vector<std::string>::const_iterator fileIt =
|
||||
packageFiles.begin();
|
||||
fileIt != packageFiles.end(); ++ fileIt )
|
||||
{
|
||||
totalSize += cmSystemTools::FileLength(fileIt->c_str());
|
||||
}
|
||||
@ -178,14 +399,22 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
// now add all directories which have to be compressed
|
||||
// collect all top level install dirs for that
|
||||
// e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt
|
||||
size_t topLevelLength = toplevel.length();
|
||||
size_t topLevelLength = std::string(this->GetOption("WDIR")).length();
|
||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "WDIR: \"" << this->GetOption("WDIR")
|
||||
<< "\", length = " << topLevelLength
|
||||
<< std::endl);
|
||||
std::set<std::string> installDirs;
|
||||
for (std::vector<std::string>::const_iterator fileIt = files.begin();
|
||||
fileIt != files.end(); ++ fileIt )
|
||||
for (std::vector<std::string>::const_iterator fileIt =
|
||||
packageFiles.begin();
|
||||
fileIt != packageFiles.end(); ++ fileIt )
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "FILEIT: \"" << *fileIt << "\""
|
||||
<< std::endl);
|
||||
std::string::size_type slashPos = fileIt->find('/', topLevelLength+1);
|
||||
std::string relativeDir = fileIt->substr(topLevelLength,
|
||||
std::string relativeDir = fileIt->substr(topLevelLength,
|
||||
slashPos - topLevelLength);
|
||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "RELATIVEDIR: \"" << relativeDir
|
||||
<< "\"" << std::endl);
|
||||
if (installDirs.find(relativeDir) == installDirs.end())
|
||||
{
|
||||
installDirs.insert(relativeDir);
|
||||
@ -195,11 +424,11 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
}
|
||||
|
||||
std::string output;
|
||||
int retVal = -1;
|
||||
int retval = -1;
|
||||
int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
|
||||
&retVal, toplevel.c_str(), this->GeneratorVerbose, 0);
|
||||
&retval, this->GetOption("WDIR"), this->GeneratorVerbose, 0);
|
||||
|
||||
if ( !res || retVal )
|
||||
if ( !res || retval )
|
||||
{
|
||||
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
|
||||
tmpFile += "/Deb.log";
|
||||
@ -215,15 +444,18 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
}
|
||||
|
||||
std::string md5filename;
|
||||
md5filename = toplevel;
|
||||
md5filename = this->GetOption("WDIR");
|
||||
md5filename += "/md5sums";
|
||||
|
||||
{ // the scope is needed for cmGeneratedFileStream
|
||||
cmGeneratedFileStream out(md5filename.c_str());
|
||||
std::vector<std::string>::const_iterator fileIt;
|
||||
std::string topLevelWithTrailingSlash = toplevel;
|
||||
// std::string topLevelWithTrailingSlash = toplevel;
|
||||
std::string topLevelWithTrailingSlash =
|
||||
this->GetOption("CPACK_TEMPORARY_DIRECTORY");
|
||||
topLevelWithTrailingSlash += '/';
|
||||
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
|
||||
for ( fileIt = packageFiles.begin();
|
||||
fileIt != packageFiles.end(); ++ fileIt )
|
||||
{
|
||||
cmd = "\"";
|
||||
cmd += cmakeExecutable;
|
||||
@ -233,34 +465,33 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
//std::string output;
|
||||
//int retVal = -1;
|
||||
res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
|
||||
&retVal, toplevel.c_str(), this->GeneratorVerbose, 0);
|
||||
&retval, toplevel.c_str(), this->GeneratorVerbose, 0);
|
||||
// debian md5sums entries are like this:
|
||||
// 014f3604694729f3bf19263bac599765 usr/bin/ccmake
|
||||
// thus strip the full path (with the trailing slash)
|
||||
cmSystemTools::ReplaceString(output,
|
||||
cmSystemTools::ReplaceString(output,
|
||||
topLevelWithTrailingSlash.c_str(), "");
|
||||
out << output;
|
||||
}
|
||||
// each line contains a eol.
|
||||
// each line contains a eol.
|
||||
// Do not end the md5sum file with yet another (invalid)
|
||||
}
|
||||
|
||||
|
||||
cmd = "\"";
|
||||
cmd += cmakeExecutable;
|
||||
cmd += "\" -E tar cfz control.tar.gz ./control ./md5sums";
|
||||
const char* controlExtra =
|
||||
const char* controlExtra =
|
||||
this->GetOption("CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA");
|
||||
if( controlExtra )
|
||||
{
|
||||
{
|
||||
std::vector<std::string> controlExtraList;
|
||||
cmSystemTools::ExpandListArgument(controlExtra, controlExtraList);
|
||||
for(std::vector<std::string>::iterator i =
|
||||
for(std::vector<std::string>::iterator i =
|
||||
controlExtraList.begin(); i != controlExtraList.end(); ++i)
|
||||
{
|
||||
std::string filenamename =
|
||||
std::string filenamename =
|
||||
cmsys::SystemTools::GetFilenameName(i->c_str());
|
||||
std::string localcopy = toplevel;
|
||||
std::string localcopy = this->GetOption("WDIR");
|
||||
localcopy += "/";
|
||||
localcopy += filenamename;
|
||||
// if we can copy the file, it means it does exist, let's add it:
|
||||
@ -274,9 +505,9 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
}
|
||||
}
|
||||
res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
|
||||
&retVal, toplevel.c_str(), this->GeneratorVerbose, 0);
|
||||
&retval, this->GetOption("WDIR"), this->GeneratorVerbose, 0);
|
||||
|
||||
if ( !res || retVal )
|
||||
if ( !res || retval )
|
||||
{
|
||||
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
|
||||
tmpFile += "/Deb.log";
|
||||
@ -295,24 +526,63 @@ int cmCPackDebGenerator::PackageFiles()
|
||||
// since debian packages require BSD ar (most Linux distros and even
|
||||
// FreeBSD and NetBSD ship GNU ar) we use a copy of OpenBSD ar here.
|
||||
std::vector<std::string> arFiles;
|
||||
std::string topLevelString = toplevel;
|
||||
std::string topLevelString = this->GetOption("WDIR");
|
||||
topLevelString += "/";
|
||||
arFiles.push_back(topLevelString + "debian-binary");
|
||||
arFiles.push_back(topLevelString + "control.tar.gz");
|
||||
arFiles.push_back(topLevelString + "data.tar.gz");
|
||||
res = ar_append(packageFileNames[0].c_str(), arFiles);
|
||||
std::string outputFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
|
||||
outputFileName += "/";
|
||||
outputFileName += this->GetOption("CPACK_OUTPUT_FILE_NAME");
|
||||
res = ar_append(outputFileName.c_str(), arFiles);
|
||||
if ( res!=0 )
|
||||
{
|
||||
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
|
||||
std::string tmpFile = this->GetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME");
|
||||
tmpFile += "/Deb.log";
|
||||
cmGeneratedFileStream ofs(tmpFile.c_str());
|
||||
ofs << "# Problem creating archive using: " << res << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool cmCPackDebGenerator::SupportsComponentInstallation() const
|
||||
{
|
||||
if (IsOn("CPACK_DEB_COMPONENT_INSTALL"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
|
||||
const std::string& componentName)
|
||||
{
|
||||
if (componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
|
||||
return componentName;
|
||||
}
|
||||
|
||||
if (componentPackageMethod == ONE_PACKAGE) {
|
||||
return std::string("ALL_COMPONENTS_IN_ONE");
|
||||
}
|
||||
// We have to find the name of the COMPONENT GROUP
|
||||
// the current COMPONENT belongs to.
|
||||
std::string groupVar = "CPACK_COMPONENT_" +
|
||||
cmSystemTools::UpperCase(componentName) + "_GROUP";
|
||||
if (NULL != GetOption(groupVar.c_str()))
|
||||
{
|
||||
return std::string(GetOption(groupVar.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
return componentName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// The following code is taken from OpenBSD ar:
|
||||
// http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ar/
|
||||
// It has been slightly modified:
|
||||
|
@ -33,8 +33,30 @@ public:
|
||||
|
||||
protected:
|
||||
virtual int InitializeInternal();
|
||||
/**
|
||||
* This method factors out the work done in component packaging case.
|
||||
*/
|
||||
int PackageOnePack(std::string initialToplevel, std::string packageName);
|
||||
/**
|
||||
* The method used to package files when component
|
||||
* install is used. This will create one
|
||||
* archive for each component group.
|
||||
*/
|
||||
int PackageComponents(bool ignoreGroup);
|
||||
/**
|
||||
* Special case of component install where all
|
||||
* components will be put in a single installer.
|
||||
*/
|
||||
int PackageComponentsAllInOne();
|
||||
virtual int PackageFiles();
|
||||
virtual const char* GetOutputExtension() { return ".deb"; }
|
||||
virtual bool SupportsComponentInstallation() const;
|
||||
virtual std::string GetComponentInstallDirNameSuffix(
|
||||
const std::string& componentName);
|
||||
|
||||
private:
|
||||
int createDeb();
|
||||
std::vector<std::string> packageFiles;
|
||||
|
||||
};
|
||||
|
||||
|
@ -51,6 +51,8 @@ static const char* SLASTREnglish =
|
||||
//----------------------------------------------------------------------
|
||||
cmCPackDragNDropGenerator::cmCPackDragNDropGenerator()
|
||||
{
|
||||
// default to one package file for components
|
||||
this->componentPackageMethod = ONE_PACKAGE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@ -106,8 +108,57 @@ const char* cmCPackDragNDropGenerator::GetOutputExtension()
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackDragNDropGenerator::PackageFiles()
|
||||
{
|
||||
// gather which directories to make dmg files for
|
||||
// multiple directories occur if packaging components or groups separately
|
||||
|
||||
return this->CreateDMG();
|
||||
// monolith
|
||||
if(this->Components.empty())
|
||||
{
|
||||
return this->CreateDMG(toplevel, packageFileNames[0]);
|
||||
}
|
||||
|
||||
// component install
|
||||
std::vector<std::string> package_files;
|
||||
|
||||
std::map<std::string, cmCPackComponent>::iterator compIt;
|
||||
for (compIt=this->Components.begin();
|
||||
compIt!=this->Components.end(); ++compIt )
|
||||
{
|
||||
std::string name = GetComponentInstallDirNameSuffix(compIt->first);
|
||||
package_files.push_back(name);
|
||||
}
|
||||
std::sort(package_files.begin(), package_files.end());
|
||||
package_files.erase(std::unique(package_files.begin(),
|
||||
package_files.end()),
|
||||
package_files.end());
|
||||
|
||||
|
||||
// loop to create dmg files
|
||||
packageFileNames.clear();
|
||||
for(size_t i=0; i<package_files.size(); i++)
|
||||
{
|
||||
std::string full_package_name = std::string(toplevel) + std::string("/");
|
||||
if(package_files[i] == "ALL_IN_ONE")
|
||||
{
|
||||
full_package_name += this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||
}
|
||||
else
|
||||
{
|
||||
full_package_name += package_files[i];
|
||||
}
|
||||
full_package_name += std::string(GetOutputExtension());
|
||||
packageFileNames.push_back(full_package_name);
|
||||
|
||||
std::string src_dir = toplevel;
|
||||
src_dir += "/";
|
||||
src_dir += package_files[i];
|
||||
|
||||
if(0 == this->CreateDMG(src_dir, full_package_name))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@ -159,10 +210,11 @@ bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command,
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackDragNDropGenerator::CreateDMG()
|
||||
int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
||||
const std::string& output_file)
|
||||
{
|
||||
// Get optional arguments ...
|
||||
const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON")
|
||||
const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON")
|
||||
? this->GetOption("CPACK_PACKAGE_ICON") : "";
|
||||
|
||||
const std::string cpack_dmg_volume_name =
|
||||
@ -197,7 +249,7 @@ int cmCPackDragNDropGenerator::CreateDMG()
|
||||
// The staging directory contains everything that will end-up inside the
|
||||
// final disk image ...
|
||||
cmOStringStream staging;
|
||||
staging << toplevel;
|
||||
staging << src_dir;
|
||||
|
||||
// Add a symlink to /Applications so users can drag-and-drop the bundle
|
||||
// into it
|
||||
@ -472,7 +524,7 @@ int cmCPackDragNDropGenerator::CreateDMG()
|
||||
final_image_command << cpack_dmg_format;
|
||||
final_image_command << " -imagekey";
|
||||
final_image_command << " zlib-level=9";
|
||||
final_image_command << " -o \"" << packageFileNames[0] << "\"";
|
||||
final_image_command << " -o \"" << output_file << "\"";
|
||||
|
||||
if(!this->RunCommand(final_image_command))
|
||||
{
|
||||
@ -485,3 +537,47 @@ int cmCPackDragNDropGenerator::CreateDMG()
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool cmCPackDragNDropGenerator::SupportsComponentInstallation() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string
|
||||
cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
|
||||
const std::string& componentName)
|
||||
{
|
||||
// we want to group components together that go in the same dmg package
|
||||
std::string package_file_name = this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||
|
||||
// we have 3 mutually exclusive modes to work in
|
||||
// 1. all components in one package
|
||||
// 2. each group goes in its own package with left over
|
||||
// components in their own package
|
||||
// 3. ignore groups - if grouping is defined, it is ignored
|
||||
// and each component goes in its own package
|
||||
|
||||
if(this->componentPackageMethod == ONE_PACKAGE)
|
||||
{
|
||||
return "ALL_IN_ONE";
|
||||
}
|
||||
|
||||
if(this->componentPackageMethod == ONE_PACKAGE_PER_GROUP)
|
||||
{
|
||||
// We have to find the name of the COMPONENT GROUP
|
||||
// the current COMPONENT belongs to.
|
||||
std::string groupVar = "CPACK_COMPONENT_" +
|
||||
cmSystemTools::UpperCase(componentName) + "_GROUP";
|
||||
const char* _groupName = GetOption(groupVar.c_str());
|
||||
if (_groupName)
|
||||
{
|
||||
std::string groupName = _groupName;
|
||||
|
||||
groupName = GetComponentPackageFileName(package_file_name,
|
||||
groupName, true);
|
||||
return groupName;
|
||||
}
|
||||
}
|
||||
|
||||
return GetComponentPackageFileName(package_file_name, componentName, false);
|
||||
}
|
||||
|
@ -30,11 +30,16 @@ protected:
|
||||
virtual int InitializeInternal();
|
||||
virtual const char* GetOutputExtension();
|
||||
int PackageFiles();
|
||||
bool SupportsComponentInstallation() const;
|
||||
|
||||
|
||||
bool CopyFile(cmOStringStream& source, cmOStringStream& target);
|
||||
bool RunCommand(cmOStringStream& command, std::string* output = 0);
|
||||
|
||||
int CreateDMG();
|
||||
std::string
|
||||
GetComponentInstallDirNameSuffix(const std::string& componentName);
|
||||
|
||||
int CreateDMG(const std::string& src_dir, const std::string& output_file);
|
||||
|
||||
std::string InstallPrefix;
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user