CMake ensuring tests link to built, not installed library
I have an issue very similar to How can I point C++ tests to my build-directory copy of my library and not to the installed library when LD_LIBRARY_PATH points to the installed one? but unrelated to LD_LIBRARY_PATH
.
CMake variable naming the C++ standard library implementation or path
CMake as used to compile C++ code has a variable CMAKE_CXX_COMPILER_ID
that generally identifies the compiler in use as GCC, Clang, MSVC, Nvidia, etc. Is there a similar variable that identifies that C++ standard library implementation that will be referenced in the build? E.g. like “libstdc++” (from GCC), “libc++” (from LLVM), “MSVC++” (Microsoft), “stlport” (various ancient C++ implementations shipped with this).
How to enable jemalloc’s memory profiling by default?
It is recommended to set MALLOC_CONF
before running a certain program.
Cmake: Fetch content and link dependency
I use FetchContent to get the library (GLFW) and try to use dependencies inside the “deps” folder.
How to debug a cmake-built binary that crashes in Release mode but not in Debug nor in RelWithDebInfo mode?
I’m developing an audio plugin that’s supposed to run inside another (host) program. In most hosts this works fine but there’s one in particular that causes my plugin to crash.
CommonApi cmake error: source directory does not exist while using different toolchain
I’m a beginner of camke and trying to use CommonApi on my platfrom
Check if header has been generated using cmake
Let’s say I have two files main.cpp
and generate_header.cpp
. generate_header.cpp
generates a header containing data that main.cpp
needs to run. based on this answer, I can use the following code to run generate_header.cpp
before building main.cpp
:
CMake cannot find a package configuration file “libpqxx-config.cmake” that is here, at its expected place in the build directory?
My CMake build preparation cannot find a package configuration file
(run below with few of its --trace-expand
values)
CMake cannot find a a package configuration file “libpqxx-config.cmake” that is here, at its expected place in the build directory?
My CMake build preparation cannot find a package configuration file
(run below with few of its --trace-expand
values)
C++: cc1plus: all warnings being treated as errors only in Debug mode
I recently migrated my C++ application from a native RHEL 7 application to a container (UBI9.4) running for now on RHEL 9 and I get some warnings when compiling. For some reason this causes the compilation to fail with cc1plus: all warnings being treated as errors
. What´s strange is that it only happens when I set the build variant to Debug. With Release and RelWithDebInfo it works just fine.