... | @@ -105,35 +105,35 @@ generates native makefiles and workspaces that can be used in the |
... | @@ -105,35 +105,35 @@ generates native makefiles and workspaces that can be used in the |
|
compiler environment of your choice. CMake is quite sophisticated: it is
|
|
compiler environment of your choice. CMake is quite sophisticated: it is
|
|
possible to support complex environments requiring system configuration,
|
|
possible to support complex environments requiring system configuration,
|
|
preprocessor generation, code generation, and template instantiation.
|
|
preprocessor generation, code generation, and template instantiation.
|
|
Please go to <http://www.cmake.org/overview> to learn more about CMake.
|
|
Please go to <https://cmake.org/overview> to learn more about CMake.
|
|
|
|
|
|
### What is the current release?
|
|
### What is the current release?
|
|
|
|
|
|
The latest release of CMake is always available at:
|
|
The latest release of CMake is always available at:
|
|
<http://www.cmake.org/download>
|
|
<https://cmake.org/download>
|
|
|
|
|
|
From there, you can fetch CMake binaries for Windows or several Unix
|
|
From there, you can fetch CMake binaries for Windows or several Unix
|
|
variants, or you can download the source code of CMake.
|
|
variants, or you can download the source code of CMake.
|
|
|
|
|
|
You can also access nightly development through Git; see
|
|
You can also access nightly development through Git; see
|
|
<http://www.cmake.org/download> for more information. You may also
|
|
<https://cmake.org/download> for more information. You may also
|
|
browse the [git repository online](http://cmake.org/gitweb?p=cmake.git).
|
|
browse the [git repository online](https://gitlab.kitware.com/cmake/cmake).
|
|
|
|
|
|
### I found a Bug\! What should I do?
|
|
### I found a Bug\! What should I do?
|
|
|
|
|
|
If you have a patch to contribute, please read
|
|
If you have a patch to contribute, please read
|
|
[CONTRIBUTING.rst](http://cmake.org/gitweb?p=cmake.git;a=blob_plain;f=CONTRIBUTING.rst;hb=master)
|
|
[CONTRIBUTING.rst](https://gitlab.kitware.com/cmake/cmake/-/blob/master/CONTRIBUTING.rst)
|
|
at the top of the CMake source tree.
|
|
at the top of the CMake source tree.
|
|
|
|
|
|
Otherwise, please report the bug in our bug tracker:
|
|
Otherwise, please report the bug in our bug tracker:
|
|
<http://www.cmake.org/Bug>
|
|
<https://gitlab.kitware.com/cmake/cmake/-/issues>
|
|
|
|
|
|
Please make sure to look at the old bugs not to include duplicates,
|
|
Please make sure to look at the old bugs not to include duplicates,
|
|
include detailed instructions of the bug and how to reproduce it.
|
|
include detailed instructions of the bug and how to reproduce it.
|
|
|
|
|
|
### I want a new feature in CMake. What should I do?
|
|
### I want a new feature in CMake. What should I do?
|
|
|
|
|
|
Report a feature request in our Bug tracker <http://www.cmake.org/Bug>
|
|
Report a feature request in our Bug tracker <https://gitlab.kitware.com/cmake/cmake/-/issues>
|
|
|
|
|
|
Please make sure to look at the old feature requests not to include
|
|
Please make sure to look at the old feature requests not to include
|
|
duplicates, include detailed instructions of the feature and proposed
|
|
duplicates, include detailed instructions of the feature and proposed
|
... | @@ -169,7 +169,7 @@ There exist at least these ones: |
... | @@ -169,7 +169,7 @@ There exist at least these ones: |
|
|
|
|
|
<!-- end list -->
|
|
<!-- end list -->
|
|
|
|
|
|
site:http://www.cmake.org/pipermail/cmake/ <search terms>
|
|
site:https://cmake.org/pipermail/cmake/ <search terms>
|
|
|
|
|
|
## Running CMake
|
|
## Running CMake
|
|
|
|
|
... | @@ -447,11 +447,10 @@ It also tells versions of CMake newer than that specified that the |
... | @@ -447,11 +447,10 @@ It also tells versions of CMake newer than that specified that the |
|
project may not be aware of policies introduced in later versions, which
|
|
project may not be aware of policies introduced in later versions, which
|
|
enables additional compatibility. For futher documentation, see
|
|
enables additional compatibility. For futher documentation, see
|
|
|
|
|
|
- [CMake Policy Mechanism](doc/cmake/Policies "wikilink")
|
|
- [cmake-policies(7) manual](https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html)
|
|
- [cmake_policy()
|
|
- [cmake_policy()
|
|
command](http://www.cmake.org/cmake/help/cmake2.6docs.html#command:cmake_policy)
|
|
command](https://cmake.org/cmake/help/latest/command/cmake_policy.html)
|
|
- [CMake 2.6
|
|
- [CMake Policy Mechanism](doc/cmake/Policies "wikilink")
|
|
Policies](http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Policies)
|
|
|
|
|
|
|
|
### How do I get the current source or binary directory?
|
|
### How do I get the current source or binary directory?
|
|
|
|
|
... | @@ -806,7 +805,7 @@ endif() |
... | @@ -806,7 +805,7 @@ endif() |
|
|
|
|
|
(for further details, please refer to the original CMake implementation
|
|
(for further details, please refer to the original CMake implementation
|
|
source at
|
|
source at
|
|
[Source/kwsys/RegularExpression.hxx.in](http://www.cmake.org/cgi-bin/viewcvs.cgi/Source/kwsys/RegularExpression.hxx.in?root=CMake&view=markup))
|
|
[Source/kwsys/RegularExpression.hxx.in](https://gitlab.kitware.com/utils/kwsys/-/blob/6e17188724dd933df14d03e39fdfc73ac621bc0c/RegularExpression.hxx.in#L152-292))
|
|
|
|
|
|
When using `MATCHES` or `MATCHALL` in an `if` command, or using any of the
|
|
When using `MATCHES` or `MATCHALL` in an `if` command, or using any of the
|
|
`string(REGEX ...)` commands, CMake expects regular expressions, not globs
|
|
`string(REGEX ...)` commands, CMake expects regular expressions, not globs
|
... | @@ -1012,10 +1011,7 @@ platforms. |
... | @@ -1012,10 +1011,7 @@ platforms. |
|
|
|
|
|
### What are the rules to write a FindXXX.cmake file?
|
|
### What are the rules to write a FindXXX.cmake file?
|
|
|
|
|
|
Let's follow the instructions and the advices in the Modules/readme.txt
|
|
See the [cmake-developer(7) manual](https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#find-modules) "Find Modules" section.
|
|
[1](http://www.cmake.org/cgi-bin/viewcvs.cgi/Modules/readme.txt?root=CMake&view=markup)
|
|
|
|
file located in the CVS
|
|
|
|
repository.
|
|
|
|
|
|
|
|
### Why does find_library look in system directories before its PATHS option?
|
|
### Why does find_library look in system directories before its PATHS option?
|
|
|
|
|
... | @@ -1028,7 +1024,7 @@ CMake will find `/usr/lib/libfoo.so` instead of |
... | @@ -1028,7 +1024,7 @@ CMake will find `/usr/lib/libfoo.so` instead of |
|
`/opt/foo/lib/libfoo.so` if both exist. The reason is that
|
|
`/opt/foo/lib/libfoo.so` if both exist. The reason is that
|
|
`/opt/foo/lib` is a *hard-coded guess* of the location. The
|
|
`/opt/foo/lib` is a *hard-coded guess* of the location. The
|
|
documentation of
|
|
documentation of
|
|
[`find_library`](http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_library)
|
|
[`find_library`](https://cmake.org/cmake/help/latest/command/find_library.html)
|
|
specifies the search order. User, project, and system configuration
|
|
specifies the search order. User, project, and system configuration
|
|
variables are always more local than hard-coded guesses and should
|
|
variables are always more local than hard-coded guesses and should
|
|
override them, so the PATHS option is used last.
|
|
override them, so the PATHS option is used last.
|
... | @@ -1309,7 +1305,9 @@ In practice, most libraries have different defines and compiler flags |
... | @@ -1309,7 +1305,9 @@ In practice, most libraries have different defines and compiler flags |
|
for the shared vs. static cases. So you would have to build all your
|
|
for the shared vs. static cases. So you would have to build all your
|
|
library objects twice anyways. However, if you happen to have
|
|
library objects twice anyways. However, if you happen to have
|
|
*exactly* the same defines and compiler flags for the shared vs.
|
|
*exactly* the same defines and compiler flags for the shared vs.
|
|
static cases...
|
|
static cases, then use [object libraries](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#object-libraries).
|
|
|
|
|
|
|
|
<details><summary>Original Answer</summary>
|
|
|
|
|
|
...if you're using Linux and a GCC-style linker, you could do the
|
|
...if you're using Linux and a GCC-style linker, you could do the
|
|
following. Note that for this to work correctly on linux, the zzSTATIC
|
|
following. Note that for this to work correctly on linux, the zzSTATIC
|
... | @@ -1327,11 +1325,13 @@ endif() |
... | @@ -1327,11 +1325,13 @@ endif() |
|
not just GCC or Linux, you could extract the locations of previously
|
|
not just GCC or Linux, you could extract the locations of previously
|
|
built object files and insert them directly into the libraries that need
|
|
built object files and insert them directly into the libraries that need
|
|
them. This is documented in [CMake Feature Request \#5155: standard way
|
|
them. This is documented in [CMake Feature Request \#5155: standard way
|
|
to locate object files](http://www.cmake.org/Bug/view.php?id=5155).
|
|
to locate object files](https://cmake.org/Bug/view.php?id=5155).
|
|
Unfortunately this approach relies on CMake's internal implementation,
|
|
Unfortunately this approach relies on CMake's internal implementation,
|
|
and that implementation could change in the future, breaking your
|
|
and that implementation could change in the future, breaking your
|
|
code.
|
|
code.
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
### 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?
|
|
|
|
|
|
Set the `OUTPUT_NAME` of your shared and static libraries to the same
|
|
Set the `OUTPUT_NAME` of your shared and static libraries to the same
|
... | @@ -1655,7 +1655,7 @@ add_executable(CMakeSetup WIN32 ${SRCS}) |
... | @@ -1655,7 +1655,7 @@ add_executable(CMakeSetup WIN32 ${SRCS}) |
|
|
|
|
|
Note that visual studio 9 project files do not appear to work with
|
|
Note that visual studio 9 project files do not appear to work with
|
|
CMAKE_MFC_FLAG 1; this may be related to
|
|
CMAKE_MFC_FLAG 1; this may be related to
|
|
[bug 7056](http://www.cmake.org/Bug/view.php?id=7056).
|
|
[bug 7056](https://cmake.org/Bug/view.php?id=7056).
|
|
|
|
|
|
In order to use MFC with UNICODE, you must also [specify the entry point
|
|
In order to use MFC with UNICODE, you must also [specify the entry point
|
|
wWinMainCRTStartup](http://msdn.microsoft.com/en-us/library/dybsewaf.aspx).
|
|
wWinMainCRTStartup](http://msdn.microsoft.com/en-us/library/dybsewaf.aspx).
|
... | @@ -2104,9 +2104,7 @@ separate Makefile in each directory. Supporting both at the same time is |
... | @@ -2104,9 +2104,7 @@ separate Makefile in each directory. Supporting both at the same time is |
|
not a trivial change from the current design.
|
|
not a trivial change from the current design.
|
|
|
|
|
|
See issue tracker entry
|
|
See issue tracker entry
|
|
[14312](http://www.cmake.org/Bug/view.php?id=14312). Any proposed
|
|
[14312](https://gitlab.kitware.com/cmake/cmake/-/issues/14312). Any solution must work with ancient UNIX make and cannot depend on GNU make features.
|
|
solution must work with ancient UNIX make and cannot depend on GNU make
|
|
|
|
features.
|
|
|
|
|
|
|
|
----
|
|
----
|
|
This page was initially populated by conversion from its [original location](https://public.kitware.com/Wiki/CMake_FAQ) in another wiki. |
|
This page was initially populated by conversion from its [original location](https://public.kitware.com/Wiki/CMake_FAQ) in another wiki. |
|
|
|
\ No newline at end of file |