|
|
|
|
|
|
|
|
<!-- toc -->
|
|
|
|
|
|
- [General information and availability](#general-information-and-availability)
|
|
|
* [What is CMake?](#what-is-cmake)
|
|
|
* [What is the current release?](#what-is-the-current-release)
|
|
|
* [I found a Bug\! What should I do?](#i-found-a-bug-what-should-i-do)
|
|
|
* [I want a new feature in CMake. What should I do?](#i-want-a-new-feature-in-cmake-what-should-i-do)
|
|
|
* [What is the most recent version covered by the Mastering CMake book?](#what-is-the-most-recent-version-covered-by-the-mastering-cmake-book)
|
|
|
* [Where can I find searchable CMake Mailing Archives?](#where-can-i-find-searchable-cmake-mailing-archives)
|
|
|
- [Running CMake](#running-cmake)
|
|
|
* [Is there an option to produce more 'verbose' compiling?](#is-there-an-option-to-produce-more-verbose-compiling)
|
|
|
* [Is there a way to skip checking of dependent libraries when compiling?](#is-there-a-way-to-skip-checking-of-dependent-libraries-when-compiling)
|
|
|
* [I set a cmake variable in my environment, but it didn't change anything. Why?](#i-set-a-cmake-variable-in-my-environment-but-it-didnt-change-anything-why)
|
|
|
* [How do I use a different compiler?](#how-do-i-use-a-different-compiler)
|
|
|
+ [Method 1: use environment variables](#method-1-use-environment-variables)
|
|
|
+ [Method 2: use cmake -D](#method-2-use-cmake-d)
|
|
|
+ [Method 3 (avoid): use set()](#method-3-avoid-use-set)
|
|
|
* [I change CMAKE_C_COMPILER in the GUI but it changes back on the next configure step. Why?](#i-change-cmake_c_compiler-in-the-gui-but-it-changes-back-on-the-next-configure-step-why)
|
|
|
* [In CCMake, typing full paths is tedious. Is there a better way?](#in-ccmake-typing-full-paths-is-tedious-is-there-a-better-way)
|
|
|
- [Out-of-source build trees](#out-of-source-build-trees)
|
|
|
* [What is an "out-of-source" build?](#what-is-an-out-of-source-build)
|
|
|
* [I run an out-of-source build but CMake generates in-source anyway. Why?](#i-run-an-out-of-source-build-but-cmake-generates-in-source-anyway-why)
|
|
|
* [Why does CMake use full paths, or can I copy my build tree?](#why-does-cmake-use-full-paths-or-can-i-copy-my-build-tree)
|
|
|
* [CMake does not generate a "make distclean" target. Why?](#cmake-does-not-generate-a-make-distclean-target-why)
|
|
|
* [Running "make clean" does not remove custom command outputs. Why?](#running-make-clean-does-not-remove-custom-command-outputs-why)
|
|
|
- [Writing CMakeLists.txt](#writing-cmakeliststxt)
|
|
|
* [How to have backward and forward compatibility?](#how-to-have-backward-and-forward-compatibility)
|
|
|
* [How do I get the current source or binary directory?](#how-do-i-get-the-current-source-or-binary-directory)
|
|
|
* [Why are my CMake variables not updated in the GUI after a SET command?](#why-are-my-cmake-variables-not-updated-in-the-gui-after-a-set-command)
|
|
|
* [How can I change the default build mode and see it reflected in the GUI?](#how-can-i-change-the-default-build-mode-and-see-it-reflected-in-the-gui)
|
|
|
* [How do I generate an executable, then use the executable to generate a file?](#how-do-i-generate-an-executable-then-use-the-executable-to-generate-a-file)
|
|
|
* [How can I generate a source file during the build?](#how-can-i-generate-a-source-file-during-the-build)
|
|
|
* [How can I add a dependency to a source file which is generated in a subdirectory?](#how-can-i-add-a-dependency-to-a-source-file-which-is-generated-in-a-subdirectory)
|
|
|
* [How can I generate a file used in more than one target in the same directory?](#how-can-i-generate-a-file-used-in-more-than-one-target-in-the-same-directory)
|
|
|
* [I use EXEC_PROGRAM but the result is not set in subdirectories. Why?](#i-use-exec_program-but-the-result-is-not-set-in-subdirectories-why)
|
|
|
* [How can I get or set environment variables?](#how-can-i-get-or-set-environment-variables)
|
|
|
* [Why do I have unwanted semicolons ; in my compiler flags?](#why-do-i-have-unwanted-semicolons-in-my-compiler-flags)
|
|
|
* [How can I get quoting and escapes to work properly?](#how-can-i-get-quoting-and-escapes-to-work-properly)
|
|
|
* [Isn't the "Expression" in the "ELSE (Expression)" confusing?](#isnt-the-expression-in-the-else-expression-confusing)
|
|
|
* [Which regular expressions are supported by CMake?](#which-regular-expressions-are-supported-by-cmake)
|
|
|
* [How to convert a semicolon separated list to a whitespace separated string?](#how-to-convert-a-semicolon-separated-list-to-a-whitespace-separated-string)
|
|
|
* [How can I build multiple modes without switching ?](#how-can-i-build-multiple-modes-without-switching-)
|
|
|
* [How can I specify my own configurations (for generators that allow it) ?](#how-can-i-specify-my-own-configurations-for-generators-that-allow-it-)
|
|
|
* [How can I extend the build modes with a custom made one ?](#how-can-i-extend-the-build-modes-with-a-custom-made-one-)
|
|
|
* [Why does `foreach` skip empty values?](#why-does-foreach-skip-empty-values)
|
|
|
* [Does CMake support precompiled headers?](#does-cmake-support-precompiled-headers)
|
|
|
- [Writing FindXXX.cmake files](#writing-findxxxcmake-files)
|
|
|
* [What are the rules to write a FindXXX.cmake file?](#what-are-the-rules-to-write-a-findxxxcmake-file)
|
|
|
* [Why does find_library look in system directories before its PATHS option?](#why-does-find_library-look-in-system-directories-before-its-paths-option)
|
|
|
- [Finding and using external packages](#finding-and-using-external-packages)
|
|
|
* [How do I use CMake to generate SWIG wrapper libraries?](#how-do-i-use-cmake-to-generate-swig-wrapper-libraries)
|
|
|
* [How do I use CMake to build LaTeX documents?](#how-do-i-use-cmake-to-build-latex-documents)
|
|
|
* [How do I get LaTeX references to be correct?](#how-do-i-get-latex-references-to-be-correct)
|
|
|
* [How can I set TEXINPUTS for a LaTeX compilation?](#how-can-i-set-texinputs-for-a-latex-compilation)
|
|
|
- [Library questions](#library-questions)
|
|
|
* [Can I build both shared and static libraries with one ADD_LIBRARY command?](#can-i-build-both-shared-and-static-libraries-with-one-add_library-command)
|
|
|
* [Does that mean I have to build all my library objects twice, once for shared and once for static?\! I don't like that\!](#does-that-mean-i-have-to-build-all-my-library-objects-twice-once-for-shared-and-once-for-static-i-dont-like-that)
|
|
|
* [How do I make my shared and static libraries have the same root name, but different suffixes?](#how-do-i-make-my-shared-and-static-libraries-have-the-same-root-name-but-different-suffixes)
|
|
|
* [How do I rename a library after it has already been built?](#how-do-i-rename-a-library-after-it-has-already-been-built)
|
|
|
* [Does CMake support "convenience" libraries?](#does-cmake-support-convenience-libraries)
|
|
|
* [Why are libraries linked to my shared library included when something links to it?](#why-are-libraries-linked-to-my-shared-library-included-when-something-links-to-it)
|
|
|
* [CMake dependency scanner](#cmake-dependency-scanner)
|
|
|
- [Installation questions](#installation-questions)
|
|
|
* [Does CMake's "make install" support DESTDIR?](#does-cmakes-make-install-support-destdir)
|
|
|
* [Can I do "make uninstall" with CMake?](#can-i-do-make-uninstall-with-cmake)
|
|
|
- [Distribution questions](#distribution-questions)
|
|
|
* [Where is "make dist"?](#where-is-make-dist)
|
|
|
* [What is the best way to distribute source code or binaries for a cmake-based project?](#what-is-the-best-way-to-distribute-source-code-or-binaries-for-a-cmake-based-project)
|
|
|
- [Platform-specific questions](#platform-specific-questions)
|
|
|
* [How do I build universal binaries on Mac OS X?](#how-do-i-build-universal-binaries-on-mac-os-x)
|
|
|
* [How can I apply resources on Mac OS X automatically?](#how-can-i-apply-resources-on-mac-os-x-automatically)
|
|
|
* [Why does FIND_LIBRARY not find .DLL libraries under WIN32?](#why-does-find_library-not-find-dll-libraries-under-win32)
|
|
|
* [Why am I getting a linker error to _mainCRTStartup under WIN32?](#why-am-i-getting-a-linker-error-to-_maincrtstartup-under-win32)
|
|
|
* [Why do I get this error: nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv](#why-do-i-get-this-error-nafxcwdlibappcoreobj-error-lnk2001-unresolved-external-symbol-___argv)
|
|
|
* [How to use MFC with CMake](#how-to-use-mfc-with-cmake)
|
|
|
* [How To Put Files in Folders in Visual Studio Projects](#how-to-put-files-in-folders-in-visual-studio-projects)
|
|
|
* [How to create Visual Studio 6 Projects that contain only a single build type](#how-to-create-visual-studio-6-projects-that-contain-only-a-single-build-type)
|
|
|
* [Can CMake set the Debugging/Working Directory property in Visual Studio projects?](#can-cmake-set-the-debuggingworking-directory-property-in-visual-studio-projects)
|
|
|
* [Why does CMakeSetup with the message "LINK : fatal error LNK1104: cannot open file 'user32.lib'" while configuring a project?](#why-does-cmakesetup-with-the-message-link-fatal-error-lnk1104-cannot-open-file-user32lib-while-configuring-a-project)
|
|
|
* [How can I avoid the error "Arg list too long" when running make?](#how-can-i-avoid-the-error-arg-list-too-long-when-running-make)
|
|
|
* [How can I find out platforms definitions, search paths, etc. from gcc ?](#how-can-i-find-out-platforms-definitions-search-paths-etc-from-gcc-)
|
|
|
* [How can I get a windows registry key ?](#how-can-i-get-a-windows-registry-key-)
|
|
|
* [How can I build my MSVC application with a static runtime?](#how-can-i-build-my-msvc-application-with-a-static-runtime)
|
|
|
+ [Manual Replace](#manual-replace)
|
|
|
+ [Make Override Files](#make-override-files)
|
|
|
+ [Dynamic Replace](#dynamic-replace)
|
|
|
* [Why do generated Xcode projects have a CMake PostBuild Rules phase?](#why-do-generated-xcode-projects-have-a-cmake-postbuild-rules-phase)
|
|
|
* [Why does CMake not find my Xcode compiler on OS X with the Unix Makefiles generator?](#why-does-cmake-not-find-my-xcode-compiler-on-os-x-with-the-unix-makefiles-generator)
|
|
|
- [Other Questions](#other-questions)
|
|
|
* [Why does CMake generate recursive Makefiles?](#why-does-cmake-generate-recursive-makefiles)
|
|
|
* [Why can't I make multiple targets on the command line in parallel?](#why-cant-i-make-multiple-targets-on-the-command-line-in-parallel)
|
|
|
|
|
|
<!-- tocstop -->
|
|
|
|
|
|
## General information and availability
|
|
|
|
|
|
### What is CMake?
|
... | ... | |