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
Which CMake function is used to locate an external package and import its targets?
Answer: find_package()
`find_package()` searches for a package's CMake config or Find module and makes its imported targets available.
In a vcpkg `vcpkg.json` manifest, how do you specify a minimum version for a dependency?
Answer: "version-gte": "1.2.0" inside the dependency object
vcpkg.json uses `"version-gte"` inside a dependency's constraint object to express a minimum version requirement.
What does the `PRIVATE` keyword mean in `target_link_libraries(myapp PRIVATE mylib)`?
Answer: mylib is linked into myapp but not propagated to targets that link against myapp
PRIVATE means the dependency is an implementation detail of myapp and is not exposed to downstream consumers.
Which Make variable is conventionally used to pass extra compiler flags without overwriting the default `CXXFLAGS`?
Answer: AM_CXXFLAGS
In Automake, `AM_CXXFLAGS` appends flags set by the developer without clobbering user-supplied `CXXFLAGS`.
What command regenerates CMake build files when `CMakeLists.txt` changes without a full reconfigure?
Answer: Running `make` or `ninja` triggers automatic re-invocation of cmake
CMake embeds a check in generated build files so that running the build tool automatically re-runs cmake when `CMakeLists.txt` or cache entries change.
In Conan 2.x, what file replaces the older `conanfile.txt` for projects needing Python scripting logic?
Answer: conanfile.py
`conanfile.py` is a Python script that gives full programmatic control over dependencies, settings, and build steps in Conan.
When using CMake's `ExternalProject_Add`, what phase does the `BUILD_COMMAND` argument control?
Answer: The compile/build step after configure
`BUILD_COMMAND` overrides the command used to compile the external project after it has been configured.