how to link .so files with CMake [duplicate]
问题 This question already has answers here : cmake and libpthread (4 answers) Undefined reference to pthread_create in Linux (14 answers) Closed yesterday . I want to rebuild a simple application based on a .cpp, a .h and multiple .so files. From what i've seen, my CMakeLists.txt should be like this : cmake_minimum_required(VERSION 3.5) set(CMAKE_CXX_STANDARD 11) project(test C CXX) add_executable(${PROJECT_NAME} main.cpp) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/lib)