Switching between GCC and Clang/LLVM using CMake

CMake honors the environment variables CC and CXX upon detecting the C and C++ compiler to use: $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ $ cmake .. — The C compiler identification is Clang — The CXX compiler identification is Clang The compiler specific flags can be overridden by putting them into a make override file … Read more

Using CMake with GNU Make: How can I see the exact commands?

When you run make, add VERBOSE=1 to see the full command output. For example: cmake . make VERBOSE=1 Or you can add -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON to the cmake command for permanent verbose command output from the generated Makefiles. cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON . make To reduce some possibly less-interesting output you might like to use the following options. The … Read more

What is CMake equivalent of ‘configure –prefix=DIR && make all install ‘?

You can pass in any CMake variable on the command line, or edit cached variables using ccmake/cmake-gui. On the command line, cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr . && make all install Would configure the project, build all targets and install to the /usr prefix. The type (PATH) is not strictly necessary, but would cause the Qt based cmake-gui … Read more

Looking for a ‘cmake clean’ command to clear up CMake output

CMake 3.X CMake 3.X offers a ‘clean’ target. cmake –build C:/foo/build/ –target clean From the CMake docs for 3.0.2: –clean-first = Build target ‘clean’ first, then build. (To clean only, use –target ‘clean’.) CMake 2.X There is no cmake clean in CMake version 2.X I usually build the project in a single folder like “build”. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)