From 63d71256f83e5da6479d90d1bbdaf17ad6d31f02 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 5 Apr 2024 23:16:19 +0000 Subject: deploy: c660b71b9689af89bc09671e6a6de7f9943e2709 --- development/cmake.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'development/cmake.html') diff --git a/development/cmake.html b/development/cmake.html index 85ed59f..7bc4339 100644 --- a/development/cmake.html +++ b/development/cmake.html @@ -177,6 +177,19 @@

cmake(1)

+

Frequently used variables

+
# Install location.
+CMAKE_INSTALL_PREFIX=<path>
+
+# Generate compile_commands.json?
+CMAKE_EXPORT_COMPILE_COMMANDS={0,1}
+
+# Project build type.
+CMAKE_BUILD_TYPE={Debug, Release, RelWithDebInfo, MinSizeRel}
+
+# C++ standard.
+CMAKE_CXX_STANDARD={14,17,..}
+

PRIVATE / PUBLIC / INTERFACE

These modifier control where properties for a given target are visible.

    @@ -211,6 +224,15 @@ target_link_libraries(main liba) [3/4] /usr/bin/c++ -DDEF_INTERFACE -DDEF_PUBLIC [..] .../main.cc [4/4] [..] +

    find_package [ref]

    +

    A small example to play with can be found in cmake/module.

    +
    find_package(Name MODULE)
    +
    +

    Looks for FindName.cmake in paths given by CMAKE_MODULE_PATH and then builtin paths.

    +
    find_package(Name CONFIG)
    +
    +

    Looks for name-config.cmake or NameConfig.cmake in paths given by +CMAKE_PREFIX_PATH, or path given by Name_DIR and then builtin paths.

-- cgit v1.2.3