cmake增加调试选项

1
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

指定安装路径

1
cmake -DCMAKE_INSTALL_PREFIX=path_to_install -DCMAKE_BUILD_TYPE=Release
1
set(CMAKE_INSTALL_PREFIX path_to_install)

明明有so却ldd没有

是因为少了这个命令:

1
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH