Imported Upstream version 3.0.0

ci/unstable
Felix Geyer 11 years ago
parent dc0f9bc5f2
commit 0f49848810

@ -1,3 +1,4 @@
install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${CMAKE_DATA_DIR}/editors/vim)
install(FILES cmake-mode.el DESTINATION ${CMAKE_DATA_DIR}/editors/emacs)
install(FILES cmake.m4 DESTINATION share/aclocal)
add_subdirectory (bash-completion)

@ -1,3 +1,5 @@
;;; cmake-mode.el --- major-mode for editing CMake sources
;=============================================================================
; CMake - Cross Platform Makefile Generator
; Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
@ -9,7 +11,6 @@
; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
; See the License for more information.
;=============================================================================
;;; cmake-mode.el --- major-mode for editing CMake sources
;------------------------------------------------------------------------------
@ -22,10 +23,6 @@
;;
;; (setq load-path (cons (expand-file-name "/dir/with/cmake-mode") load-path))
;; (require 'cmake-mode)
;; (setq auto-mode-alist
;; (append '(("CMakeLists\\.txt\\'" . cmake-mode)
;; ("\\.cmake\\'" . cmake-mode))
;; auto-mode-alist))
;------------------------------------------------------------------------------
@ -82,7 +79,7 @@ set the path with these commands:
(if (save-excursion
(beginning-of-line)
(let ((parse-end (point)))
(beginning-of-buffer)
(goto-char (point-min))
(nth 3 (parse-partial-sexp (point) parse-end))
)
)
@ -189,7 +186,6 @@ the indentation. Otherwise it retains the same position on the line"
(defun unscreamify-cmake-buffer ()
"Convert all CMake commands to lowercase in buffer."
(interactive)
(setq save-point (point))
(goto-char (point-min))
(while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t)
(replace-match
@ -198,7 +194,6 @@ the indentation. Otherwise it retains the same position on the line"
(downcase (match-string 2))
(match-string 3))
t))
(goto-char save-point)
)
;------------------------------------------------------------------------------
@ -230,26 +225,14 @@ the indentation. Otherwise it retains the same position on the line"
;;
(defvar cmake-tab-width 2)
;;
;; Keymap.
;;
(defvar cmake-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-ch" 'cmake-help-command)
(define-key map "\C-cl" 'cmake-help-list-commands)
(define-key map "\C-cu" 'unscreamify-cmake-buffer)
map)
"Keymap used in cmake-mode buffers.")
;------------------------------------------------------------------------------
;;
;; CMake mode startup function.
;;
;;;###autoload
(defun cmake-mode ()
"Major mode for editing CMake listfiles.
\\{cmake-mode-map}"
"Major mode for editing CMake listfiles."
(interactive)
(kill-all-local-variables)
(setq major-mode 'cmake-mode)
@ -276,80 +259,145 @@ the indentation. Otherwise it retains the same position on the line"
(make-local-variable 'comment-start)
(setq comment-start "#")
; Setup keymap.
(use-local-map cmake-mode-map)
; Run user hooks.
(run-hooks 'cmake-mode-hook))
; Help mode starts here
(defun cmake-command-run (type &optional topic)
;;;###autoload
(defun cmake-command-run (type &optional topic buffer)
"Runs the command cmake with the arguments specified. The
optional argument topic will be appended to the argument list."
(interactive "s")
(let* ((bufname (concat "*CMake" type (if topic "-") topic "*"))
(buffer (get-buffer bufname))
(let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*")))
(buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname)))
(command (concat cmake-mode-cmake-executable " " type " " topic))
;; Turn of resizing of mini-windows for shell-command.
(resize-mini-windows nil)
)
(if buffer
(display-buffer buffer 'not-this-window)
;; Buffer doesn't exist. Create it and fill it
(setq buffer (generate-new-buffer bufname))
(setq command (concat cmake-mode-cmake-executable " " type " " topic))
(message "Running %s" command)
;; We don't want the contents of the shell-command running to the
;; minibuffer, so turn it off. A value of nil means don't automatically
;; resize mini-windows.
(setq resize-mini-windows-save resize-mini-windows)
(setq resize-mini-windows nil)
(shell-command command buffer)
;; Save the original window, so that we can come back to it later.
;; save-excursion doesn't seem to work for this.
(setq window (selected-window))
;; We need to select it so that we can apply special modes to it
(save-selected-window
(select-window (display-buffer buffer 'not-this-window))
(cmake-mode)
(toggle-read-only t)
;; Restore the original window
(select-window window)
(setq resize-mini-windows resize-mini-windows-save)
)
(toggle-read-only t))
)
)
;;;###autoload
(defun cmake-help-list-commands ()
"Prints out a list of the cmake commands."
(interactive)
(cmake-command-run "--help-command-list")
)
(defvar cmake-help-command-history nil "Topic read history.")
(defvar cmake-commands '() "List of available topics for --help-command.")
(defvar cmake-help-command-history nil "Command read history.")
(defvar cmake-modules '() "List of available topics for --help-module.")
(defvar cmake-help-module-history nil "Module read history.")
(defvar cmake-variables '() "List of available topics for --help-variable.")
(defvar cmake-help-variable-history nil "Variable read history.")
(defvar cmake-properties '() "List of available topics for --help-property.")
(defvar cmake-help-property-history nil "Property read history.")
(defvar cmake-help-complete-history nil "Complete help read history.")
(defvar cmake-string-to-list-symbol
'(("command" cmake-commands cmake-help-command-history)
("module" cmake-modules cmake-help-module-history)
("variable" cmake-variables cmake-help-variable-history)
("property" cmake-properties cmake-help-property-history)
))
(defun cmake-get-list (listname)
"If the value of LISTVAR is nil, run cmake --help-LISTNAME-list
and store the result as a list in LISTVAR."
(let ((listvar (car (cdr (assoc listname cmake-string-to-list-symbol)))))
(if (not (symbol-value listvar))
(let ((temp-buffer-name "*CMake Temporary*"))
(save-window-excursion
(cmake-command-run (concat "--help-" listname "-list") nil temp-buffer-name)
(with-current-buffer temp-buffer-name
(set listvar (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t))))))
(symbol-value listvar)
))
)
(require 'thingatpt)
(defun cmake-get-topic (type)
"Gets the topic from the minibuffer input. The default is the word the cursor is on."
(interactive)
(defun cmake-help-type (type)
(let* ((default-entry (word-at-point))
(input (read-string
(format "CMake %s (default %s): " type default-entry) ; prompt
nil ; initial input
'cmake-help-command-history ; command history
default-entry ; default-value
(history (car (cdr (cdr (assoc type cmake-string-to-list-symbol)))))
(input (completing-read
(format "CMake %s: " type) ; prompt
(cmake-get-list type) ; completions
nil ; predicate
t ; require-match
default-entry ; initial-input
history
)))
(if (string= input "")
(error "No argument given")
input))
)
;;;###autoload
(defun cmake-help-command ()
"Prints out the help message corresponding to the command the cursor is on."
"Prints out the help message for the command the cursor is on."
(interactive)
(setq command (cmake-get-topic "command"))
(cmake-command-run "--help-command" (downcase command))
(cmake-command-run "--help-command" (cmake-help-type "command") "*CMake Help*"))
;;;###autoload
(defun cmake-help-module ()
"Prints out the help message for the module the cursor is on."
(interactive)
(cmake-command-run "--help-module" (cmake-help-type "module") "*CMake Help*"))
;;;###autoload
(defun cmake-help-variable ()
"Prints out the help message for the variable the cursor is on."
(interactive)
(cmake-command-run "--help-variable" (cmake-help-type "variable") "*CMake Help*"))
;;;###autoload
(defun cmake-help-property ()
"Prints out the help message for the property the cursor is on."
(interactive)
(cmake-command-run "--help-property" (cmake-help-type "property") "*CMake Help*"))
;;;###autoload
(defun cmake-help ()
"Queries for any of the four available help topics and prints out the approriate page."
(interactive)
(let* ((default-entry (word-at-point))
(command-list (cmake-get-list "command"))
(variable-list (cmake-get-list "variable"))
(module-list (cmake-get-list "module"))
(property-list (cmake-get-list "property"))
(all-words (append command-list variable-list module-list property-list))
(input (completing-read
"CMake command/module/variable/property: " ; prompt
all-words ; completions
nil ; predicate
t ; require-match
default-entry ; initial-input
'cmake-help-complete-history
)))
(if (string= input "")
(error "No argument given")
(if (member input command-list)
(cmake-command-run "--help-command" input "*CMake Help*")
(if (member input variable-list)
(cmake-command-run "--help-variable" input "*CMake Help*")
(if (member input module-list)
(cmake-command-run "--help-module" input "*CMake Help*")
(if (member input property-list)
(cmake-command-run "--help-property" input "*CMake Help*")
(error "Not a know help topic.") ; this really should not happen
))))))
)
;;;###autoload
(progn
(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))
(add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode)))
; This file provides cmake-mode.
(provide 'cmake-mode)

@ -29,27 +29,23 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_PACKAGE_VENDOR "Kitware")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
# Make this explicit here, rather than accepting the CPack default value,
# so we can refer to it:
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
# Installers for 32- vs. 64-bit CMake:
# - Root install directory (displayed to end user at installer-run time)
# - "NSIS package/display name" (text used in the installer GUI)
# - Registry key used to store info about the installation
if(CMAKE_CL_64)
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
else()
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
endif()
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_PACKAGE_NAME}")
if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just

@ -13,14 +13,7 @@ if(CPACK_GENERATOR MATCHES "NSIS")
set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
# tell cpack to create links to the doc files
set(CPACK_NSIS_MENU_LINKS
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html"
"CMake Properties and Variables Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help"
"@CMAKE_DOC_DIR@/html/index.html" "CMake Documentation"
"http://www.cmake.org" "CMake Web Site"
)
# Use the icon from cmake-gui for add-remove programs
@ -65,13 +58,11 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX")
endif()
set(CPACK_PACKAGE_VERSION
"@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@.@CMake_VERSION_PATCH@")
"@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@")
# WIX installers require at most a 4 component version number, where
# each component is an integer between 0 and 65534 inclusive
set(tweak "@CMake_VERSION_TWEAK@")
if(tweak MATCHES "^[0-9]+$")
if(tweak GREATER 0 AND tweak LESS 65535)
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${tweak}")
endif()
set(patch "@CMake_VERSION_PATCH@")
if(patch MATCHES "^[0-9]+$" AND patch LESS 65535)
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${patch}")
endif()
endif()

@ -9,8 +9,10 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()
project(CMake)
if(CMAKE_BOOTSTRAP)
@ -111,10 +113,6 @@ endif()
# for testing. Simply to improve readability of the main script.
#-----------------------------------------------------------------------
macro(CMAKE_SETUP_TESTING)
if (NOT DART_ROOT)
set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
endif ()
if(BUILD_TESTING)
set(CMAKE_TEST_GENERATOR "" CACHE STRING
"Generator used when running tests")
@ -123,7 +121,6 @@ macro(CMAKE_SETUP_TESTING)
if(NOT CMAKE_TEST_GENERATOR)
set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
set(CMAKE_TEST_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}")
set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
else()
set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
set(CMAKE_TEST_GENERATOR_TOOLSET "")
@ -193,16 +190,9 @@ mark_as_advanced(CMAKE_USE_FOLDERS)
macro(CMAKE_SET_TARGET_FOLDER tgt folder)
if(CMAKE_USE_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Really, I just want this to be an "if(TARGET ${tgt})" ...
# but I'm not sure that our min req'd., CMake 2.4.5 can handle
# that... so I'm just activating this for now, with a version
# compare, and only for MSVC builds.
if(MSVC)
if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
if(MSVC AND TARGET ${tgt})
set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
endif()
endif()
else()
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
endif()
@ -323,11 +313,7 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build or use system libarchive for CMake and CTest.
if(CMAKE_USE_SYSTEM_LIBARCHIVE)
if(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
find_package(LibArchive)
else()
include(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
endif()
if(NOT LibArchive_FOUND)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
endif()
@ -420,27 +406,8 @@ endif()
# The main section of the CMakeLists file
#
#-----------------------------------------------------------------------
include(Source/CMakeVersion.cmake)
# Releases define a small tweak level.
if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
set(CMake_VERSION_IS_RELEASE 1)
set(CMake_VERSION_SOURCE "")
else()
set(CMake_VERSION_IS_RELEASE 0)
include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
endif()
# Compute the full version string.
set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
if(${CMake_VERSION_TWEAK} GREATER 0)
set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
endif()
if(CMake_VERSION_RC)
set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
endif()
if(CMake_VERSION_SOURCE)
set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
endif()
# Compute CMake_VERSION, etc.
include(Source/CMakeVersionCompute.cmake)
# Include the standard Dart testing module
enable_testing()
@ -460,27 +427,8 @@ set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
# install tree.
set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
set(CMAKE_DATA_DIR "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for data (relative to prefix).")
set(CMAKE_DOC_DIR "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for documentation (relative to prefix).")
set(CMAKE_MAN_DIR "man" CACHE STRING
"Install location for man pages (relative to prefix).")
mark_as_advanced(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
if(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Force doc, data and man dirs to conform to cygwin layout.
set(CMAKE_DOC_DIR "share/doc/cmake-${CMake_VERSION}")
set(CMAKE_DATA_DIR "share/cmake-${CMake_VERSION}")
set(CMAKE_MAN_DIR "share/man")
# let the user know we just forced these values
message(STATUS "Setup for Cygwin packaging")
message(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
message(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
message(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
endif()
string(REGEX REPLACE "^/" "" CMAKE_DATA_DIR "${CMAKE_DATA_DIR}")
string(REGEX REPLACE "^/" "" CMAKE_DOC_DIR "${CMAKE_DOC_DIR}")
string(REGEX REPLACE "^/" "" CMAKE_MAN_DIR "${CMAKE_MAN_DIR}")
# Load install destinations.
include(Source/CMakeInstallDestinations.cmake)
if(BUILD_TESTING)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
@ -529,8 +477,8 @@ endif()
if(BUILD_QtDialog)
if(APPLE)
set(CMAKE_BUNDLE_NAME
"CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
set(CMAKE_BUNDLE_VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in /
string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
@ -540,7 +488,7 @@ if(BUILD_QtDialog)
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif()
set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
"${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
endif()
set(QT_NEED_RPATH FALSE)
@ -582,10 +530,6 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
COPYONLY)
option(CMAKE_STRICT
"Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
mark_as_advanced(CMAKE_STRICT)
if(NOT CMake_VERSION_IS_RELEASE)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
@ -619,7 +563,9 @@ if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
endif()
CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
if(TARGET documentation)
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
endif()
# add a test
add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
@ -630,7 +576,7 @@ install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
# Install script directories.
install(
DIRECTORY Modules Templates
DIRECTORY Help Modules Templates
DESTINATION ${CMAKE_DATA_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
@ -641,16 +587,5 @@ install(
WORLD_READ WORLD_EXECUTE
)
# process docs related install
add_subdirectory(Docs)
#-----------------------------------------------------------------------
# End of the main section of the CMakeLists file
#-----------------------------------------------------------------------
# As a special case when building CMake itself, CMake 2.8.0 and below
# look up EXECUTABLE_OUTPUT_PATH in the top-level CMakeLists.txt file
# to compute the location of the "cmake" executable. We set it here
# so that those CMake versions can find it. We wait until after all
# the add_subdirectory() calls to avoid affecting the subdirectories.
set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
# Install auxiliary files integrating with other tools.
add_subdirectory(Auxiliary)

@ -0,0 +1,34 @@
Contributing to CMake
*********************
Community
=========
CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
.. _`Kitware`: http://www.kitware.com/cmake
The preferred entry point for new contributors is the mailing list.
Please subscribe and post to the `CMake Developers List`_ to offer
contributions. Regular and productive contributors may be invited
to gain direct push access.
.. _`CMake Developers List`: http://www.cmake.org/mailman/listinfo/cmake-developers
Patches
=======
Please base all new work on the ``master`` branch. Then use
``git format-patch`` to produce patches suitable to post to
the mailing list.
License
=======
We do not require any formal copyright assignment or contributor license
agreement. Any contributions intentionally sent upstream are presumed
to be offerred under terms of the OSI-approved BSD 3-clause License.
See `Copyright.txt`_ for details.
.. _`Copyright.txt`: Copyright.txt

@ -32,6 +32,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"warning .980: wrong number of actual arguments to intrinsic function .std::basic_"
"LINK : warning LNK4089: all references to.*ADVAPI32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*PSAPI.DLL.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*SHELL32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
"Warning: library was too large for page size.*"
"Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -19,7 +19,6 @@ endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif()
include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
set(_INTEL_WINDOWS 1)
@ -54,6 +53,18 @@ if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP")
# HP aCC since version 3.80 supports the flag +hpxstd98 to get ANSI C++98
# template support. It is known that version 6.25 doesn't need that flag.
# Versions prior to 3.80 will not be able to build CMake. Current assumption:
# it is needed for every version from 3.80 to 4 to get it working.
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4 AND
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.80)
# use new C++ library and improved template support
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA +hpxstd98")
endif()
endif()
# use the ansi CXX compile flag for building cmake
if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
@ -66,5 +77,7 @@ endif ()
# avoid binutils problem with large binaries, e.g. when building CMake in debug mode
# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230
if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text.*")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*")
endif ()
include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)

@ -1,5 +1,6 @@
CMake - Cross Platform Makefile Generator
Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
Copyright 2000-2014 Kitware, Inc.
Copyright 2000-2011 Insight Software Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without

@ -1,10 +0,0 @@
# The name of our project is "HELLO". CMakeLists files in this project can
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.
project (HELLO)
# Recurse into the "Hello" and "Demo" subdirectories. This does not actually
# cause another cmake executable to run. The same process will walk through
# the project's entire directory structure.
add_subdirectory (Hello)
add_subdirectory (Demo)

@ -1,12 +0,0 @@
# Make sure the compiler can find include files from our Hello library.
include_directories (${HELLO_SOURCE_DIR}/Hello)
# Make sure the linker can find the Hello library once it is built.
link_directories (${HELLO_BINARY_DIR}/Hello)
# Add executable called "helloDemo" that is built from the source files
# "demo.cxx" and "demo_b.cxx". The extensions are automatically found.
add_executable (helloDemo demo.cxx demo_b.cxx)
# Link the executable to the Hello library.
target_link_libraries (helloDemo Hello)

@ -1,10 +0,0 @@
#include "hello.h"
extern Hello hello;
int main()
{
hello.Print();
return 0;
}

@ -1,3 +0,0 @@
#include "hello.h"
Hello hello;

@ -1,3 +0,0 @@
# Create a library called "Hello" which includes the source file "hello.cxx".
# The extension is already found. Any number of sources could be listed here.
add_library (Hello hello.cxx)

@ -1,7 +0,0 @@
#include "hello.h"
#include <stdio.h>
void Hello::Print()
{
printf("Hello, World!\n");
}

@ -1,11 +0,0 @@
#ifndef _hello_h
#define _hello_h
class Hello
{
public:
void Print();
};
#endif

@ -0,0 +1,101 @@
A short-hand signature is:
.. parsed-literal::
|FIND_XXX| (<VAR> name1 [path1 path2 ...])
The general signature is:
.. parsed-literal::
|FIND_XXX| (
<VAR>
name | |NAMES|
[HINTS path1 [path2 ... ENV var]]
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH]
)
This command is used to find a |SEARCH_XXX_DESC|.
A cache entry named by ``<VAR>`` is created to store the result
of this command.
If the |SEARCH_XXX| is found the result is stored in the variable
and the search will not be repeated unless the variable is cleared.
If nothing is found, the result will be
``<VAR>-NOTFOUND``, and the search will be attempted again the
next time |FIND_XXX| is invoked with the same variable.
The name of the |SEARCH_XXX| that
is searched for is specified by the names listed
after the NAMES argument. Additional search locations
can be specified after the PATHS argument. If ENV var is
found in the HINTS or PATHS section the environment variable var
will be read and converted from a system environment variable to
a cmake style list of paths. For example ENV PATH would be a way
to list the system path variable. The argument
after DOC will be used for the documentation string in
the cache.
PATH_SUFFIXES specifies additional subdirectories to check below
each search path.
If NO_DEFAULT_PATH is specified, then no additional paths are
added to the search.
If NO_DEFAULT_PATH is not specified, the search process is as follows:
.. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
<prefix>/|XXX_SUBDIR| for each <prefix> in CMAKE_PREFIX_PATH
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| replace::
<prefix>/|XXX_SUBDIR| for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
1. Search paths specified in cmake-specific cache variables.
These are intended to be used on the command line with a -DVAR=value.
This can be skipped if NO_CMAKE_PATH is passed.
* |CMAKE_PREFIX_PATH_XXX|
* |CMAKE_XXX_PATH|
* |CMAKE_XXX_MAC_PATH|
2. Search paths specified in cmake-specific environment variables.
These are intended to be set in the user's shell configuration.
This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.
* |CMAKE_PREFIX_PATH_XXX|
* |CMAKE_XXX_PATH|
* |CMAKE_XXX_MAC_PATH|
3. Search the paths specified by the HINTS option.
These should be paths computed by system introspection, such as a
hint provided by the location of another item already found.
Hard-coded guesses should be specified with the PATHS option.
4. Search the standard system environment variables.
This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
* |SYSTEM_ENVIRONMENT_PATH_XXX|
5. Search cmake variables defined in the Platform files
for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH
is passed.
* |CMAKE_SYSTEM_PREFIX_PATH_XXX|
* |CMAKE_SYSTEM_XXX_PATH|
* |CMAKE_SYSTEM_XXX_MAC_PATH|
6. Search the paths specified by the PATHS option
or in the short-hand version of the command.
These are typically hard-coded guesses.
.. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
.. include:: FIND_XXX_MAC.txt
.. include:: FIND_XXX_ROOT.txt
.. include:: FIND_XXX_ORDER.txt

@ -0,0 +1,24 @@
On Darwin or systems supporting OS X Frameworks, the cmake variable
CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:
* FIRST: Try to find frameworks before standard libraries or headers.
This is the default on Darwin.
* LAST: Try to find frameworks after standard libraries or headers.
* ONLY: Only try to find frameworks.
* NEVER: Never try to find frameworks.
On Darwin or systems supporting OS X Application Bundles, the cmake
variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the
following:
* FIRST: Try to find application bundles before standard programs.
This is the default on Darwin.
* LAST: Try to find application bundles after standard programs.
* ONLY: Only try to find application bundles.
* NEVER: Never try to find application bundles.

@ -0,0 +1,12 @@
The default search order is designed to be most-specific to
least-specific for common use cases.
Projects may override the order by simply calling the command
multiple times and using the ``NO_*`` options:
.. parsed-literal::
|FIND_XXX| (|FIND_ARGS_XXX| PATHS paths... NO_DEFAULT_PATH)
|FIND_XXX| (|FIND_ARGS_XXX|)
Once one of the calls succeeds the result variable will be set
and stored in the cache so that no call will search again.

@ -0,0 +1,23 @@
The CMake variable :variable:`CMAKE_FIND_ROOT_PATH` specifies one or more
directories to be prepended to all other search directories. This
effectively "re-roots" the entire search under given locations.
Paths which are descendants of the :variable:`CMAKE_STAGING_PREFIX` are excluded
from this re-rooting, because that variable is always a path on the host system.
By default the :variable:`CMAKE_FIND_ROOT_PATH` is empty.
The :variable:`CMAKE_SYSROOT` variable can also be used to specify exactly one
directory to use as a prefix. Setting :variable:`CMAKE_SYSROOT` also has other
effects. See the documentation for that variable for more.
These variables are especially useful when cross-compiling to
point to the root directory of the target environment and CMake will
search there too. By default at first the directories listed in
:variable:`CMAKE_FIND_ROOT_PATH` are searched, then the :variable:`CMAKE_SYSROOT`
directory is searched, and then the non-rooted directories will be
searched. The default behavior can be adjusted by setting
|CMAKE_FIND_ROOT_PATH_MODE_XXX|. This behavior can be manually
overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH
the search order will be as described above. If
NO_CMAKE_FIND_ROOT_PATH is used then :variable:`CMAKE_FIND_ROOT_PATH` will not be
used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted
directories and directories below :variable:`CMAKE_STAGING_PREFIX` will be searched.

@ -0,0 +1,22 @@
add_compile_options
-------------------
Adds options to the compilation of source files.
::
add_compile_options(<option> ...)
Adds options to the compiler command line for sources in the current
directory and below. This command can be used to add any options, but
alternative commands exist to add preprocessor definitions
(:command:`target_compile_definitions` and :command:`add_definitions`) or
include directories (:command:`target_include_directories` and
:command:`include_directories`). See documentation of the
:prop_tgt:`directory <COMPILE_OPTIONS>` and
:prop_tgt:` target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties.
Arguments to ``add_compile_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

@ -0,0 +1,158 @@
add_custom_command
------------------
Add a custom build rule to the generated build system.
There are two main signatures for add_custom_command The first
signature is for adding a custom command to produce an output.
::
add_custom_command(OUTPUT output1 [output2 ...]
COMMAND command1 [ARGS] [args1...]
[COMMAND command2 [ARGS] [args2...] ...]
[MAIN_DEPENDENCY depend]
[DEPENDS [depends...]]
[IMPLICIT_DEPENDS <lang1> depend1
[<lang2> depend2] ...]
[WORKING_DIRECTORY dir]
[COMMENT comment] [VERBATIM] [APPEND])
This defines a command to generate specified OUTPUT file(s). A target
created in the same directory (CMakeLists.txt file) that specifies any
output of the custom command as a source file is given a rule to
generate the file using the command at build time. Do not list the
output in more than one independent target that may build in parallel
or the two instances of the rule may conflict (instead use
add_custom_target to drive the command and make the other targets
depend on that one). If an output name is a relative path it will be
interpreted relative to the build tree directory corresponding to the
current source directory. Note that MAIN_DEPENDENCY is completely
optional and is used as a suggestion to visual studio about where to
hang the custom command. In makefile terms this creates a new target
in the following form:
::
OUTPUT: MAIN_DEPENDENCY DEPENDS
COMMAND
If more than one command is specified they will be executed in order.
The optional ARGS argument is for backward compatibility and will be
ignored.
The second signature adds a custom command to a target such as a
library or executable. This is useful for performing an operation
before or after building the target. The command becomes part of the
target and will only execute when the target itself is built. If the
target is already built, the command will not execute.
::
add_custom_command(TARGET target
PRE_BUILD | PRE_LINK | POST_BUILD
COMMAND command1 [ARGS] [args1...]
[COMMAND command2 [ARGS] [args2...] ...]
[WORKING_DIRECTORY dir]
[COMMENT comment] [VERBATIM])
This defines a new command that will be associated with building the
specified target. When the command will happen is determined by which
of the following is specified:
::
PRE_BUILD - run before all other dependencies
PRE_LINK - run after other dependencies
POST_BUILD - run after the target has been built
Note that the PRE_BUILD option is only supported on Visual Studio 7 or
later. For all other generators PRE_BUILD will be treated as
PRE_LINK.
If WORKING_DIRECTORY is specified the command will be executed in the
directory given. If it is a relative path it will be interpreted
relative to the build tree directory corresponding to the current
source directory. If COMMENT is set, the value will be displayed as a
message before the commands are executed at build time. If APPEND is
specified the COMMAND and DEPENDS option values are appended to the
custom command for the first output specified. There must have
already been a previous call to this command with the same output.
The COMMENT, WORKING_DIRECTORY, and MAIN_DEPENDENCY options are
currently ignored when APPEND is given, but may be used in the future.
If VERBATIM is given then all arguments to the commands will be
escaped properly for the build tool so that the invoked command
receives each argument unchanged. Note that one level of escapes is
still used by the CMake language processor before add_custom_command
even sees the arguments. Use of VERBATIM is recommended as it enables
correct behavior. When VERBATIM is not given the behavior is platform
specific because there is no protection of tool-specific special
characters.
If the output of the custom command is not actually created as a file
on disk it should be marked as SYMBOLIC with
SET_SOURCE_FILES_PROPERTIES.
The IMPLICIT_DEPENDS option requests scanning of implicit dependencies
of an input file. The language given specifies the programming
language whose corresponding dependency scanner should be used.
Currently only C and CXX language scanners are supported. The
language has to be specified for every file in the IMPLICIT_DEPENDS
list. Dependencies discovered from the scanning are added to those of
the custom command at build time. Note that the IMPLICIT_DEPENDS
option is currently supported only for Makefile generators and will be
ignored by other generators.
If COMMAND specifies an executable target (created by ADD_EXECUTABLE)
it will automatically be replaced by the location of the executable
created at build time. Additionally a target-level dependency will be
added so that the executable target will be built before any target
using this custom command. However this does NOT add a file-level
dependency that would cause the custom command to re-run whenever the
executable is recompiled.
Arguments to COMMAND may use "generator expressions" with the syntax
``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for
available expressions.
Note that tgt is not added as a dependency of the target this
expression is evaluated on.
::
$<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
$<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
Boolean expressions:
::
$<AND:?[,?]...> = '1' if all '?' are '1', else '0'
$<OR:?[,?]...> = '0' if all '?' are '0', else '1'
$<NOT:?> = '0' if '?' is '1', else '1'
where '?' is always either '0' or '1'.
Expressions with an implicit 'this' target:
::
$<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
References to target names in generator expressions imply target-level
dependencies, but NOT file-level dependencies. List target names with
the DEPENDS option to add file dependencies.
The DEPENDS option specifies files on which the command depends. If
any dependency is an OUTPUT of another custom command in the same
directory (CMakeLists.txt file) CMake automatically brings the other
custom command into the target in which this command is built. If
DEPENDS is not specified the command will run whenever the OUTPUT is
missing; if the command does not actually create the OUTPUT then the
rule will always run. If DEPENDS specifies any target (created by an
ADD_* command) a target-level dependency is created to make sure the
target is built before any target using this custom command.
Additionally, if the target is an executable or library a file-level
dependency is created to cause the custom command to re-run whenever
the target is recompiled.

@ -0,0 +1,45 @@
add_custom_target
-----------------
Add a target with no output so it will always be built.
::
add_custom_target(Name [ALL] [command1 [args1...]]
[COMMAND command2 [args2...] ...]
[DEPENDS depend depend depend ... ]
[WORKING_DIRECTORY dir]
[COMMENT comment] [VERBATIM]
[SOURCES src1 [src2...]])
Adds a target with the given name that executes the given commands.
The target has no output file and is ALWAYS CONSIDERED OUT OF DATE
even if the commands try to create a file with the name of the target.
Use ADD_CUSTOM_COMMAND to generate a file with dependencies. By
default nothing depends on the custom target. Use ADD_DEPENDENCIES to
add dependencies to or from other targets. If the ALL option is
specified it indicates that this target should be added to the default
build target so that it will be run every time (the command cannot be
called ALL). The command and arguments are optional and if not
specified an empty target will be created. If WORKING_DIRECTORY is
set, then the command will be run in that directory. If it is a
relative path it will be interpreted relative to the build tree
directory corresponding to the current source directory. If COMMENT
is set, the value will be displayed as a message before the commands
are executed at build time. Dependencies listed with the DEPENDS
argument may reference files and outputs of custom commands created
with add_custom_command() in the same directory (CMakeLists.txt file).
If VERBATIM is given then all arguments to the commands will be
escaped properly for the build tool so that the invoked command
receives each argument unchanged. Note that one level of escapes is
still used by the CMake language processor before add_custom_target
even sees the arguments. Use of VERBATIM is recommended as it enables
correct behavior. When VERBATIM is not given the behavior is platform
specific because there is no protection of tool-specific special
characters.
The SOURCES option specifies additional source files to be included in
the custom target. Specified source files will be added to IDE
project files for convenience in editing even if they have not build
rules.

@ -0,0 +1,25 @@
add_definitions
---------------
Adds -D define flags to the compilation of source files.
::
add_definitions(-DFOO -DBAR ...)
Adds definitions to the compiler command line for sources in the current
directory and below. This command can be used to add any flags, but
it is intended to add preprocessor definitions. Flags
beginning in -D or /D that look like preprocessor definitions are
automatically added to the :prop_dir:`COMPILE_DEFINITIONS` directory
property for the current directory. Definitions with non-trivial values
may be left in the set of flags instead of being converted for reasons of
backwards compatibility. See documentation of the
:prop_dir:`directory <COMPILE_DEFINITIONS>`,
:prop_tgt:`target <COMPILE_DEFINITIONS>`,
:prop_sf:`source file <COMPILE_DEFINITIONS>` ``COMPILE_DEFINITIONS``
properties for details on adding preprocessor definitions to specific
scopes and configurations.
See the :manual:`cmake-buildsystem(7)` manual for more on defining
buildsystem properties.

@ -0,0 +1,19 @@
add_dependencies
----------------
Add a dependency between top-level targets.
::
add_dependencies(<target> [<target-dependency>]...)
Make a top-level <target> depend on other top-level targets to ensure
that they build before <target> does. A top-level target is one
created by ADD_EXECUTABLE, ADD_LIBRARY, or ADD_CUSTOM_TARGET.
Dependencies added to an IMPORTED target are followed transitively in
its place since the target itself does not build.
See the DEPENDS option of ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND for
adding file-level dependencies in custom rules. See the
OBJECT_DEPENDS option in SET_SOURCE_FILES_PROPERTIES to add file-level
dependencies to object files.

@ -0,0 +1,77 @@
add_executable
--------------
Add an executable to the project using the specified source files.
::
add_executable(<name> [WIN32] [MACOSX_BUNDLE]
[EXCLUDE_FROM_ALL]
source1 [source2 ...])
Adds an executable target called ``<name>`` to be built from the source
files listed in the command invocation. The ``<name>`` corresponds to the
logical target name and must be globally unique within a project. The
actual file name of the executable built is constructed based on
conventions of the native platform (such as ``<name>.exe`` or just
``<name>``.
By default the executable file will be created in the build tree
directory corresponding to the source tree directory in which the
command was invoked. See documentation of the
:prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` target property to change this
location. See documentation of the :prop_tgt:`OUTPUT_NAME` target property
to change the ``<name>`` part of the final file name.
If ``WIN32`` is given the property :prop_tgt:`WIN32_EXECUTABLE` will be
set on the target created. See documentation of that target property for
details.
If ``MACOSX_BUNDLE`` is given the corresponding property will be set on
the created target. See documentation of the :prop_tgt:`MACOSX_BUNDLE`
target property for details.
If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
target property for details.
See the :manual:`cmake-buildsystem(7)` manual for more on defining
buildsystem properties.
--------------------------------------------------------------------------
::
add_executable(<name> IMPORTED [GLOBAL])
An :ref:`IMPORTED executable target <Imported Targets>` references an
executable file located outside the project. No rules are generated to
build it, and the :prop_tgt:`IMPORTED` target property is ``True``. The
target name has scope in the directory in which it is created and below, but
the ``GLOBAL`` option extends visibility. It may be referenced like any
target built within the project. ``IMPORTED`` executables are useful
for convenient reference from commands like :command:`add_custom_command`.
Details about the imported executable are specified by setting properties
whose names begin in ``IMPORTED_``. The most important such property is
:prop_tgt:`IMPORTED_LOCATION` (and its per-configuration version
:prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) which specifies the location of
the main executable file on disk. See documentation of the ``IMPORTED_*``
properties for more information.
--------------------------------------------------------------------------
::
add_executable(<name> ALIAS <target>)
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can
be used to refer to ``<target>`` in subsequent commands. The ``<name>``
does not appear in the generated buildsystem as a make target. The
``<target>`` may not be an :ref:`Imported Target <Imported Targets>` or an
``ALIAS``. ``ALIAS`` targets can be used as targets to read properties
from, executables for custom commands and custom targets. They can also be
tested for existance with the regular :command:`if(TARGET)` subcommand.
The ``<name>`` may not be used to modify properties of ``<target>``, that
is, it may not be used as the operand of :command:`set_property`,
:command:`set_target_properties`, :command:`target_link_libraries` etc.
An ``ALIAS`` target may not be installed or exported.

@ -0,0 +1,136 @@
add_library
-----------
Add a library to the project using the specified source files.
::
add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
source1 [source2 ...])
Adds a library target called ``<name>`` to be built from the source files
listed in the command invocation. The ``<name>`` corresponds to the
logical target name and must be globally unique within a project. The
actual file name of the library built is constructed based on
conventions of the native platform (such as ``lib<name>.a`` or
``<name>.lib``).
``STATIC``, ``SHARED``, or ``MODULE`` may be given to specify the type of
library to be created. ``STATIC`` libraries are archives of object files
for use when linking other targets. ``SHARED`` libraries are linked
dynamically and loaded at runtime. ``MODULE`` libraries are plugins that
are not linked into other targets but may be loaded dynamically at runtime
using dlopen-like functionality. If no type is given explicitly the
type is ``STATIC`` or ``SHARED`` based on whether the current value of the
variable :variable:`BUILD_SHARED_LIBS` is ``ON``. For ``SHARED`` and
``MODULE`` libraries the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
property is set to ``ON`` automatically.
By default the library file will be created in the build tree directory
corresponding to the source tree directory in which thecommand was
invoked. See documentation of the :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`,
:prop_tgt:`LIBRARY_OUTPUT_DIRECTORY`, and
:prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` target properties to change this
location. See documentation of the :prop_tgt:`OUTPUT_NAME` target
property to change the ``<name>`` part of the final file name.
If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
target property for details.
See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem
properties.
--------------------------------------------------------------------------
::
add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED
[GLOBAL])
An :ref:`IMPORTED library target <Imported Targets>` references a library
file located outside the project. No rules are generated to build it, and
the :prop_tgt:`IMPORTED` target property is ``True``. The target name has
scope in the directory in which it is created and below, but the ``GLOBAL``
option extends visibility. It may be referenced like any target built
within the project. ``IMPORTED`` libraries are useful for convenient
reference from commands like :command:`target_link_libraries`. Details
about the imported library are specified by setting properties whose names
begin in ``IMPORTED_`` and ``INTERFACE_``. The most important such
property is :prop_tgt:`IMPORTED_LOCATION` (and its per-configuration
variant :prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) which specifies the
location of the main library file on disk. See documentation of the
``IMPORTED_*`` and ``INTERFACE_*`` properties for more information.
--------------------------------------------------------------------------
::
add_library(<name> OBJECT <src>...)
Creates a special "object library" target. An object library compiles
source files but does not archive or link their object files into a
library. Instead other targets created by :command:`add_library` or
:command:`add_executable` may reference the objects using an expression of the
form ``$<TARGET_OBJECTS:objlib>`` as a source, where ``objlib`` is the
object library name. For example:
.. code-block:: cmake
add_library(... $<TARGET_OBJECTS:objlib> ...)
add_executable(... $<TARGET_OBJECTS:objlib> ...)
will include objlib's object files in a library and an executable
along with those compiled from their own sources. Object libraries
may contain only sources (and headers) that compile to object files.
They may contain custom commands generating such sources, but not
``PRE_BUILD``, ``PRE_LINK``, or ``POST_BUILD`` commands. Object libraries
cannot be imported, exported, installed, or linked. Some native build
systems may not like targets that have only object files, so consider
adding at least one real source file to any target that references
``$<TARGET_OBJECTS:objlib>``.
--------------------------------------------------------------------------
::
add_library(<name> ALIAS <target>)
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be
used to refer to ``<target>`` in subsequent commands. The ``<name>`` does
not appear in the generatedbuildsystem as a make target. The ``<target>``
may not be an :ref:`Imported Target <Imported Targets>` or an ``ALIAS``.
``ALIAS`` targets can be used as linkable targets and as targets to
read properties from. They can also be tested for existance with the
regular :command:`if(TARGET)` subcommand. The ``<name>`` may not be used
to modify properties of ``<target>``, that is, it may not be used as the
operand of :command:`set_property`, :command:`set_target_properties`,
:command:`target_link_libraries` etc. An ``ALIAS`` target may not be
installed or exported.
--------------------------------------------------------------------------
::
add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
Creates an :ref:`Interface Library <Interface Libraries>`. An ``INTERFACE``
library target does not directly create build output, though it may
have properties set on it and it may be installed, exported and
imported. Typically the ``INTERFACE_*`` properties are populated on
the interface target using the :command:`set_property`,
:command:`target_link_libraries(INTERFACE)`,
:command:`target_include_directories(INTERFACE)`,
:command:`target_compile_options(INTERFACE)`
and :command:`target_compile_definitions(INTERFACE)` commands, and then it
is used as an argument to :command:`target_link_libraries` like any other
target.
An ``INTERFACE`` :ref:`Imported Target <Imported Targets>` may also be
created with this signature. An ``IMPORTED`` library target references a
library defined outside the project. The target name has scope in the
directory in which it is created and below, but the ``GLOBAL`` option
extends visibility. It may be referenced like any target built within
the project. ``IMPORTED`` libraries are useful for convenient reference
from commands like :command:`target_link_libraries`.

@ -0,0 +1,36 @@
add_subdirectory
----------------
Add a subdirectory to the build.
::
add_subdirectory(source_dir [binary_dir]
[EXCLUDE_FROM_ALL])
Add a subdirectory to the build. The source_dir specifies the
directory in which the source CMakeLists.txt and code files are
located. If it is a relative path it will be evaluated with respect
to the current directory (the typical usage), but it may also be an
absolute path. The binary_dir specifies the directory in which to
place the output files. If it is a relative path it will be evaluated
with respect to the current output directory, but it may also be an
absolute path. If binary_dir is not specified, the value of
source_dir, before expanding any relative path, will be used (the
typical usage). The CMakeLists.txt file in the specified source
directory will be processed immediately by CMake before processing in
the current input file continues beyond this command.
If the EXCLUDE_FROM_ALL argument is provided then targets in the
subdirectory will not be included in the ALL target of the parent
directory by default, and will be excluded from IDE project files.
Users must explicitly build targets in the subdirectory. This is
meant for use when the subdirectory contains a separate part of the
project that is useful but not necessary, such as a set of examples.
Typically the subdirectory should contain its own project() command
invocation so that a full build system will be generated in the
subdirectory (such as a VS IDE solution file). Note that inter-target
dependencies supercede this exclusion. If a target built by the
parent project depends on a target in the subdirectory, the dependee
target will be included in the parent project build system to satisfy
the dependency.

@ -0,0 +1,59 @@
add_test
--------
Add a test to the project to be run by :manual:`ctest(1)`.
::
add_test(NAME <name> COMMAND <command> [<arg>...]
[CONFIGURATIONS <config>...]
[WORKING_DIRECTORY <dir>])
Add a test called ``<name>``. The test name may not contain spaces,
quotes, or other characters special in CMake syntax. The options are:
``COMMAND``
Specify the test command-line. If ``<command>`` specifies an
executable target (created by :command:`add_executable`) it will
automatically be replaced by the location of the executable created
at build time.
``CONFIGURATIONS``
Restrict execution of the test only to the named configurations.
``WORKING_DIRECTORY``
Set the :prop_test:`WORKING_DIRECTORY` test property to
specify the working directory in which to execute the test.
If not specified the test will be run with the current working
directory set to the build directory corresponding to the
current source directory.
The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator
expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
Example usage::
add_test(NAME mytest
COMMAND testDriver --config $<CONFIGURATION>
--exe $<TARGET_FILE:myexe>)
This creates a test ``mytest`` whose command runs a ``testDriver`` tool
passing the configuration name and the full path to the executable
file produced by target ``myexe``.
.. note::
CMake will generate tests only if the :command:`enable_testing`
command has been invoked. The :module:`CTest` module invokes the
command automatically when the ``BUILD_TESTING`` option is ``ON``.
---------------------------------------------------------------------
::
add_test(<name> <command> [<arg>...])
Add a test called ``<name>`` with the given command-line. Unlike
the above ``NAME`` signature no transformation is performed on the
command-line to support target names or generator expressions.

@ -0,0 +1,24 @@
aux_source_directory
--------------------
Find all source files in a directory.
::
aux_source_directory(<dir> <variable>)
Collects the names of all the source files in the specified directory
and stores the list in the <variable> provided. This command is
intended to be used by projects that use explicit template
instantiation. Template instantiation files can be stored in a
"Templates" subdirectory and collected automatically using this
command to avoid manually listing all instantiations.
It is tempting to use this command to avoid writing the list of source
files for a library or executable target. While this seems to work,
there is no way for CMake to generate a build system that knows when a
new source file has been added. Normally the generated build system
knows when it needs to rerun CMake because the CMakeLists.txt file is
modified to add a new source. When the source is just added to the
directory without modifying this file, one would have to manually
rerun CMake to generate a build system incorporating the new file.

@ -0,0 +1,10 @@
break
-----
Break from an enclosing foreach or while loop.
::
break()
Breaks from an enclosing foreach loop or while loop

@ -0,0 +1,44 @@
build_command
-------------
Get a command line to build the current project.
This is mainly intended for internal use by the :module:`CTest` module.
.. code-block:: cmake
build_command(<variable>
[CONFIGURATION <config>]
[TARGET <target>]
[PROJECT_NAME <projname>] # legacy, causes warning
)
Sets the given ``<variable>`` to a command-line string of the form::
<cmake> --build . [--config <config>] [--target <target>] [-- -i]
where ``<cmake>`` is the location of the :manual:`cmake(1)` command-line
tool, and ``<config>`` and ``<target>`` are the values provided to the
``CONFIGURATION`` and ``TARGET`` options, if any. The trailing ``-- -i``
option is added for Makefile generators.
When invoked, this ``cmake --build`` command line will launch the
underlying build system tool.
.. code-block:: cmake
build_command(<cachevariable> <makecommand>)
This second signature is deprecated, but still available for backwards
compatibility. Use the first signature instead.
It sets the given ``<cachevariable>`` to a command-line string as
above but without the ``--config`` or ``--target`` options.
The ``<makecommand>`` is ignored but should be the full path to
msdev, devenv, nmake, make or one of the end user build tools
for legacy invocations.
.. note::
In CMake versions prior to 3.0 this command returned a command
line that directly invokes the native build tool for the current
generator. Their implementation of the ``PROJECT_NAME`` option
had no useful effects, so CMake now warns on use of the option.

@ -0,0 +1,14 @@
build_name
----------
Disallowed. See CMake Policy :policy:`CMP0036`.
Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER} instead.
::
build_name(variable)
Sets the specified variable to a string representing the platform and
compiler settings. These values are now available through the
CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.

@ -0,0 +1,25 @@
cmake_host_system_information
-----------------------------
Query host system specific information.
::
cmake_host_system_information(RESULT <variable> QUERY <key> ...)
Queries system information of the host system on which cmake runs.
One or more <key> can be provided to select the information to be
queried. The list of queried values is stored in <variable>.
<key> can be one of the following values:
::
NUMBER_OF_LOGICAL_CORES = Number of logical cores.
NUMBER_OF_PHYSICAL_CORES = Number of physical cores.
HOSTNAME = Hostname.
FQDN = Fully qualified domain name.
TOTAL_VIRTUAL_MEMORY = Total virtual memory in megabytes.
AVAILABLE_VIRTUAL_MEMORY = Available virtual memory in megabytes.
TOTAL_PHYSICAL_MEMORY = Total physical memory in megabytes.
AVAILABLE_PHYSICAL_MEMORY = Available physical memory in megabytes.

@ -0,0 +1,30 @@
cmake_minimum_required
----------------------
Set the minimum required version of cmake for a project.
::
cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]
[FATAL_ERROR])
If the current version of CMake is lower than that required it will
stop processing the project and report an error. When a version
higher than 2.4 is specified the command implicitly invokes
::
cmake_policy(VERSION major[.minor[.patch[.tweak]]])
which sets the cmake policy version level to the version specified.
When version 2.4 or lower is given the command implicitly invokes
::
cmake_policy(VERSION 2.4)
which enables compatibility features for CMake 2.4 and lower.
The FATAL_ERROR option is accepted but ignored by CMake 2.6 and
higher. It should be specified so CMake versions 2.4 and lower fail
with an error instead of just a warning.

@ -0,0 +1,78 @@
cmake_policy
------------
Manage CMake Policy settings.
As CMake evolves it is sometimes necessary to change existing behavior
in order to fix bugs or improve implementations of existing features.
The CMake Policy mechanism is designed to help keep existing projects
building as new versions of CMake introduce changes in behavior. Each
new policy (behavioral change) is given an identifier of the form
"CMP<NNNN>" where "<NNNN>" is an integer index. Documentation
associated with each policy describes the OLD and NEW behavior and the
reason the policy was introduced. Projects may set each policy to
select the desired behavior. When CMake needs to know which behavior
to use it checks for a setting specified by the project. If no
setting is available the OLD behavior is assumed and a warning is
produced requesting that the policy be set.
The cmake_policy command is used to set policies to OLD or NEW
behavior. While setting policies individually is supported, we
encourage projects to set policies based on CMake versions.
::
cmake_policy(VERSION major.minor[.patch[.tweak]])
Specify that the current CMake list file is written for the given
version of CMake. All policies introduced in the specified version or
earlier will be set to use NEW behavior. All policies introduced
after the specified version will be unset (unless variable
CMAKE_POLICY_DEFAULT_CMP<NNNN> sets a default). This effectively
requests behavior preferred as of a given CMake version and tells
newer CMake versions to warn about their new policies. The policy
version specified must be at least 2.4 or the command will report an
error. In order to get compatibility features supporting versions
earlier than 2.4 see documentation of policy CMP0001.
::
cmake_policy(SET CMP<NNNN> NEW)
cmake_policy(SET CMP<NNNN> OLD)
Tell CMake to use the OLD or NEW behavior for a given policy.
Projects depending on the old behavior of a given policy may silence a
policy warning by setting the policy state to OLD. Alternatively one
may fix the project to work with the new behavior and set the policy
state to NEW.
::
cmake_policy(GET CMP<NNNN> <variable>)
Check whether a given policy is set to OLD or NEW behavior. The
output variable value will be "OLD" or "NEW" if the policy is set, and
empty otherwise.
CMake keeps policy settings on a stack, so changes made by the
cmake_policy command affect only the top of the stack. A new entry on
the policy stack is managed automatically for each subdirectory to
protect its parents and siblings. CMake also manages a new entry for
scripts loaded by include() and find_package() commands except when
invoked with the NO_POLICY_SCOPE option (see also policy CMP0011).
The cmake_policy command provides an interface to manage custom
entries on the policy stack:
::
cmake_policy(PUSH)
cmake_policy(POP)
Each PUSH must have a matching POP to erase any changes. This is
useful to make temporary changes to policy settings.
Functions and macros record policy settings when they are created and
use the pre-record policies when they are invoked. If the function or
macro implementation sets policies, the changes automatically
propagate up through callers until they reach the closest nested
policy stack entry.

@ -0,0 +1,46 @@
configure_file
--------------
Copy a file to another location and modify its contents.
::
configure_file(<input> <output>
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
Copies a file <input> to file <output> and substitutes variable values
referenced in the file content. If <input> is a relative path it is
evaluated with respect to the current source directory. The <input>
must be a file, not a directory. If <output> is a relative path it is
evaluated with respect to the current binary directory. If <output>
names an existing directory the input file is placed in that directory
with its original name.
If the <input> file is modified the build system will re-run CMake to
re-configure the file and generate the build system again.
This command replaces any variables in the input file referenced as
${VAR} or @VAR@ with their values as determined by CMake. If a
variable is not defined, it will be replaced with nothing. If
COPYONLY is specified, then no variable expansion will take place. If
ESCAPE_QUOTES is specified then any substituted quotes will be C-style
escaped. The file will be configured with the current values of CMake
variables. If @ONLY is specified, only variables of the form @VAR@
will be replaced and ${VAR} will be ignored. This is useful for
configuring scripts that use ${VAR}.
Input file lines of the form "#cmakedefine VAR ..." will be replaced
with either "#define VAR ..." or ``/* #undef VAR */`` depending on
whether VAR is set in CMake to any value not considered a false
constant by the if() command. (Content of "...", if any, is processed
as above.) Input file lines of the form "#cmakedefine01 VAR" will be
replaced with either "#define VAR 1" or "#define VAR 0" similarly.
With NEWLINE_STYLE the line ending could be adjusted:
::
'UNIX' or 'LF' for \n, 'DOS', 'WIN32' or 'CRLF' for \r\n.
COPYONLY must not be used with NEWLINE_STYLE.

@ -0,0 +1,30 @@
create_test_sourcelist
----------------------
Create a test driver and source list for building test programs.
::
create_test_sourcelist(sourceListName driverName
test1 test2 test3
EXTRA_INCLUDE include.h
FUNCTION function)
A test driver is a program that links together many small tests into a
single executable. This is useful when building static executables
with large libraries to shrink the total required size. The list of
source files needed to build the test driver will be in
sourceListName. DriverName is the name of the test driver program.
The rest of the arguments consist of a list of test source files, can
be semicolon separated. Each test source file should have a function
in it that is the same name as the file with no extension (foo.cxx
should have int foo(int, char*[]);) DriverName will be able to call
each of the tests by name on the command line. If EXTRA_INCLUDE is
specified, then the next argument is included into the generated file.
If FUNCTION is specified, then the next argument is taken as a
function name that is passed a pointer to ac and av. This can be used
to add extra command line processing to each test. The cmake variable
CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be
placed directly before calling the test main function.
CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be
placed directly after the call to the test main function.

@ -0,0 +1,24 @@
ctest_build
-----------
Build the project.
::
ctest_build([BUILD build_dir] [TARGET target] [RETURN_VALUE res]
[APPEND][NUMBER_ERRORS val] [NUMBER_WARNINGS val])
Builds the given build directory and stores results in Build.xml. If
no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used.
The TARGET variable can be used to specify a build target. If none is
specified, the "all" target will be built.
The RETURN_VALUE option specifies a variable in which to store the
return value of the native build tool. The NUMBER_ERRORS and
NUMBER_WARNINGS options specify variables in which to store the number
of build errors and warnings detected.
The APPEND option marks results for append to those previously
submitted to a dashboard server since the last ctest_start. Append
semantics are defined by the dashboard server in use.

@ -0,0 +1,21 @@
ctest_configure
---------------
Configure the project build tree.
::
ctest_configure([BUILD build_dir] [SOURCE source_dir] [APPEND]
[OPTIONS options] [RETURN_VALUE res])
Configures the given build directory and stores results in
Configure.xml. If no BUILD is given, the CTEST_BINARY_DIRECTORY
variable is used. If no SOURCE is given, the CTEST_SOURCE_DIRECTORY
variable is used. The OPTIONS argument specifies command line
arguments to pass to the configuration tool. The RETURN_VALUE option
specifies a variable in which to store the return value of the native
build tool.
The APPEND option marks results for append to those previously
submitted to a dashboard server since the last ctest_start. Append
semantics are defined by the dashboard server in use.

@ -0,0 +1,20 @@
ctest_coverage
--------------
Collect coverage tool results.
::
ctest_coverage([BUILD build_dir] [RETURN_VALUE res] [APPEND]
[LABELS label1 [label2 [...]]])
Perform the coverage of the given build directory and stores results
in Coverage.xml. The second argument is a variable that will hold
value.
The LABELS option filters the coverage report to include only source
files labeled with at least one of the labels specified.
The APPEND option marks results for append to those previously
submitted to a dashboard server since the last ctest_start. Append
semantics are defined by the dashboard server in use.

@ -0,0 +1,12 @@
ctest_empty_binary_directory
----------------------------
empties the binary directory
::
ctest_empty_binary_directory( directory )
Removes a binary directory. This command will perform some checks
prior to deleting the directory in an attempt to avoid malicious or
accidental directory deletion.

@ -0,0 +1,28 @@
ctest_memcheck
--------------
Run tests with a dynamic analysis tool.
::
ctest_memcheck([BUILD build_dir] [RETURN_VALUE res] [APPEND]
[START start number] [END end number]
[STRIDE stride number] [EXCLUDE exclude regex ]
[INCLUDE include regex]
[EXCLUDE_LABEL exclude regex]
[INCLUDE_LABEL label regex]
[PARALLEL_LEVEL level] )
Tests the given build directory and stores results in MemCheck.xml.
The second argument is a variable that will hold value. Optionally,
you can specify the starting test number START, the ending test number
END, the number of tests to skip between each test STRIDE, a regular
expression for tests to run INCLUDE, or a regular expression for tests
not to run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular
expressions for tests to be included or excluded by the test property
LABEL. PARALLEL_LEVEL should be set to a positive number representing
the number of tests to be run in parallel.
The APPEND option marks results for append to those previously
submitted to a dashboard server since the last ctest_start. Append
semantics are defined by the dashboard server in use.

@ -0,0 +1,11 @@
ctest_read_custom_files
-----------------------
read CTestCustom files.
::
ctest_read_custom_files( directory ... )
Read all the CTestCustom.ctest or CTestCustom.cmake files from the
given directory.

@ -0,0 +1,15 @@
ctest_run_script
----------------
runs a ctest -S script
::
ctest_run_script([NEW_PROCESS] script_file_name script_file_name1
script_file_name2 ... [RETURN_VALUE var])
Runs a script or scripts much like if it was run from ctest -S. If no
argument is provided then the current script is run using the current
settings of the variables. If NEW_PROCESS is specified then each
script will be run in a separate process.If RETURN_VALUE is specified
the return value of the last script run will be put into var.

@ -0,0 +1,16 @@
ctest_sleep
-----------
sleeps for some amount of time
::
ctest_sleep(<seconds>)
Sleep for given number of seconds.
::
ctest_sleep(<time1> <duration> <time2>)
Sleep for t=(time1 + duration - time2) seconds if t > 0.

@ -0,0 +1,16 @@
ctest_start
-----------
Starts the testing for a given model
::
ctest_start(Model [TRACK <track>] [APPEND] [source [binary]])
Starts the testing for a given model. The command should be called
after the binary directory is initialized. If the 'source' and
'binary' directory are not specified, it reads the
CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY. If the track is
specified, the submissions will go to the specified track. If APPEND
is used, the existing TAG is used rather than creating a new one based
on the current time stamp.

@ -0,0 +1,35 @@
ctest_submit
------------
Submit results to a dashboard server.
::
ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] [RETRY_DELAY delay][RETURN_VALUE res])
By default all available parts are submitted if no PARTS or FILES are
specified. The PARTS option lists a subset of parts to be submitted.
Valid part names are:
::
Start = nothing
Update = ctest_update results, in Update.xml
Configure = ctest_configure results, in Configure.xml
Build = ctest_build results, in Build.xml
Test = ctest_test results, in Test.xml
Coverage = ctest_coverage results, in Coverage.xml
MemCheck = ctest_memcheck results, in DynamicAnalysis.xml
Notes = Files listed by CTEST_NOTES_FILES, in Notes.xml
ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES
Upload = Files prepared for upload by ctest_upload(), in Upload.xml
Submit = nothing
The FILES option explicitly lists specific files to be submitted.
Each individual file must exist at the time of the call.
The RETRY_DELAY option specifies how long in seconds to wait after a
timed-out submission before attempting to re-submit.
The RETRY_COUNT option specifies how many times to retry a timed-out
submission.

@ -0,0 +1,33 @@
ctest_test
----------
Run tests in the project build tree.
::
ctest_test([BUILD build_dir] [APPEND]
[START start number] [END end number]
[STRIDE stride number] [EXCLUDE exclude regex ]
[INCLUDE include regex] [RETURN_VALUE res]
[EXCLUDE_LABEL exclude regex]
[INCLUDE_LABEL label regex]
[PARALLEL_LEVEL level]
[SCHEDULE_RANDOM on]
[STOP_TIME time of day])
Tests the given build directory and stores results in Test.xml. The
second argument is a variable that will hold value. Optionally, you
can specify the starting test number START, the ending test number
END, the number of tests to skip between each test STRIDE, a regular
expression for tests to run INCLUDE, or a regular expression for tests
to not run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular
expression for test to be included or excluded by the test property
LABEL. PARALLEL_LEVEL should be set to a positive number representing
the number of tests to be run in parallel. SCHEDULE_RANDOM will
launch tests in a random order, and is typically used to detect
implicit test dependencies. STOP_TIME is the time of day at which the
tests should all stop running.
The APPEND option marks results for append to those previously
submitted to a dashboard server since the last ctest_start. Append
semantics are defined by the dashboard server in use.

@ -0,0 +1,13 @@
ctest_update
------------
Update the work tree from version control.
::
ctest_update([SOURCE source] [RETURN_VALUE res])
Updates the given source directory and stores results in Update.xml.
If no SOURCE is given, the CTEST_SOURCE_DIRECTORY variable is used.
The RETURN_VALUE option specifies a variable in which to store the
result, which is the number of files updated or -1 on error.

@ -0,0 +1,11 @@
ctest_upload
------------
Upload files to a dashboard server.
::
ctest_upload(FILES ...)
Pass a list of files to be sent along with the build results to the
dashboard server.

@ -0,0 +1,45 @@
define_property
---------------
Define and document custom properties.
::
define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
TEST | VARIABLE | CACHED_VARIABLE>
PROPERTY <name> [INHERITED]
BRIEF_DOCS <brief-doc> [docs...]
FULL_DOCS <full-doc> [docs...])
Define one property in a scope for use with the set_property and
get_property commands. This is primarily useful to associate
documentation with property names that may be retrieved with the
get_property command. The first argument determines the kind of scope
in which the property should be used. It must be one of the
following:
::
GLOBAL = associated with the global namespace
DIRECTORY = associated with one directory
TARGET = associated with one target
SOURCE = associated with one source file
TEST = associated with a test named with add_test
VARIABLE = documents a CMake language variable
CACHED_VARIABLE = documents a CMake cache variable
Note that unlike set_property and get_property no actual scope needs
to be given; only the kind of scope is important.
The required PROPERTY option is immediately followed by the name of
the property being defined.
If the INHERITED option then the get_property command will chain up to
the next higher scope when the requested property is not set in the
scope given to the command. DIRECTORY scope chains to GLOBAL.
TARGET, SOURCE, and TEST chain to DIRECTORY.
The BRIEF_DOCS and FULL_DOCS options are followed by strings to be
associated with the property as its brief and full documentation.
Corresponding options to the get_property command will retrieve the
documentation.

@ -0,0 +1,10 @@
else
----
Starts the else portion of an if block.
::
else(expression)
See the if command.

@ -0,0 +1,10 @@
elseif
------
Starts the elseif portion of an if block.
::
elseif(expression)
See the if command.

@ -0,0 +1,22 @@
enable_language
---------------
Enable a language (CXX/C/Fortran/etc)
::
enable_language(<lang> [OPTIONAL] )
This command enables support for the named language in CMake. This is
the same as the project command but does not create any of the extra
variables that are created by the project command. Example languages
are CXX, C, Fortran.
This command must be called in file scope, not in a function call.
Furthermore, it must be called in the highest directory common to all
targets using the named language directly for compiling sources or
indirectly through link dependencies. It is simplest to enable all
needed languages in the top-level directory of a project.
The OPTIONAL keyword is a placeholder for future implementation and
does not currently work.

@ -0,0 +1,13 @@
enable_testing
--------------
Enable testing for current directory and below.
::
enable_testing()
Enables testing for this directory and below. See also the add_test
command. Note that ctest expects to find a test file in the build
directory root. Therefore, this command should be in the source
directory root.

@ -0,0 +1,10 @@
endforeach
----------
Ends a list of commands in a FOREACH block.
::
endforeach(expression)
See the FOREACH command.

@ -0,0 +1,10 @@
endfunction
-----------
Ends a list of commands in a function block.
::
endfunction(expression)
See the function command.

@ -0,0 +1,10 @@
endif
-----
Ends a list of commands in an if block.
::
endif(expression)
See the if command.

@ -0,0 +1,10 @@
endmacro
--------
Ends a list of commands in a macro block.
::
endmacro(expression)
See the macro command.

@ -0,0 +1,10 @@
endwhile
--------
Ends a list of commands in a while block.
::
endwhile(expression)
See the while command.

@ -0,0 +1,24 @@
exec_program
------------
Deprecated. Use the execute_process() command instead.
Run an executable program during the processing of the CMakeList.txt
file.
::
exec_program(Executable [directory in which to run]
[ARGS <arguments to executable>]
[OUTPUT_VARIABLE <var>]
[RETURN_VALUE <var>])
The executable is run in the optionally specified directory. The
executable can include arguments if it is double quoted, but it is
better to use the optional ARGS argument to specify arguments to the
program. This is because cmake will then be able to escape spaces in
the executable path. An optional argument OUTPUT_VARIABLE specifies a
variable in which to store the output. To capture the return value of
the execution, provide a RETURN_VALUE. If OUTPUT_VARIABLE is
specified, then no output will go to the stdout/stderr of the console
running cmake.

@ -0,0 +1,75 @@
execute_process
---------------
Execute one or more child processes.
.. code-block:: cmake
execute_process(COMMAND <cmd1> [args1...]]
[COMMAND <cmd2> [args2...] [...]]
[WORKING_DIRECTORY <directory>]
[TIMEOUT <seconds>]
[RESULT_VARIABLE <variable>]
[OUTPUT_VARIABLE <variable>]
[ERROR_VARIABLE <variable>]
[INPUT_FILE <file>]
[OUTPUT_FILE <file>]
[ERROR_FILE <file>]
[OUTPUT_QUIET]
[ERROR_QUIET]
[OUTPUT_STRIP_TRAILING_WHITESPACE]
[ERROR_STRIP_TRAILING_WHITESPACE])
Runs the given sequence of one or more commands with the standard
output of each process piped to the standard input of the next.
A single standard error pipe is used for all processes.
Options:
COMMAND
A child process command line.
CMake executes the child process using operating system APIs directly.
All arguments are passed VERBATIM to the child process.
No intermediate shell is used, so shell operators such as ``>``
are treated as normal arguments.
(Use the ``INPUT_*``, ``OUTPUT_*``, and ``ERROR_*`` options to
redirect stdin, stdout, and stderr.)
WORKING_DIRECTORY
The named directory will be set as the current working directory of
the child processes.
TIMEOUT
The child processes will be terminated if they do not finish in the
specified number of seconds (fractions are allowed).
RESULT_VARIABLE
The variable will be set to contain the result of running the processes.
This will be an integer return code from the last child or a string
describing an error condition.
OUTPUT_VARIABLE, ERROR_VARIABLE
The variable named will be set with the contents of the standard output
and standard error pipes, respectively. If the same variable is named
for both pipes their output will be merged in the order produced.
INPUT_FILE, OUTPUT_FILE, ERROR_FILE
The file named will be attached to the standard input of the first
process, standard output of the last process, or standard error of
all processes, respectively.
OUTPUT_QUIET, ERROR_QUIET
The standard output or standard error results will be quietly ignored.
If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the
same pipe the precedence is not specified.
If no ``OUTPUT_*`` or ``ERROR_*`` options are given the output will
be shared with the corresponding pipes of the CMake process itself.
The :command:`execute_process` command is a newer more powerful version of
:command:`exec_program`, but the old command has been kept for compatibility.
Both commands run while CMake is processing the project prior to build
system generation. Use :command:`add_custom_target` and
:command:`add_custom_command` to create custom commands that run at
build time.

@ -0,0 +1,54 @@
export
------
Export targets from the build tree for use by outside projects.
::
export(EXPORT <export-name> [NAMESPACE <namespace>] [FILE <filename>])
Create a file <filename> that may be included by outside projects to
import targets from the current project's build tree. This is useful
during cross-compiling to build utility executables that can run on
the host platform in one project and then import them into another
project being compiled for the target platform. If the NAMESPACE
option is given the <namespace> string will be prepended to all target
names written to the file.
Target installations are associated with the export <export-name>
using the ``EXPORT`` option of the :command:`install(TARGETS)` command.
The file created by this command is specific to the build tree and
should never be installed. See the install(EXPORT) command to export
targets from an installation tree.
The properties set on the generated IMPORTED targets will have the
same values as the final values of the input TARGETS.
::
export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]
[APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])
This signature is similar to the ``EXPORT`` signature, but targets are listed
explicitly rather than specified as an export-name. If the APPEND option is
given the generated code will be appended to the file instead of overwriting it.
The EXPORT_LINK_INTERFACE_LIBRARIES keyword, if present, causes the
contents of the properties matching
``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?`` to be exported, when
policy CMP0022 is NEW. If a library target is included in the export
but a target to which it links is not included the behavior is
unspecified.
::
export(PACKAGE <name>)
Store the current build directory in the CMake user package registry
for package <name>. The find_package command may consider the
directory while searching for package <name>. This helps dependent
projects find and use a package from the current project's build tree
without help from the user. Note that the entry in the package
registry that this command creates works only in conjunction with a
package configuration file (<name>Config.cmake) that works with the
build tree.

@ -0,0 +1,28 @@
export_library_dependencies
---------------------------
Disallowed. See CMake Policy :policy:`CMP0033`.
Use :command:`install(EXPORT)` or :command:`export` command.
This command generates an old-style library dependencies file.
Projects requiring CMake 2.6 or later should not use the command. Use
instead the install(EXPORT) command to help export targets from an
installation tree and the export() command to export targets from a
build tree.
The old-style library dependencies file does not take into account
per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES
target property.
::
export_library_dependencies(<file> [APPEND])
Create a file named <file> that can be included into a CMake listfile
with the INCLUDE command. The file will contain a number of SET
commands that will set all the variables needed for library dependency
information. This should be the last command in the top level
CMakeLists.txt file of the project. If the APPEND option is
specified, the SET commands will be appended to the given file instead
of replacing it.

@ -0,0 +1,213 @@
file
----
File manipulation command.
::
file(WRITE filename "message to write"... )
file(APPEND filename "message to write"... )
file(READ filename variable [LIMIT numBytes] [OFFSET offset] [HEX])
file(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512> filename variable)
file(STRINGS filename variable [LIMIT_COUNT num]
[LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes]
[LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]
[NEWLINE_CONSUME] [REGEX regex]
[NO_HEX_CONVERSION])
file(GLOB variable [RELATIVE path] [globbing expressions]...)
file(GLOB_RECURSE variable [RELATIVE path]
[FOLLOW_SYMLINKS] [globbing expressions]...)
file(RENAME <oldname> <newname>)
file(REMOVE [file1 ...])
file(REMOVE_RECURSE [file1 ...])
file(MAKE_DIRECTORY [directory1 directory2 ...])
file(RELATIVE_PATH variable directory file)
file(TO_CMAKE_PATH path result)
file(TO_NATIVE_PATH path result)
file(DOWNLOAD url file [INACTIVITY_TIMEOUT timeout]
[TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS]
[EXPECTED_HASH ALGO=value] [EXPECTED_MD5 sum]
[TLS_VERIFY on|off] [TLS_CAINFO file])
file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]
[TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])
file(TIMESTAMP filename variable [<format string>] [UTC])
file(GENERATE OUTPUT output_file
<INPUT input_file|CONTENT input_content>
[CONDITION expression])
WRITE will write a message into a file called 'filename'. It
overwrites the file if it already exists, and creates the file if it
does not exist. (If the file is a build input, use configure_file to
update the file only when its content changes.)
APPEND will write a message into a file same as WRITE, except it will
append it to the end of the file
READ will read the content of a file and store it into the variable.
It will start at the given offset and read up to numBytes. If the
argument HEX is given, the binary data will be converted to
hexadecimal representation and this will be stored in the variable.
MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a
cryptographic hash of the content of a file.
STRINGS will parse a list of ASCII strings from a file and store it in
a variable. Binary data in the file are ignored. Carriage return
(CR) characters are ignored. It works also for Intel Hex and Motorola
S-record files, which are automatically converted to binary format
when reading them. Disable this using NO_HEX_CONVERSION.
LIMIT_COUNT sets the maximum number of strings to return. LIMIT_INPUT
sets the maximum number of bytes to read from the input file.
LIMIT_OUTPUT sets the maximum number of bytes to store in the output
variable. LENGTH_MINIMUM sets the minimum length of a string to
return. Shorter strings are ignored. LENGTH_MAXIMUM sets the maximum
length of a string to return. Longer strings are split into strings
no longer than the maximum length. NEWLINE_CONSUME allows newlines to
be included in strings instead of terminating them.
REGEX specifies a regular expression that a string must match to be
returned. Typical usage
::
file(STRINGS myfile.txt myfile)
stores a list in the variable "myfile" in which each item is a line
from the input file.
GLOB will generate a list of all files that match the globbing
expressions and store it into the variable. Globbing expressions are
similar to regular expressions, but much simpler. If RELATIVE flag is
specified for an expression, the results will be returned as a
relative path to the given path. (We do not recommend using GLOB to
collect a list of source files from your source tree. If no
CMakeLists.txt file changes when a source is added or removed then the
generated build system cannot know when to ask CMake to regenerate.)
Examples of globbing expressions include:
::
*.cxx - match all files with extension cxx
*.vt? - match all files with extension vta,...,vtz
f[3-5].txt - match files f3.txt, f4.txt, f5.txt
GLOB_RECURSE will generate a list similar to the regular GLOB, except
it will traverse all the subdirectories of the matched directory and
match the files. Subdirectories that are symlinks are only traversed
if FOLLOW_SYMLINKS is given or cmake policy CMP0009 is not set to NEW.
See cmake --help-policy CMP0009 for more information.
Examples of recursive globbing include:
::
/dir/*.py - match all python files in /dir and subdirectories
MAKE_DIRECTORY will create the given directories, also if their parent
directories don't exist yet
RENAME moves a file or directory within a filesystem, replacing the
destination atomically.
REMOVE will remove the given files, also in subdirectories
REMOVE_RECURSE will remove the given files and directories, also
non-empty directories
RELATIVE_PATH will determine relative path from directory to the given
file.
TO_CMAKE_PATH will convert path into a cmake style path with unix /.
The input can be a single path or a system path like "$ENV{PATH}".
Note the double quotes around the ENV call TO_CMAKE_PATH only takes
one argument. This command will also convert the native list
delimiters for a list of paths like the PATH environment variable.
TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert from a
cmake style path into the native path style \ for windows and / for
UNIX.
DOWNLOAD will download the given URL to the given file. If LOG var is
specified a log of the download will be put in var. If STATUS var is
specified the status of the operation will be put in var. The status
is returned in a list of length 2. The first element is the numeric
return value for the operation, and the second element is a string
value for the error. A 0 numeric error means no error in the
operation. If TIMEOUT time is specified, the operation will timeout
after time seconds, time should be specified as an integer. The
INACTIVITY_TIMEOUT specifies an integer number of seconds of
inactivity after which the operation should terminate. If
EXPECTED_HASH ALGO=value is specified, the operation will verify that
the downloaded file's actual hash matches the expected value, where
ALGO is one of MD5, SHA1, SHA224, SHA256, SHA384, or SHA512. If it
does not match, the operation fails with an error. ("EXPECTED_MD5
sum" is short-hand for "EXPECTED_HASH MD5=sum".) If SHOW_PROGRESS is
specified, progress information will be printed as status messages
until the operation is complete. For https URLs CMake must be built
with OpenSSL. TLS/SSL certificates are not checked by default. Set
TLS_VERIFY to ON to check certificates and/or use EXPECTED_HASH to
verify downloaded content. Set TLS_CAINFO to specify a custom
Certificate Authority file. If either TLS option is not given CMake
will check variables CMAKE_TLS_VERIFY and CMAKE_TLS_CAINFO,
respectively.
UPLOAD will upload the given file to the given URL. If LOG var is
specified a log of the upload will be put in var. If STATUS var is
specified the status of the operation will be put in var. The status
is returned in a list of length 2. The first element is the numeric
return value for the operation, and the second element is a string
value for the error. A 0 numeric error means no error in the
operation. If TIMEOUT time is specified, the operation will timeout
after time seconds, time should be specified as an integer. The
INACTIVITY_TIMEOUT specifies an integer number of seconds of
inactivity after which the operation should terminate. If
SHOW_PROGRESS is specified, progress information will be printed as
status messages until the operation is complete.
TIMESTAMP will write a string representation of the modification time
of filename to variable.
Should the command be unable to obtain a timestamp variable will be
set to the empty string "".
See documentation of the string TIMESTAMP sub-command for more
details.
The file() command also provides COPY and INSTALL signatures:
::
file(<COPY|INSTALL> files... DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
[FILES_MATCHING]
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
The COPY signature copies files, directories, and symlinks to a
destination folder. Relative input paths are evaluated with respect
to the current source directory, and a relative destination is
evaluated with respect to the current build directory. Copying
preserves input file timestamps, and optimizes out a file if it exists
at the destination with the same timestamp. Copying preserves input
permissions unless explicit permissions or NO_SOURCE_PERMISSIONS are
given (default is USE_SOURCE_PERMISSIONS). See the install(DIRECTORY)
command for documentation of permissions, PATTERN, REGEX, and EXCLUDE
options.
The INSTALL signature differs slightly from COPY: it prints status
messages, and NO_SOURCE_PERMISSIONS is default. Installation scripts
generated by the install() command use this signature (with some
undocumented options for internal use).
GENERATE will write an <output_file> with content from an
<input_file>, or from <input_content>. The output is generated
conditionally based on the content of the <condition>. The file is
written at CMake generate-time and the input may contain generator
expressions. The <condition>, <output_file> and <input_file> may also
contain generator expressions. The <condition> must evaluate to
either '0' or '1'. The <output_file> must evaluate to a unique name
among all configurations and among all invocations of file(GENERATE).

@ -0,0 +1,27 @@
find_file
---------
.. |FIND_XXX| replace:: find_file
.. |NAMES| replace:: NAMES name1 [name2 ...]
.. |SEARCH_XXX| replace:: full path to a file
.. |SEARCH_XXX_DESC| replace:: full path to named file
.. |XXX_SUBDIR| replace:: include
.. |CMAKE_PREFIX_PATH_XXX| replace::
<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
|CMAKE_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_XXX_PATH| replace:: CMAKE_INCLUDE_PATH
.. |CMAKE_XXX_MAC_PATH| replace:: CMAKE_FRAMEWORK_PATH
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: PATH and INCLUDE
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
|CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_SYSTEM_XXX_PATH| replace:: CMAKE_SYSTEM_INCLUDE_PATH
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
:variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
.. include:: FIND_XXX.txt

@ -0,0 +1,44 @@
find_library
------------
.. |FIND_XXX| replace:: find_library
.. |NAMES| replace:: NAMES name1 [name2 ...] [NAMES_PER_DIR]
.. |SEARCH_XXX| replace:: library
.. |SEARCH_XXX_DESC| replace:: library
.. |XXX_SUBDIR| replace:: lib
.. |CMAKE_PREFIX_PATH_XXX| replace::
<prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
|CMAKE_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_XXX_PATH| replace:: CMAKE_LIBRARY_PATH
.. |CMAKE_XXX_MAC_PATH| replace:: CMAKE_FRAMEWORK_PATH
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: PATH and LIB
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
<prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
|CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_SYSTEM_XXX_PATH| replace:: CMAKE_SYSTEM_LIBRARY_PATH
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
:variable:`CMAKE_FIND_ROOT_PATH_MODE_LIBRARY`
.. include:: FIND_XXX.txt
When more than one value is given to the NAMES option this command by
default will consider one name at a time and search every directory
for it. The NAMES_PER_DIR option tells this command to consider one
directory at a time and search for all names in it.
If the library found is a framework, then VAR will be set to the full
path to the framework <fullPath>/A.framework. When a full path to a
framework is used as a library, CMake will use a -framework A, and a
-F<fullPath> to link the framework to the target.
If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all search
paths will be tested as normal, with "64/" appended, and with all
matches of "lib/" replaced with "lib64/". This property is
automatically set for the platforms that are known to need it if at
least one of the languages supported by the PROJECT command is
enabled.

@ -0,0 +1,345 @@
find_package
------------
Load settings for an external project.
::
find_package(<package> [version] [EXACT] [QUIET] [MODULE]
[REQUIRED] [[COMPONENTS] [components...]]
[OPTIONAL_COMPONENTS components...]
[NO_POLICY_SCOPE])
Finds and loads settings from an external project. ``<package>_FOUND``
will be set to indicate whether the package was found. When the
package is found package-specific information is provided through
variables and :ref:`Imported Targets` documented by the package itself. The
``QUIET`` option disables messages if the package cannot be found. The
``MODULE`` option disables the second signature documented below. The
``REQUIRED`` option stops processing with an error message if the package
cannot be found.
A package-specific list of required components may be listed after the
``COMPONENTS`` option (or after the ``REQUIRED`` option if present).
Additional optional components may be listed after
``OPTIONAL_COMPONENTS``. Available components and their influence on
whether a package is considered to be found are defined by the target
package.
The ``[version]`` argument requests a version with which the package found
should be compatible (format is ``major[.minor[.patch[.tweak]]]``). The
``EXACT`` option requests that the version be matched exactly. If no
``[version]`` and/or component list is given to a recursive invocation
inside a find-module, the corresponding arguments are forwarded
automatically from the outer call (including the ``EXACT`` flag for
``[version]``). Version support is currently provided only on a
package-by-package basis (details below).
User code should generally look for packages using the above simple
signature. The remainder of this command documentation specifies the
full command signature and details of the search process. Project
maintainers wishing to provide a package to be found by this command
are encouraged to read on.
The command has two modes by which it searches for packages: "Module"
mode and "Config" mode. Module mode is available when the command is
invoked with the above reduced signature. CMake searches for a file
called ``Find<package>.cmake`` in the :variable:`CMAKE_MODULE_PATH`
followed by the CMake installation. If the file is found, it is read
and processed by CMake. It is responsible for finding the package,
checking the version, and producing any needed messages. Many
find-modules provide limited or no support for versioning; check
the module documentation. If no module is found and the ``MODULE``
option is not given the command proceeds to Config mode.
The complete Config mode command signature is::
find_package(<package> [version] [EXACT] [QUIET]
[REQUIRED] [[COMPONENTS] [components...]]
[CONFIG|NO_MODULE]
[NO_POLICY_SCOPE]
[NAMES name1 [name2 ...]]
[CONFIGS config1 [config2 ...]]
[HINTS path1 [path2 ... ]]
[PATHS path1 [path2 ... ]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_PACKAGE_REGISTRY]
[NO_CMAKE_BUILDS_PATH]
[NO_CMAKE_SYSTEM_PATH]
[NO_CMAKE_SYSTEM_PACKAGE_REGISTRY]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH])
The ``CONFIG`` option may be used to skip Module mode explicitly and
switch to Config mode. It is synonymous to using ``NO_MODULE``. Config
mode is also implied by use of options not specified in the reduced
signature.
Config mode attempts to locate a configuration file provided by the
package to be found. A cache entry called ``<package>_DIR`` is created to
hold the directory containing the file. By default the command
searches for a package with the name ``<package>``. If the ``NAMES`` option
is given the names following it are used instead of ``<package>``. The
command searches for a file called ``<name>Config.cmake`` or
``<lower-case-name>-config.cmake`` for each name specified. A
replacement set of possible configuration file names may be given
using the ``CONFIGS`` option. The search procedure is specified below.
Once found, the configuration file is read and processed by CMake.
Since the file is provided by the package it already knows the
location of package contents. The full path to the configuration file
is stored in the cmake variable ``<package>_CONFIG``.
All configuration files which have been considered by CMake while
searching for an installation of the package with an appropriate
version are stored in the cmake variable ``<package>_CONSIDERED_CONFIGS``,
the associated versions in ``<package>_CONSIDERED_VERSIONS``.
If the package configuration file cannot be found CMake will generate
an error describing the problem unless the ``QUIET`` argument is
specified. If ``REQUIRED`` is specified and the package is not found a
fatal error is generated and the configure step stops executing. If
``<package>_DIR`` has been set to a directory not containing a
configuration file CMake will ignore it and search from scratch.
When the ``[version]`` argument is given Config mode will only find a
version of the package that claims compatibility with the requested
version (format is ``major[.minor[.patch[.tweak]]]``). If the ``EXACT``
option is given only a version of the package claiming an exact match
of the requested version may be found. CMake does not establish any
convention for the meaning of version numbers. Package version
numbers are checked by "version" files provided by the packages
themselves. For a candidate package configuration file
``<config-file>.cmake`` the corresponding version file is located next
to it and named either ``<config-file>-version.cmake`` or
``<config-file>Version.cmake``. If no such version file is available
then the configuration file is assumed to not be compatible with any
requested version. A basic version file containing generic version
matching code can be created using the
:module:`CMakePackageConfigHelpers` module. When a version file
is found it is loaded to check the requested version number. The
version file is loaded in a nested scope in which the following
variables have been defined:
``PACKAGE_FIND_NAME``
the ``<package>`` name
``PACKAGE_FIND_VERSION``
full requested version string
``PACKAGE_FIND_VERSION_MAJOR``
major version if requested, else 0
``PACKAGE_FIND_VERSION_MINOR``
minor version if requested, else 0
``PACKAGE_FIND_VERSION_PATCH``
patch version if requested, else 0
``PACKAGE_FIND_VERSION_TWEAK``
tweak version if requested, else 0
``PACKAGE_FIND_VERSION_COUNT``
number of version components, 0 to 4
The version file checks whether it satisfies the requested version and
sets these variables:
``PACKAGE_VERSION``
full provided version string
``PACKAGE_VERSION_EXACT``
true if version is exact match
``PACKAGE_VERSION_COMPATIBLE``
true if version is compatible
``PACKAGE_VERSION_UNSUITABLE``
true if unsuitable as any version
These variables are checked by the ``find_package`` command to determine
whether the configuration file provides an acceptable version. They
are not available after the find_package call returns. If the version
is acceptable the following variables are set:
``<package>_VERSION``
full provided version string
``<package>_VERSION_MAJOR``
major version if provided, else 0
``<package>_VERSION_MINOR``
minor version if provided, else 0
``<package>_VERSION_PATCH``
patch version if provided, else 0
``<package>_VERSION_TWEAK``
tweak version if provided, else 0
``<package>_VERSION_COUNT``
number of version components, 0 to 4
and the corresponding package configuration file is loaded. When
multiple package configuration files are available whose version files
claim compatibility with the version requested it is unspecified which
one is chosen. No attempt is made to choose a highest or closest
version number.
Config mode provides an elaborate interface and search procedure.
Much of the interface is provided for completeness and for use
internally by find-modules loaded by Module mode. Most user code
should simply call::
find_package(<package> [major[.minor]] [EXACT] [REQUIRED|QUIET])
in order to find a package. Package maintainers providing CMake
package configuration files are encouraged to name and install them
such that the procedure outlined below will find them without
requiring use of additional options.
CMake constructs a set of possible installation prefixes for the
package. Under each prefix several directories are searched for a
configuration file. The tables below show the directories searched.
Each entry is meant for installation trees following Windows (W), UNIX
(U), or Apple (A) conventions::
<prefix>/ (W)
<prefix>/(cmake|CMake)/ (W)
<prefix>/<name>*/ (W)
<prefix>/<name>*/(cmake|CMake)/ (W)
<prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/ (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/ (U)
On systems supporting OS X Frameworks and Application Bundles the
following directories are searched for frameworks or bundles
containing a configuration file::
<prefix>/<name>.framework/Resources/ (A)
<prefix>/<name>.framework/Resources/CMake/ (A)
<prefix>/<name>.framework/Versions/*/Resources/ (A)
<prefix>/<name>.framework/Versions/*/Resources/CMake/ (A)
<prefix>/<name>.app/Contents/Resources/ (A)
<prefix>/<name>.app/Contents/Resources/CMake/ (A)
In all cases the ``<name>`` is treated as case-insensitive and corresponds
to any of the names specified (``<package>`` or names given by ``NAMES``).
Paths with ``lib/<arch>`` are enabled if the
:variable:`CMAKE_LIBRARY_ARCHITECTURE` variable is set. If ``PATH_SUFFIXES``
is specified the suffixes are appended to each (W) or (U) directory entry
one-by-one.
This set of directories is intended to work in cooperation with
projects that provide configuration files in their installation trees.
Directories above marked with (W) are intended for installations on
Windows where the prefix may point at the top of an application's
installation directory. Those marked with (U) are intended for
installations on UNIX platforms where the prefix is shared by multiple
packages. This is merely a convention, so all (W) and (U) directories
are still searched on all platforms. Directories marked with (A) are
intended for installations on Apple platforms. The cmake variables
``CMAKE_FIND_FRAMEWORK`` and ``CMAKE_FIND_APPBUNDLE``
determine the order of preference as specified below.
The set of installation prefixes is constructed using the following
steps. If ``NO_DEFAULT_PATH`` is specified all ``NO_*`` options are
enabled.
1. Search paths specified in cmake-specific cache variables. These
are intended to be used on the command line with a ``-DVAR=value``.
This can be skipped if ``NO_CMAKE_PATH`` is passed::
CMAKE_PREFIX_PATH
CMAKE_FRAMEWORK_PATH
CMAKE_APPBUNDLE_PATH
2. Search paths specified in cmake-specific environment variables.
These are intended to be set in the user's shell configuration.
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed::
<package>_DIR
CMAKE_PREFIX_PATH
CMAKE_FRAMEWORK_PATH
CMAKE_APPBUNDLE_PATH
3. Search paths specified by the ``HINTS`` option. These should be paths
computed by system introspection, such as a hint provided by the
location of another item already found. Hard-coded guesses should
be specified with the ``PATHS`` option.
4. Search the standard system environment variables. This can be
skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed. Path entries
ending in ``/bin`` or ``/sbin`` are automatically converted to their
parent directories::
PATH
5. Search project build trees recently configured in a :manual:`cmake-gui(1)`.
This can be skipped if ``NO_CMAKE_BUILDS_PATH`` is passed. It is intended
for the case when a user is building multiple dependent projects one
after another.
(This step is implemented only on Windows.)
6. Search paths stored in the CMake :ref:`User Package Registry`.
This can be skipped if ``NO_CMAKE_PACKAGE_REGISTRY`` is passed.
See the :manual:`cmake-packages(7)` manual for details on the user
package registry.
7. Search cmake variables defined in the Platform files for the
current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is
passed::
CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_FRAMEWORK_PATH
CMAKE_SYSTEM_APPBUNDLE_PATH
8. Search paths stored in the CMake :ref:`System Package Registry`.
This can be skipped if ``NO_CMAKE_SYSTEM_PACKAGE_REGISTRY`` is passed.
See the :manual:`cmake-packages(7)` manual for details on the system
package registry.
9. Search paths specified by the ``PATHS`` option. These are typically
hard-coded guesses.
.. |FIND_XXX| replace:: find_package
.. |FIND_ARGS_XXX| replace:: <package>
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
:variable:`CMAKE_FIND_ROOT_PATH_MODE_PACKAGE`
.. include:: FIND_XXX_MAC.txt
.. include:: FIND_XXX_ROOT.txt
.. include:: FIND_XXX_ORDER.txt
Every non-REQUIRED ``find_package`` call can be disabled by setting the
:variable:`CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` variable to ``TRUE``.
When loading a find module or package configuration file ``find_package``
defines variables to provide information about the call arguments (and
restores their original state before returning):
``<package>_FIND_REQUIRED``
true if ``REQUIRED`` option was given
``<package>_FIND_QUIETLY``
true if ``QUIET`` option was given
``<package>_FIND_VERSION``
full requested version string
``<package>_FIND_VERSION_MAJOR``
major version if requested, else 0
``<package>_FIND_VERSION_MINOR``
minor version if requested, else 0
``<package>_FIND_VERSION_PATCH``
patch version if requested, else 0
``<package>_FIND_VERSION_TWEAK``
tweak version if requested, else 0
``<package>_FIND_VERSION_COUNT``
number of version components, 0 to 4
``<package>_FIND_VERSION_EXACT``
true if ``EXACT`` option was given
``<package>_FIND_COMPONENTS``
list of requested components
``<package>_FIND_REQUIRED_<c>``
true if component ``<c>`` is required,
false if component ``<c>`` is optional
In Module mode the loaded find module is responsible to honor the
request detailed by these variables; see the find module for details.
In Config mode ``find_package`` handles ``REQUIRED``, ``QUIET``, and
``[version]`` options automatically but leaves it to the package
configuration file to handle components in a way that makes sense
for the package. The package configuration file may set
``<package>_FOUND`` to false to tell ``find_package`` that component
requirements are not satisfied.
See the :command:`cmake_policy` command documentation for discussion
of the ``NO_POLICY_SCOPE`` option.

@ -0,0 +1,32 @@
find_path
---------
.. |FIND_XXX| replace:: find_path
.. |NAMES| replace:: NAMES name1 [name2 ...]
.. |SEARCH_XXX| replace:: file in a directory
.. |SEARCH_XXX_DESC| replace:: directory containing the named file
.. |XXX_SUBDIR| replace:: include
.. |CMAKE_PREFIX_PATH_XXX| replace::
<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
|CMAKE_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_XXX_PATH| replace:: CMAKE_INCLUDE_PATH
.. |CMAKE_XXX_MAC_PATH| replace:: CMAKE_FRAMEWORK_PATH
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: PATH and INCLUDE
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
|CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_SYSTEM_XXX_PATH| replace:: CMAKE_SYSTEM_INCLUDE_PATH
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
:variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
.. include:: FIND_XXX.txt
When searching for frameworks, if the file is specified as A/b.h, then
the framework search will look for A.framework/Headers/b.h. If that
is found the path will be set to the path to the framework. CMake
will convert this to the correct -F option to include the file.

@ -0,0 +1,25 @@
find_program
------------
.. |FIND_XXX| replace:: find_program
.. |NAMES| replace:: NAMES name1 [name2 ...]
.. |SEARCH_XXX| replace:: program
.. |SEARCH_XXX_DESC| replace:: program
.. |XXX_SUBDIR| replace:: [s]bin
.. |CMAKE_PREFIX_PATH_XXX| replace::
|CMAKE_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_XXX_PATH| replace:: CMAKE_PROGRAM_PATH
.. |CMAKE_XXX_MAC_PATH| replace:: CMAKE_APPBUNDLE_PATH
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: PATH
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
|CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR|
.. |CMAKE_SYSTEM_XXX_PATH| replace:: CMAKE_SYSTEM_PROGRAM_PATH
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_APPBUNDLE_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
:variable:`CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`
.. include:: FIND_XXX.txt

@ -0,0 +1,14 @@
fltk_wrap_ui
------------
Create FLTK user interfaces Wrappers.
::
fltk_wrap_ui(resultingLibraryName source1
source2 ... sourceN )
Produce .h and .cxx files for all the .fl and .fld files listed. The
resulting .h and .cxx files will be added to a variable named
resultingLibraryName_FLTK_UI_SRCS which should be added to your
library.

@ -0,0 +1,47 @@
foreach
-------
Evaluate a group of commands for each value in a list.
::
foreach(loop_var arg1 arg2 ...)
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endforeach(loop_var)
All commands between foreach and the matching endforeach are recorded
without being invoked. Once the endforeach is evaluated, the recorded
list of commands is invoked once for each argument listed in the
original foreach command. Before each iteration of the loop
"${loop_var}" will be set as a variable with the current value in the
list.
::
foreach(loop_var RANGE total)
foreach(loop_var RANGE start stop [step])
Foreach can also iterate over a generated range of numbers. There are
three types of this iteration:
* When specifying single number, the range will have elements 0 to
"total".
* When specifying two numbers, the range will have elements from the
first number to the second number.
* The third optional number is the increment used to iterate from the
first number to the second number.
::
foreach(loop_var IN [LISTS [list1 [...]]]
[ITEMS [item1 [...]]])
Iterates over a precise list of items. The LISTS option names
list-valued variables to be traversed, including empty elements (an
empty string is a zero-length list). (Note macro
arguments are not variables.) The ITEMS option ends argument
parsing and includes all arguments following it in the iteration.

@ -0,0 +1,31 @@
function
--------
Start recording a function for later invocation as a command.
::
function(<name> [arg1 [arg2 [arg3 ...]]])
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endfunction(<name>)
Define a function named <name> that takes arguments named arg1 arg2
arg3 (...). Commands listed after function, but before the matching
endfunction, are not invoked until the function is invoked. When it
is invoked, the commands recorded in the function are first modified
by replacing formal parameters (${arg1}) with the arguments passed,
and then invoked as normal commands. In addition to referencing the
formal parameters you can reference the variable ARGC which will be
set to the number of arguments passed into the function as well as
ARGV0 ARGV1 ARGV2 ... which will have the actual values of the
arguments passed in. This facilitates creating functions with
optional arguments. Additionally ARGV holds the list of all arguments
given to the function and ARGN holds the list of arguments past the
last expected argument.
A function opens a new scope: see set(var PARENT_SCOPE) for details.
See the cmake_policy() command documentation for the behavior of
policies inside functions.

@ -0,0 +1,15 @@
get_cmake_property
------------------
Get a property of the CMake instance.
::
get_cmake_property(VAR property)
Get a property from the CMake instance. The value of the property is
stored in the variable VAR. If the property is not found, VAR will be
set to "NOTFOUND". Some supported properties include: VARIABLES,
CACHE_VARIABLES, COMMANDS, MACROS, and COMPONENTS.
See also the more general get_property() command.

@ -0,0 +1,24 @@
get_directory_property
----------------------
Get a property of DIRECTORY scope.
::
get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
Store a property of directory scope in the named variable. If the
property is not defined the empty-string is returned. The DIRECTORY
argument specifies another directory from which to retrieve the
property value. The specified directory must have already been
traversed by CMake.
::
get_directory_property(<variable> [DIRECTORY <dir>]
DEFINITION <var-name>)
Get a variable definition from a directory. This form is useful to
get a variable definition from another directory.
See also the more general get_property() command.

@ -0,0 +1,37 @@
get_filename_component
----------------------
Get a specific component of a full filename.
::
get_filename_component(<VAR> <FileName> <COMP> [CACHE])
Set <VAR> to a component of <FileName>, where <COMP> is one of:
::
DIRECTORY = Directory without file name
NAME = File name without directory
EXT = File name longest extension (.b.c from d/a.b.c)
NAME_WE = File name without directory or longest extension
ABSOLUTE = Full path to file
REALPATH = Full path to existing file with symlinks resolved
PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)
Paths are returned with forward slashes and have no trailing slahes.
The longest file extension is always considered. If the optional
CACHE argument is specified, the result variable is added to the
cache.
::
get_filename_component(<VAR> FileName
PROGRAM [PROGRAM_ARGS <ARG_VAR>]
[CACHE])
The program in FileName will be found in the system search path or
left as a full path. If PROGRAM_ARGS is present with PROGRAM, then
any command-line arguments present in the FileName string are split
from the program name and stored in <ARG_VAR>. This is used to
separate a program name from its arguments in a command line string.

@ -0,0 +1,49 @@
get_property
------------
Get a property.
::
get_property(<variable>
<GLOBAL |
DIRECTORY [dir] |
TARGET <target> |
SOURCE <source> |
TEST <test> |
CACHE <entry> |
VARIABLE>
PROPERTY <name>
[SET | DEFINED | BRIEF_DOCS | FULL_DOCS])
Get one property from one object in a scope. The first argument
specifies the variable in which to store the result. The second
argument determines the scope from which to get the property. It must
be one of the following:
GLOBAL scope is unique and does not accept a name.
DIRECTORY scope defaults to the current directory but another
directory (already processed by CMake) may be named by full or
relative path.
TARGET scope must name one existing target.
SOURCE scope must name one source file.
TEST scope must name one existing test.
CACHE scope must name one cache entry.
VARIABLE scope is unique and does not accept a name.
The required PROPERTY option is immediately followed by the name of
the property to get. If the property is not set an empty value is
returned. If the SET option is given the variable is set to a boolean
value indicating whether the property has been set. If the DEFINED
option is given the variable is set to a boolean value indicating
whether the property has been defined such as with define_property.
If BRIEF_DOCS or FULL_DOCS is given then the variable is set to a
string containing documentation for the requested property. If
documentation is requested for a property that has not been defined
NOTFOUND is returned.

@ -0,0 +1,16 @@
get_source_file_property
------------------------
Get a property for a source file.
::
get_source_file_property(VAR file property)
Get a property from a source file. The value of the property is
stored in the variable VAR. If the property is not found, VAR will be
set to "NOTFOUND". Use set_source_files_properties to set property
values. Source file properties usually control how the file is built.
One property that is always there is LOCATION
See also the more general get_property() command.

@ -0,0 +1,18 @@
get_target_property
-------------------
Get a property from a target.
::
get_target_property(VAR target property)
Get a property from a target. The value of the property is stored in
the variable VAR. If the property is not found, VAR will be set to
"NOTFOUND". Use set_target_properties to set property values.
Properties are usually used to control how a target is built, but some
query the target instead. This command can get properties for any
target so far created. The targets do not need to be in the current
CMakeLists.txt file.
See also the more general get_property() command.

@ -0,0 +1,15 @@
get_test_property
-----------------
Get a property of the test.
::
get_test_property(test property VAR)
Get a property from the Test. The value of the property is stored in
the variable VAR. If the property is not found, VAR will be set to
"NOTFOUND". For a list of standard properties you can type cmake
--help-property-list
See also the more general get_property() command.

@ -0,0 +1,201 @@
if
--
Conditionally execute a group of commands.
.. code-block:: cmake
if(expression)
# then section.
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
elseif(expression2)
# elseif section.
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
else(expression)
# else section.
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endif(expression)
Evaluates the given expression. If the result is true, the commands
in the THEN section are invoked. Otherwise, the commands in the else
section are invoked. The elseif and else sections are optional. You
may have multiple elseif clauses. Note that the expression in the
else and endif clause is optional. Long expressions can be used and
there is a traditional order of precedence. Parenthetical expressions
are evaluated first followed by unary tests such as ``EXISTS``,
``COMMAND``, and ``DEFINED``. Then any binary tests such as
``EQUAL``, ``LESS``, ``GREATER``, ``STRLESS``, ``STRGREATER``,
``STREQUAL``, and ``MATCHES`` will be evaluated. Then boolean ``NOT``
operators and finally boolean ``AND`` and then ``OR`` operators will
be evaluated.
Possible expressions are:
``if(<constant>)``
True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``,
or a non-zero number. False if the constant is ``0``, ``OFF``,
``NO``, ``FALSE``, ``N``, ``IGNORE``, ``NOTFOUND``, the empty string,
or ends in the suffix ``-NOTFOUND``. Named boolean constants are
case-insensitive. If the argument is not one of these constants, it
is treated as a variable.
``if(<variable>)``
True if the variable is defined to a value that is not a false
constant. False otherwise. (Note macro arguments are not variables.)
``if(NOT <expression>)``
True if the expression is not true.
``if(<expr1> AND <expr2>)``
True if both expressions would be considered true individually.
``if(<expr1> OR <expr2>)``
True if either expression would be considered true individually.
``if(COMMAND command-name)``
True if the given name is a command, macro or function that can be
invoked.
``if(POLICY policy-id)``
True if the given name is an existing policy (of the form ``CMP<NNNN>``).
``if(TARGET target-name)``
True if the given name is an existing logical target name such as those
created by the :command:`add_executable`, :command:`add_library`, or
:command:`add_custom_target` commands.
``if(EXISTS path-to-file-or-directory)``
True if the named file or directory exists. Behavior is well-defined
only for full paths.
``if(file1 IS_NEWER_THAN file2)``
True if file1 is newer than file2 or if one of the two files doesn't
exist. Behavior is well-defined only for full paths. If the file
time stamps are exactly the same, an ``IS_NEWER_THAN`` comparison returns
true, so that any dependent build operations will occur in the event
of a tie. This includes the case of passing the same file name for
both file1 and file2.
``if(IS_DIRECTORY path-to-directory)``
True if the given name is a directory. Behavior is well-defined only
for full paths.
``if(IS_SYMLINK file-name)``
True if the given name is a symbolic link. Behavior is well-defined
only for full paths.
``if(IS_ABSOLUTE path)``
True if the given path is an absolute path.
``if(<variable|string> MATCHES regex)``
True if the given string or variable's value matches the given regular
expression.
``if(<variable|string> LESS <variable|string>)``
True if the given string or variable's value is a valid number and less
than that on the right.
``if(<variable|string> GREATER <variable|string>)``
True if the given string or variable's value is a valid number and greater
than that on the right.
``if(<variable|string> EQUAL <variable|string>)``
True if the given string or variable's value is a valid number and equal
to that on the right.
``if(<variable|string> STRLESS <variable|string>)``
True if the given string or variable's value is lexicographically less
than the string or variable on the right.
``if(<variable|string> STRGREATER <variable|string>)``
True if the given string or variable's value is lexicographically greater
than the string or variable on the right.
``if(<variable|string> STREQUAL <variable|string>)``
True if the given string or variable's value is lexicographically equal
to the string or variable on the right.
``if(<variable|string> VERSION_LESS <variable|string>)``
Component-wise integer version number comparison (version format is
``major[.minor[.patch[.tweak]]]``).
``if(<variable|string> VERSION_EQUAL <variable|string>)``
Component-wise integer version number comparison (version format is
``major[.minor[.patch[.tweak]]]``).
``if(<variable|string> VERSION_GREATER <variable|string>)``
Component-wise integer version number comparison (version format is
``major[.minor[.patch[.tweak]]]``).
``if(DEFINED <variable>)``
True if the given variable is defined. It does not matter if the
variable is true or false just if it has been set. (Note macro
arguments are not variables.)
``if((expression) AND (expression OR (expression)))``
The expressions inside the parenthesis are evaluated first and then
the remaining expression is evaluated as in the previous examples.
Where there are nested parenthesis the innermost are evaluated as part
of evaluating the expression that contains them.
The if command was written very early in CMake's history, predating
the ``${}`` variable evaluation syntax, and for convenience evaluates
variables named by its arguments as shown in the above signatures.
Note that normal variable evaluation with ``${}`` applies before the if
command even receives the arguments. Therefore code like::
set(var1 OFF)
set(var2 "var1")
if(${var2})
appears to the if command as::
if(var1)
and is evaluated according to the ``if(<variable>)`` case documented
above. The result is ``OFF`` which is false. However, if we remove the
``${}`` from the example then the command sees::
if(var2)
which is true because ``var2`` is defined to "var1" which is not a false
constant.
Automatic evaluation applies in the other cases whenever the
above-documented signature accepts ``<variable|string>``:
* The left hand argument to ``MATCHES`` is first checked to see if it is
a defined variable, if so the variable's value is used, otherwise the
original value is used.
* If the left hand argument to ``MATCHES`` is missing it returns false
without error
* Both left and right hand arguments to ``LESS``, ``GREATER``, and
``EQUAL`` are independently tested to see if they are defined
variables, if so their defined values are used otherwise the original
value is used.
* Both left and right hand arguments to ``STRLESS``, ``STREQUAL``, and
``STRGREATER`` are independently tested to see if they are defined
variables, if so their defined values are used otherwise the original
value is used.
* Both left and right hand arguments to ``VERSION_LESS``,
``VERSION_EQUAL``, and ``VERSION_GREATER`` are independently tested
to see if they are defined variables, if so their defined values are
used otherwise the original value is used.
* The right hand argument to ``NOT`` is tested to see if it is a boolean
constant, if so the value is used, otherwise it is assumed to be a
variable and it is dereferenced.
* The left and right hand arguments to ``AND`` and ``OR`` are independently
tested to see if they are boolean constants, if so they are used as
such, otherwise they are assumed to be variables and are dereferenced.

@ -0,0 +1,25 @@
include
-------
Load and run CMake code from a file or module.
::
include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]
[NO_POLICY_SCOPE])
Load and run CMake code from the file given. Variable reads and
writes access the scope of the caller (dynamic scoping). If OPTIONAL
is present, then no error is raised if the file does not exist. If
RESULT_VARIABLE is given the variable will be set to the full filename
which has been included or NOTFOUND if it failed.
If a module is specified instead of a file, the file with name
<modulename>.cmake is searched first in CMAKE_MODULE_PATH, then in the
CMake module directory. There is one exception to this: if the file
which calls include() is located itself in the CMake module directory,
then first the CMake module directory is searched and
CMAKE_MODULE_PATH afterwards. See also policy CMP0017.
See the cmake_policy() command documentation for discussion of the
NO_POLICY_SCOPE option.

@ -0,0 +1,35 @@
include_directories
-------------------
Add include directories to the build.
::
include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...])
Add the given directories to those the compiler uses to search for
include files. Relative paths are interpreted as relative to the
current source directory.
The include directories are added to the :prop_dir:`INCLUDE_DIRECTORIES`
directory property for the current ``CMakeLists`` file. They are also
added to the :prop_tgt:`INCLUDE_DIRECTORIES` target property for each
target in the current ``CMakeLists`` file. The target property values
are the ones used by the generators.
By default the directories specified are appended onto the current list of
directories. This default behavior can be changed by setting
:variable:`CMAKE_INCLUDE_DIRECTORIES_BEFORE` to ``ON``. By using
``AFTER`` or ``BEFORE`` explicitly, you can select between appending and
prepending, independent of the default.
If the ``SYSTEM`` option is given, the compiler will be told the
directories are meant as system include directories on some platforms.
Signalling this setting might achieve effects such as the compiler
skipping warnings, or these fixed-install system files not being
considered in dependency calculations - see compiler docs.
Arguments to ``include_directories`` may use "generator expressions" with
the syntax "$<...>". See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

@ -0,0 +1,23 @@
include_external_msproject
--------------------------
Include an external Microsoft project file in a workspace.
::
include_external_msproject(projectname location
[TYPE projectTypeGUID]
[GUID projectGUID]
[PLATFORM platformName]
dep1 dep2 ...)
Includes an external Microsoft project in the generated workspace
file. Currently does nothing on UNIX. This will create a target
named [projectname]. This can be used in the add_dependencies command
to make things depend on the external project.
TYPE, GUID and PLATFORM are optional parameters that allow one to
specify the type of project, id (GUID) of the project and the name of
the target platform. This is useful for projects requiring values
other than the default (e.g. WIX projects). These options are not
supported by the Visual Studio 6 generator.

@ -0,0 +1,18 @@
include_regular_expression
--------------------------
Set the regular expression used for dependency checking.
::
include_regular_expression(regex_match [regex_complain])
Set the regular expressions used in dependency checking. Only files
matching regex_match will be traced as dependencies. Only files
matching regex_complain will generate warnings if they cannot be found
(standard header paths are not searched). The defaults are:
::
regex_match = "^.*$" (match everything)
regex_complain = "^$" (match empty string only)

@ -0,0 +1,323 @@
install
-------
Specify rules to run at install time.
This command generates installation rules for a project. Rules
specified by calls to this command within a source directory are
executed in order during installation. The order across directories
is not defined.
There are multiple signatures for this command. Some of them define
installation options for files and targets. Options common to
multiple signatures are covered here but they are valid only for
signatures that specify them. The common options are:
``DESTINATION``
Specify the directory on disk to which a file will be installed.
If a full path (with a leading slash or drive letter) is given
it is used directly. If a relative path is given it is interpreted
relative to the value of the :variable:`CMAKE_INSTALL_PREFIX` variable.
The prefix can be relocated at install time using the ``DESTDIR``
mechanism explained in the :variable:`CMAKE_INSTALL_PREFIX` variable
documentation.
``PERMISSIONS``
Specify permissions for installed files. Valid permissions are
``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``, ``GROUP_READ``,
``GROUP_WRITE``, ``GROUP_EXECUTE``, ``WORLD_READ``, ``WORLD_WRITE``,
``WORLD_EXECUTE``, ``SETUID``, and ``SETGID``. Permissions that do
not make sense on certain platforms are ignored on those platforms.
``CONFIGURATIONS``
Specify a list of build configurations for which the install rule
applies (Debug, Release, etc.).
``COMPONENT``
Specify an installation component name with which the install rule
is associated, such as "runtime" or "development". During
component-specific installation only install rules associated with
the given component name will be executed. During a full installation
all components are installed. If ``COMPONENT`` is not provided a
default component "Unspecified" is created. The default component
name may be controlled with the
:variable:`CMAKE_INSTALL_DEFAULT_COMPONENT_NAME` variable.
``RENAME``
Specify a name for an installed file that may be different from the
original file. Renaming is allowed only when a single file is
installed by the command.
``OPTIONAL``
Specify that it is not an error if the file to be installed does
not exist.
------------------------------------------------------------------------------
::
install(TARGETS targets... [EXPORT <export-name>]
[[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
[DESTINATION <dir>]
[INCLUDES DESTINATION [<dir> ...]]
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
] [...])
The ``TARGETS`` form specifies rules for installing targets from a
project. There are five kinds of target files that may be installed:
``ARCHIVE``, ``LIBRARY``, ``RUNTIME``, ``FRAMEWORK``, and ``BUNDLE``.
Executables are treated as ``RUNTIME`` targets, except that those
marked with the ``MACOSX_BUNDLE`` property are treated as ``BUNDLE``
targets on OS X. Static libraries are always treated as ``ARCHIVE``
targets. Module libraries are always treated as ``LIBRARY`` targets.
For non-DLL platforms shared libraries are treated as ``LIBRARY``
targets, except that those marked with the ``FRAMEWORK`` property are
treated as ``FRAMEWORK`` targets on OS X. For DLL platforms the DLL
part of a shared library is treated as a ``RUNTIME`` target and the
corresponding import library is treated as an ``ARCHIVE`` target.
All Windows-based systems including Cygwin are DLL platforms.
The ``ARCHIVE``, ``LIBRARY``, ``RUNTIME``, and ``FRAMEWORK`` arguments
change the type of target to which the subsequent properties apply.
If none is given the installation properties apply to all target
types. If only one is given then only targets of that type will be
installed (which can be used to install just a DLL or just an import
library). The ``INCLUDES DESTINATION`` specifies a list of directories
which will be added to the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
target property of the ``<targets>`` when exported by the
:command:`install(EXPORT)` command. If a relative path is
specified, it is treated as relative to the ``$<INSTALL_PREFIX>``.
The ``PRIVATE_HEADER``, ``PUBLIC_HEADER``, and ``RESOURCE`` arguments
cause subsequent properties to be applied to installing a ``FRAMEWORK``
shared library target's associated files on non-Apple platforms. Rules
defined by these arguments are ignored on Apple platforms because the
associated files are installed into the appropriate locations inside
the framework folder. See documentation of the
:prop_tgt:`PRIVATE_HEADER`, :prop_tgt:`PUBLIC_HEADER`, and
:prop_tgt:`RESOURCE` target properties for details.
Either ``NAMELINK_ONLY`` or ``NAMELINK_SKIP`` may be specified as a
``LIBRARY`` option. On some platforms a versioned shared library
has a symbolic link such as::
lib<name>.so -> lib<name>.so.1
where ``lib<name>.so.1`` is the soname of the library and ``lib<name>.so``
is a "namelink" allowing linkers to find the library when given
``-l<name>``. The ``NAMELINK_ONLY`` option causes installation of only the
namelink when a library target is installed. The ``NAMELINK_SKIP`` option
causes installation of library files other than the namelink when a
library target is installed. When neither option is given both
portions are installed. On platforms where versioned shared libraries
do not have namelinks or when a library is not versioned the
``NAMELINK_SKIP`` option installs the library and the ``NAMELINK_ONLY``
option installs nothing. See the :prop_tgt:`VERSION` and
:prop_tgt:`SOVERSION` target properties for details on creating versioned
shared libraries.
One or more groups of properties may be specified in a single call to
the ``TARGETS`` form of this command. A target may be installed more than
once to different locations. Consider hypothetical targets ``myExe``,
``mySharedLib``, and ``myStaticLib``. The code:
.. code-block:: cmake
install(TARGETS myExe mySharedLib myStaticLib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)
install(TARGETS mySharedLib DESTINATION /some/full/path)
will install ``myExe`` to ``<prefix>/bin`` and ``myStaticLib`` to
``<prefix>/lib/static``. On non-DLL platforms ``mySharedLib`` will be
installed to ``<prefix>/lib`` and ``/some/full/path``. On DLL platforms
the ``mySharedLib`` DLL will be installed to ``<prefix>/bin`` and
``/some/full/path`` and its import library will be installed to
``<prefix>/lib/static`` and ``/some/full/path``.
The ``EXPORT`` option associates the installed target files with an
export called ``<export-name>``. It must appear before any ``RUNTIME``,
``LIBRARY``, or ``ARCHIVE`` options. To actually install the export
file itself, call ``install(EXPORT)``, documented below.
Installing a target with the :prop_tgt:`EXCLUDE_FROM_ALL` target property
set to ``TRUE`` has undefined behavior.
------------------------------------------------------------------------------
::
install(<FILES|PROGRAMS> files... DESTINATION <dir>
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[RENAME <name>] [OPTIONAL])
The ``FILES`` form specifies rules for installing files for a project.
File names given as relative paths are interpreted with respect to the
current source directory. Files installed by this form are by default
given permissions ``OWNER_WRITE``, ``OWNER_READ``, ``GROUP_READ``, and
``WORLD_READ`` if no ``PERMISSIONS`` argument is given.
The ``PROGRAMS`` form is identical to the ``FILES`` form except that the
default permissions for the installed file also include ``OWNER_EXECUTE``,
``GROUP_EXECUTE``, and ``WORLD_EXECUTE``. This form is intended to install
programs that are not targets, such as shell scripts. Use the ``TARGETS``
form to install targets built within the project.
The list of ``files...`` given to ``FILES`` or ``PROGRAMS`` may use
"generator expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
However, if any item begins in a generator expression it must evaluate
to a full path.
------------------------------------------------------------------------------
::
install(DIRECTORY dirs... DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[USE_SOURCE_PERMISSIONS] [OPTIONAL]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>] [FILES_MATCHING]
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
The ``DIRECTORY`` form installs contents of one or more directories to a
given destination. The directory structure is copied verbatim to the
destination. The last component of each directory name is appended to
the destination directory but a trailing slash may be used to avoid
this because it leaves the last component empty. Directory names
given as relative paths are interpreted with respect to the current
source directory. If no input directory names are given the
destination directory will be created but nothing will be installed
into it. The ``FILE_PERMISSIONS`` and ``DIRECTORY_PERMISSIONS`` options
specify permissions given to files and directories in the destination.
If ``USE_SOURCE_PERMISSIONS`` is specified and ``FILE_PERMISSIONS`` is not,
file permissions will be copied from the source directory structure.
If no permissions are specified files will be given the default
permissions specified in the ``FILES`` form of the command, and the
directories will be given the default permissions specified in the
``PROGRAMS`` form of the command.
Installation of directories may be controlled with fine granularity
using the ``PATTERN`` or ``REGEX`` options. These "match" options specify a
globbing pattern or regular expression to match directories or files
encountered within input directories. They may be used to apply
certain options (see below) to a subset of the files and directories
encountered. The full path to each input file or directory (with
forward slashes) is matched against the expression. A ``PATTERN`` will
match only complete file names: the portion of the full path matching
the pattern must occur at the end of the file name and be preceded by
a slash. A ``REGEX`` will match any portion of the full path but it may
use ``/`` and ``$`` to simulate the ``PATTERN`` behavior. By default all
files and directories are installed whether or not they are matched.
The ``FILES_MATCHING`` option may be given before the first match option
to disable installation of files (but not directories) not matched by
any expression. For example, the code
.. code-block:: cmake
install(DIRECTORY src/ DESTINATION include/myproj
FILES_MATCHING PATTERN "*.h")
will extract and install header files from a source tree.
Some options may follow a ``PATTERN`` or ``REGEX`` expression and are applied
only to files or directories matching them. The ``EXCLUDE`` option will
skip the matched file or directory. The ``PERMISSIONS`` option overrides
the permissions setting for the matched file or directory. For
example the code
.. code-block:: cmake
install(DIRECTORY icons scripts/ DESTINATION share/myproj
PATTERN "CVS" EXCLUDE
PATTERN "scripts/*"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ)
will install the ``icons`` directory to ``share/myproj/icons`` and the
``scripts`` directory to ``share/myproj``. The icons will get default
file permissions, the scripts will be given specific permissions, and any
``CVS`` directories will be excluded.
------------------------------------------------------------------------------
::
install([[SCRIPT <file>] [CODE <code>]] [...])
The ``SCRIPT`` form will invoke the given CMake script files during
installation. If the script file name is a relative path it will be
interpreted with respect to the current source directory. The ``CODE``
form will invoke the given CMake code during installation. Code is
specified as a single argument inside a double-quoted string. For
example, the code
.. code-block:: cmake
install(CODE "MESSAGE(\"Sample install message.\")")
will print a message during installation.
------------------------------------------------------------------------------
::
install(EXPORT <export-name> DESTINATION <dir>
[NAMESPACE <namespace>] [FILE <name>.cmake]
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[EXPORT_LINK_INTERFACE_LIBRARIES]
[COMPONENT <component>])
The ``EXPORT`` form generates and installs a CMake file containing code to
import targets from the installation tree into another project.
Target installations are associated with the export ``<export-name>``
using the ``EXPORT`` option of the ``install(TARGETS)`` signature
documented above. The ``NAMESPACE`` option will prepend ``<namespace>`` to
the target names as they are written to the import file. By default
the generated file will be called ``<export-name>.cmake`` but the ``FILE``
option may be used to specify a different name. The value given to
the ``FILE`` option must be a file name with the ``.cmake`` extension.
If a ``CONFIGURATIONS`` option is given then the file will only be installed
when one of the named configurations is installed. Additionally, the
generated import file will reference only the matching target
configurations. The ``EXPORT_LINK_INTERFACE_LIBRARIES`` keyword, if
present, causes the contents of the properties matching
``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?`` to be exported, when
policy :policy:`CMP0022` is ``NEW``. If a ``COMPONENT`` option is
specified that does not match that given to the targets associated with
``<export-name>`` the behavior is undefined. If a library target is
included in the export but a target to which it links is not included
the behavior is unspecified.
The ``EXPORT`` form is useful to help outside projects use targets built
and installed by the current project. For example, the code
.. code-block:: cmake
install(TARGETS myexe EXPORT myproj DESTINATION bin)
install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj)
will install the executable myexe to ``<prefix>/bin`` and code to import
it in the file ``<prefix>/lib/myproj/myproj.cmake``. An outside project
may load this file with the include command and reference the ``myexe``
executable from the installation tree using the imported target name
``mp_myexe`` as if the target were built in its own tree.
.. note::
This command supercedes the :command:`install_targets` command and
the :prop_tgt:`PRE_INSTALL_SCRIPT` and :prop_tgt:`POST_INSTALL_SCRIPT`
target properties. It also replaces the ``FILES`` forms of the
:command:`install_files` and :command:`install_programs` commands.
The processing order of these install rules relative to
those generated by :command:`install_targets`,
:command:`install_files`, and :command:`install_programs` commands
is not defined.

@ -0,0 +1,39 @@
install_files
-------------
Deprecated. Use the install(FILES ) command instead.
This command has been superceded by the install command. It is
provided for compatibility with older CMake code. The FILES form is
directly replaced by the FILES form of the install command. The
regexp form can be expressed more clearly using the GLOB form of the
file command.
::
install_files(<dir> extension file file ...)
Create rules to install the listed files with the given extension into
the given directory. Only files existing in the current source tree
or its corresponding location in the binary tree may be listed. If a
file specified already has an extension, that extension will be
removed first. This is useful for providing lists of source files
such as foo.cxx when you want the corresponding foo.h to be installed.
A typical extension is '.h'.
::
install_files(<dir> regexp)
Any files in the current source directory that match the regular
expression will be installed.
::
install_files(<dir> FILES file file ...)
Any files listed after the FILES keyword will be installed explicitly
from the names given. Full paths are allowed in this form.
The directory <dir> is relative to the installation prefix, which is
stored in the variable CMAKE_INSTALL_PREFIX.

@ -0,0 +1,33 @@
install_programs
----------------
Deprecated. Use the install(PROGRAMS ) command instead.
This command has been superceded by the install command. It is
provided for compatibility with older CMake code. The FILES form is
directly replaced by the PROGRAMS form of the INSTALL command. The
regexp form can be expressed more clearly using the GLOB form of the
FILE command.
::
install_programs(<dir> file1 file2 [file3 ...])
install_programs(<dir> FILES file1 [file2 ...])
Create rules to install the listed programs into the given directory.
Use the FILES argument to guarantee that the file list version of the
command will be used even when there is only one argument.
::
install_programs(<dir> regexp)
In the second form any program in the current source directory that
matches the regular expression will be installed.
This command is intended to install programs that are not built by
cmake, such as shell scripts. See the TARGETS form of the INSTALL
command to create installation rules for targets built by cmake.
The directory <dir> is relative to the installation prefix, which is
stored in the variable CMAKE_INSTALL_PREFIX.

@ -0,0 +1,17 @@
install_targets
---------------
Deprecated. Use the install(TARGETS ) command instead.
This command has been superceded by the install command. It is
provided for compatibility with older CMake code.
::
install_targets(<dir> [RUNTIME_DIRECTORY dir] target target)
Create rules to install the listed targets into the given directory.
The directory <dir> is relative to the installation prefix, which is
stored in the variable CMAKE_INSTALL_PREFIX. If RUNTIME_DIRECTORY is
specified, then on systems with special runtime files (Windows DLL),
the files will be copied to that directory.

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

Loading…
Cancel
Save