From 5942f8ed1769a553ca7ee99e0f21bb2dd30c2e9f Mon Sep 17 00:00:00 2001 From: redcode Date: Wed, 29 Jun 2022 04:31:08 +0200 Subject: [PATCH] Integration instructions. --- README | 14 ++++++-------- README.md | 6 +++--- documentation/Integration.rst | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README b/README index 88af710..6932a67 100644 --- a/README +++ b/README @@ -234,15 +234,13 @@ the static versions, "BUILD_SHARED_LIBS" determines which one to link against. 4.2. As a CMake subproject -To embed the library as a CMake subproject, just place its entire source tree -into a subdirectory of your project. +To embed the Z80 library as a CMake subproject, place its entire source tree +into a subdirectory of another project and use "add_subdirectory" in the parent +project to add this subdirectory to the build process. -It is advisable to configure the library in the CMakeLists.txt of your project. -This will prevent the user from having to specify configuration options for the -Z80 subproject through the command line when building the main project. As noted -in the "Installation" section of this document, all package-specific options are -prefixed with "Z80_", so, in a normal scenario, there should be no risk of name -collision with the options and variables of the parent project. +It is advisable to configure the library in the CMakeLists.txt of the parent +project. This will prevent the user from having to specify configuration options +for the Z80 subproject through the command line when building the main project. Example: diff --git a/README.md b/README.md index 1de6f36..b7bfbeb 100644 --- a/README.md +++ b/README.md @@ -413,9 +413,9 @@ When not specified as a component, the linking method is selected according to [ ### As a CMake subproject -To embed the library as a CMake subproject, just place its entire source tree into a subdirectory of your project. +To embed the Z80 library as a CMake subproject, place its entire source tree into a subdirectory of another project and use [`add_subdirectory`](https://cmake.org/cmake/help/latest/command/add_subdirectory.html) in the parent project to add this subdirectory to the build process. -It is advisable to configure the library in the CMakeLists.txt of your project. This will prevent the user from having to specify configuration options for the Z80 subproject through the CMake command line when building the main project. As noted in the _[Installation](#installation)_ section of this document, all package-specific options are prefixed with `Z80_`, so, in a normal scenario, there should be no risk of name collision with the options and variables of the parent project. +It is advisable to configure the library in the `CMakeLists.txt` of the parent project. This will prevent the user from having to specify configuration options for the Z80 subproject through the command line when building the main project. Example: @@ -428,7 +428,7 @@ add_subdirectory(dependencies/Z80) target_link_libraries(your-target Z80) ``` -It is important to set the `Z80_SHARED_LIBS` option. Otherwise CMake will build the library type indicated by `BUILD_SHARED_LIBS`, which may not be the desired one. +It is important to set the [`Z80_SHARED_LIBS`](#option_z80_shared_libs) option. Otherwise CMake will build the library type indicated by [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html), which may not be the desired one. ### Manual integration diff --git a/documentation/Integration.rst b/documentation/Integration.rst index 09a8180..1a6e5d5 100644 --- a/documentation/Integration.rst +++ b/documentation/Integration.rst @@ -31,9 +31,9 @@ When not specified as a component, the linking method is selected according to ` As a CMake subproject --------------------- -To embed the library as a CMake subproject, just place its entire source tree into a subdirectory of your project. +To embed the Z80 library as a CMake subproject, place its entire source tree into a subdirectory of another project and use ``add_subdirectory`` in the parent project to add this subdirectory to the build process. -It is advisable to configure the library in the ``CMakeLists.txt`` of your project. This will prevent the user from having to specify configuration options of the Z80 subproject through the CMake command line when building the main project. As noted in the Installation section of this document, all package-specific options are prefixed with ``Z80_``, so, in a normal scenario, there should be no risk of name collision with the options and variables of the parent project. +It is advisable to configure the library in the ``CMakeLists.txt`` of the parent project. This will prevent the user from having to specify configuration options for the Z80 subproject through the command line when building the main project. Example: