CGold: The Hitchhiker’s Guide to the CMake

Overview
Comments
  • Don't use the -H and -B flags for specifiying the source and build directory

    Don't use the -H and -B flags for specifiying the source and build directory

    In https://cgold.readthedocs.io/en/latest/tutorials/out-of-source.html (and on other pages), the -H. and -B flags are used.

    According to http://stackoverflow.com/a/31092052, this is undocumented because it shouldn't be used. The answer links to https://cmake.org/pipermail/cmake-developers/2016-June/028843.html, it says

    These are undocumented because they are internal options that
    are not meant for public use.
    

    So I guess the flags shouldn't be used in the tutorial.

    discussion 
    opened by dueringa 4
  • Add Windows layout after install

    Add Windows layout after install

    I though it would be useful to people trying to figure out exactly what changes in the install layout on the different platforms.

    I took the Windows layout from the appveyor run so it is correct :-)

    Feel free to edit and/or squash.

    opened by marco-m 3
  • Is it possible to send return value via argument?

    Is it possible to send return value via argument?

    In Return Value, it recommends to set a variable to the parent scope to return a value from function.

    But I am wondering if it is possible to return a value via argument of function. It is more commonly seen in CMake for example: ProcessorCount(N), N is a output argument of function.

    Is the function argument in CMake passed by reference?

    discussion 
    opened by stevenleeS0ht 2
  • Document the 3.13 explicit source directories

    Document the 3.13 explicit source directories

    In preparation for the 3.13 release I want to update the CGold documentation on the -H and -B flags as CMake now has support for explicit source and build directories with -S and -B.

    Changes: https://gitlab.kitware.com/cmake/cmake/merge_requests/2358/diffs

    Note: I did the editing locally and didn't verify the rst is valid.

    opened by robertmaynard 2
  • Wrong source link

    Wrong source link

    In this file: CGold/docs/tutorials/libraries/symbols/tools.rst

    The link duplicates: /examples/library-examples/library-symbols/Boo.cpp

    It seems to me, Foo.cpp must be in the second case.

    question 
    opened by victorshcherbakov 1
  • Ch 3.7.3: path to mymodule

    Ch 3.7.3: path to mymodule

    The example in cmake-sources/with-external-module-good doesn't work because the path to mymodule.cmake isn't fully specified (CMAKE Error: include could not find load file: mymodule).

    How should the include statement look correctly? Add the line list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../external") before?

    opened by StefanRickli 1
  • Update cmake-can-not.rst

    Update cmake-can-not.rst

    No significant content changes/updates. Some slight sentence & punctuation restructuring in order to improve readability. Some rewording to make the statements more precise.

    opened by DasGeek 1
  • Add articles

    Add articles

    Hi! First of all, a huge thanks for the work you've done. It's a real timesaver and an interesting and convenient way to learn CMake.

    I thought it would be nice to refine docs a little bit since it could be read by many english speakers as well (:

    opened by luc1ph3r 1
  • Grammar and typo changes

    Grammar and typo changes

    cmake-can-not - removed redundant "useful" cmake-can - replaced rhetorical question, corrected grammar version-policies - improved readability workflow - grammer

    Thank you for the great CMake resource! It helped me a lot.

    opened by kirkrudolph 0
  • Object libraries

    Object libraries

    In docs/rejected/object-libraries.rst, the affirmation that "library can't be used on the right hand side of target_link_libraries command" is wrong since CMake 3.12.

    opened by lguez 0
  • Could I translate this guide to Chinese

    Could I translate this guide to Chinese

    I've read many cmake guide or tutorial, but many of them are old-fashioned. I find what i need in your guide. And i wanna to share this to my Chinese friends. Is this fine to translate it

    opened by cyanial 0
  • Add overview of usefull variables/functions

    Add overview of usefull variables/functions

    Woud it be possible to add some shortlist of usefull variables/functions.

    Perhaps something like this: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/Useful-Variables

    opened by mrboojum 0
  • PUBLIC/PRIVATE linking

    PUBLIC/PRIVATE linking

    cmake_minimum_required(VERSION 3.2)
    project(foo)
    
    add_library(foo foo.cpp)
    target_compile_definitions(foo PUBLIC FOO_FEATURE)
    
    add_library(baz_1 baz_1.cpp)
    target_link_libraries(baz_1 PUBLIC foo) # Case 1
    
    add_library(baz_2 baz_2.cpp)
    target_link_libraries(baz_2 PRIVATE foo) # Case 2
    
    add_executable(boo_1 boo_1.cpp)
    target_link_libraries(boo_1 PRIVATE baz_1)
    
    add_executable(boo_2 boo_2.cpp)
    target_link_libraries(boo_2 PRIVATE baz_2)
    
    /usr/bin/c++ -DFOO_FEATURE -o foo.cpp.o -c foo.cpp
    
    /usr/bin/c++ -DFOO_FEATURE -o baz_1.cpp.o -c baz_1.cpp
    /usr/bin/c++ -DFOO_FEATURE -o boo_1.cpp.o -c boo_1.cpp # FOO_FEATURE added, foo headers can be used in boo_1.cpp
    /usr/bin/c++ boo_1.cpp.o -o boo_1 libbaz_1.a libfoo.a  # libfoo.a added, linking is static, we may need symbols
    
    /usr/bin/c++ -DFOO_FEATURE -o baz_2.cpp.o -c baz_2.cpp
    /usr/bin/c++ -o boo_2.cpp.o -c boo_2.cpp               # FOO_FEATURE is missing, can't use foo headers in boo_2.cpp
    /usr/bin/c++ boo_2.cpp.o -o boo_2 libbaz_2.a libfoo.a  # libfoo.a added even if PRIVATE used
    
    • https://github.com/hunter-packages/prometheus-cpp/pull/1#issuecomment-448426639
    example 
    opened by ruslo 0
  • Documentation for static checks

    Documentation for static checks

    Would be nice to have information on how to use static checks within CMake for projects.

    https://blog.kitware.com/static-checks-with-cmake-cdash-iwyu-clang-tidy-lwyu-cpplint-and-cppcheck/

    enhancement 
    opened by donny-dont 0
CMake checks cache helper modules – for fast CI CMake builds!

cmake-checks-cache Cross platform CMake projects do platform introspection by the means of "Check" macros. Have a look at CMake's How To Write Platfor

Cristian Adam 65 Dec 6, 2022
CMake scripts for painless usage of SuiteSparse+METIS from Visual Studio and the rest of Windows/Linux/OSX IDEs supported by CMake

CMake scripts for painless usage of Tim Davis' SuiteSparse (CHOLMOD,UMFPACK,AMD,LDL,SPQR,...) and METIS from Visual Studio and the rest of Windows/Lin

Jose Luis Blanco-Claraco 395 Dec 24, 2022
cmake-font-lock - Advanced, type aware, highlight support for CMake

cmake-font-lock - Advanced, type aware, highlight support for CMake

Anders Lindgren 39 Oct 2, 2022
cmake-avr - a cmake toolchain for AVR projects

cmake-avr - a cmake toolchain for AVR projects Testing the example provided The toolchain was created and tested within the following environment: Lin

Matthias Kleemann 163 Dec 5, 2022
Make CMake less painful when trying to write Modern Flexible CMake

Izzy's eXtension Modules IXM is a CMake library for writing Modern flexible CMake. This means: Reducing the amount of CMake written Selecting reasonab

IXM 107 Sep 1, 2022
CMake module to enable code coverage easily and generate coverage reports with CMake targets.

CMake-codecov CMake module to enable code coverage easily and generate coverage reports with CMake targets. Include into your project To use Findcodec

HPC 82 Nov 30, 2022
unmaintained - CMake module to activate certain C++ standard, feature checks and appropriate automated workarounds - basically an improved version of cmake-compile-features

Compatibility This library provides an advanced target_compile_features() and write_compiler_detection_header(). The problem with those is that they a

Jonathan Müller 74 Dec 26, 2022
[CMake] [BSD-2] CMake module to find ICU

FindICU.cmake A CMake module to find International Components for Unicode (ICU) Library Note that CMake, since its version 3.7.0, includes a FindICU m

julp 29 Nov 2, 2022
CMake project for BL602 RISC-V processor

bl602_cmake_base CMake project for BL602 RISC-V processor How to build NOTE : This project uses a pre-compiled version of the Buffalo SDK (bl_iot_sdk)

null 9 Jan 6, 2022
A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

Alexander Widerberg 1.4k Jan 4, 2023
curl cmake module libcurl build with msvc x86

curl-msvc Infomation curl cmake module libcurl build with MSVC10.0 arch (x86 | i386) source from https://github.com/curl/curl tags: curl-7_79_1 Usage

Jason Payne 0 May 16, 2022
NeoWorld is a resampler using the CMake build system

NeoWorld is a resampler using the CMake build system. It's designed for utsu, OpenUTAU, and UTAU.

null 5 Dec 23, 2022
A CMake addon that avoids you writing boilerplate code for resource management.

SHader INJ(I)ector SHINJI (originally SHader INJector) is a CMake addon that avoids you writing boilerplate code for resource management and exposes s

Lorenzo Rutayisire 6 Dec 14, 2022
A CMake starter template using CPM

Cmake Starter About A lightweight Cmake project meant for a binary application (not a shared library), tests with catch2 are configured, CPM is the pa

Matt Williams 1 Jul 14, 2022
Non-intrusive CMake dependency management

cmodule Non-intrusive CMake dependency management. Normally CMake's find_package() looks for packages installed on host system (and compiled for host

scapix.com 14 Sep 29, 2022
Simple library for embedding static resources into C++ binaries using CMake

libromfs libromfs is an easy way to bundle resources directly into any C++ application and access them through a simple interface. The main advantage

WerWolv 28 Nov 30, 2022
Project to enable using CMake from a Maven build.

CMake-Maven-Project Introduction A Maven project for the CMake build system. It can be used by including it as a plugin within your Maven project's po

null 60 Nov 14, 2022
Autotools-style configure script wrapper around CMake

configure-cmake configure-cmake is an autotools-style configure script for CMake-based projects. People building software on Linux or BSD generally ex

Evan Nemerson 82 Dec 14, 2022
Check for coding style issues in CMake files

cmakelint parses CMake files and reports style issues. cmakelint requires Python. Installation sudo pip install cmakelint Usage Syntax: cmakelint [--c

Richard Quirk 99 Dec 10, 2022