mirror of
https://github.com/ttroy50/cmake-examples.git
synced 2025-12-18 20:24:35 +03:00
fix a few typos and grammer
This commit is contained in:
@@ -84,7 +84,8 @@ target_link_libraries( hello_binary
|
|||||||
----
|
----
|
||||||
|
|
||||||
This tells CMake to link the hello_library against the hello_binary executable
|
This tells CMake to link the hello_library against the hello_binary executable
|
||||||
during link time.
|
during link time. It will also propogate any include directries with +PUBLIC+ or +INTERFACE+ scope
|
||||||
|
from the linked library target.
|
||||||
|
|
||||||
An example of this being called by the compiler is
|
An example of this being called by the compiler is
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ install (FILES cmake-examples.conf
|
|||||||
|
|
||||||
Install a configuration file to the destination +${CMAKE_INSTALL_PREFIX}/etc+
|
Install a configuration file to the destination +${CMAKE_INSTALL_PREFIX}/etc+
|
||||||
|
|
||||||
After `make install` has been run, CMake generated an install_manifest.txt file
|
After `make install` has been run, CMake generates an install_manifest.txt file
|
||||||
which includes details on all installed files.
|
which includes details on all installed files.
|
||||||
|
|
||||||
[NOTE]
|
[NOTE]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ toc::[]
|
|||||||
CMake supports setting compile flags in a number of different ways:
|
CMake supports setting compile flags in a number of different ways:
|
||||||
|
|
||||||
* using +target_compile_definitions()+ function
|
* using +target_compile_definitions()+ function
|
||||||
* using the +CMAKE_C_FLAGS+ and +CMAKE_CXX_FLAGS+ variables.
|
* using the +CMAKE_C_FLAGS+ and +CMAKE_CXX_FLAGS+ variables.
|
||||||
|
|
||||||
The files in this tutorial are below:
|
The files in this tutorial are below:
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ target_compile_definitions(cmake_examples_compile_flags
|
|||||||
|
|
||||||
This will cause the compiler to add the definition +-DEX3+ when compiling the target.
|
This will cause the compiler to add the definition +-DEX3+ when compiling the target.
|
||||||
|
|
||||||
In the target was a library, and the scope +PUBLIC+ or +INTERFACE+ has been choosen the definition would also be included in any targets that link this target.
|
In the target was a library, and the scope +PUBLIC+ or +INTERFACE+ has been choosen the definition would also be included in any executables that link this target.
|
||||||
|
|
||||||
For compiler options you can also use the +target_compile_options()+ link:https://cmake.org/cmake/help/v3.0/command/target_compile_options.html[function].
|
For compiler options you can also use the +target_compile_options()+ link:https://cmake.org/cmake/help/v3.0/command/target_compile_options.html[function].
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ A basic example of finding boost is below:
|
|||||||
|
|
||||||
[source,cmake]
|
[source,cmake]
|
||||||
----
|
----
|
||||||
find_package(Boost 1.54.0 REQUIRED COMPONENTS filesystem system)
|
find_package(Boost 1.46.1 REQUIRED COMPONENTS filesystem system)
|
||||||
----
|
----
|
||||||
|
|
||||||
The arguments are:
|
The arguments are:
|
||||||
@@ -93,8 +93,8 @@ ccmake or cmake-gui.
|
|||||||
|
|
||||||
## Alias variables
|
## Alias variables
|
||||||
|
|
||||||
Some modern CMake libraries export +ALIAS+ targets in their module files. For example, starting in later versions of CMake (v3.5+),
|
Some modern CMake libraries export +ALIAS+ targets in their module files. For example, starting from v3.5+ of CMake, the
|
||||||
Boost uses this. +ALIAS+ targets make referencing found targets eaiser. This is similar to using your own alias targets for libraries.
|
Boost module supports this. Similar to using your own ALIAS target for libraires, an +ALIAS+ in a module can make referencing found targets eaiser.
|
||||||
|
|
||||||
In the case of Boost, you could replace the following from this example:
|
In the case of Boost, you could replace the following from this example:
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ In the case of Boost, you could replace the following from this example:
|
|||||||
* `Boost_FILESYSTEM_LIBRARY` with `Boost::filesystem`
|
* `Boost_FILESYSTEM_LIBRARY` with `Boost::filesystem`
|
||||||
* `Boost_SYSTEM_LIBRARY` with `Boost::system`. If you include `Boost::filesystem` it automatically includes `Boost::system`
|
* `Boost_SYSTEM_LIBRARY` with `Boost::system`. If you include `Boost::filesystem` it automatically includes `Boost::system`
|
||||||
|
|
||||||
Using the new alias sytem, to replicate this example you only have to link the following:
|
Using the new alias sytem, to replicate this example you only have to link the following:
|
||||||
|
|
||||||
[source,cmake]
|
[source,cmake]
|
||||||
----
|
----
|
||||||
|
|||||||
Reference in New Issue
Block a user