Skip to content

Tag: cmake

Shared library on Linux and -fPIC error

I am trying to compile a shared library in Linux using a Makefile created with Cmake, but running make I obtain the following error: I provide the following command in the CMakeLists.txt in order to say that I want a shared (.so) library: add_library(cpp-lib SHARED ${CPP_FILES}) What else do I need to specify…

How to tell CMake where to put build files?

I want to tell CMake to output files and folders to a different folder instead of the current folder. I’m talking about the generated files by CMake below: file: CMakeCache.txt dir: CMakeFiles/ file: Makefile dir: bin/ file: cmake_install.cmake Is there a way to let CMake output these files and folders …

CMake complains “The CXX compiler identification is unknown”

I am following this thread and this one to build my own KDE without a sudo permission. Since there was no Git and CMake installed on the workstation. I just had them both installed under /home/< user> and added /home/< user>/bin and /home/< user>/lib to both PATH and LD_LIBRARY_PATH. Since K…