โ† All CPP Flashcard Decks

Build Systems & Package Management Flashcards

7 cards from real CPP practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Build Systems & Package Management flashcards as text
  1. In CMake, what does the `target_include_directories` command's `PUBLIC` keyword signify?

    Answer: Directories are added to the target and any target that links to it

    PUBLIC means the include directories apply both to the target itself and to any downstream targets that link against it.

  2. Which CMake generator is commonly used to produce Ninja build files?

    Answer: -G "Ninja"

    The `-G "Ninja"` flag tells CMake to generate Ninja build files instead of Makefiles.

  3. What is the purpose of `vcpkg integrate install` on Windows?

    Answer: Makes vcpkg libraries automatically available to MSBuild and Visual Studio projects

    `vcpkg integrate install` wires vcpkg into MSBuild so installed libraries are found automatically in Visual Studio.

  4. In a Makefile, what does the special target `.PHONY` accomplish?

    Answer: Declares targets that are not actual files, preventing conflicts with same-named files

    `.PHONY` tells make that a target name is a label for a recipe, not a real file, so it always runs.

  5. Which CMake command sets a compile definition only for a specific target without affecting others?

    Answer: target_compile_definitions()

    `target_compile_definitions()` scopes preprocessor definitions to a single named target.

  6. What does `conan install . --build=missing` do when a prebuilt binary is not available?

    Answer: Downloads source and builds the package from source

    `--build=missing` instructs Conan to compile any package for which no compatible prebuilt binary exists.

  7. In CMake, what is the difference between `add_library(mylib STATIC ...)` and `add_library(mylib SHARED ...)`?

    Answer: STATIC creates an archive linked at compile time; SHARED creates a dynamic library linked at runtime

    STATIC produces a `.a`/`.lib` archive embedded in the executable, while SHARED produces a `.so`/`.dll` loaded at runtime.