1)万能神器
cmake .. -DCMAKE_INSTALL_PREFIX=./install && cmake --build . && cmake --install .
2)glfw源码安装
message(STATUS " cd glfw-3.3-stable && mkdir build && cd build")
message(STATUS " cmake .. -DCMAKE_INSTALL_PREFIX=./install && cmake --build . && cmake --install .")
message(STATUS " then set glfw3_DIR before `find_package(glfw3)`")
3)设置
#----------------------------------------------------------------------#
# glfw
#----------------------------------------------------------------------#
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(glfw3_DIR "E:/artifacts/glfw/3.3.5/vs2019-x64/lib/cmake/glfw3" CACHE PATH "Directory that contains glfw3Config.cmake")
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(glfw3_DIR "/thfs1/home/***/tianya/b4.libs/smallcv/glfw-master/build/install/lib/cmake/glfw3" CACHE PATH "Directory that contains glfw3Config.cmake")
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(glfw3_DIR "" CACHE PATH "Directory that contains glfw3Config.cmake")
endif()
里面确实有glfw3Config.cmake
4)对于GTest,可以设置成不包含
把下面的ON改成OFF即可,就不用安装GTest了
option(SMALLCV_TEST "build test?" off)
5)继续神器:
cmake .. -DCMAKE_INSTALL_PREFIX=./install && cmake --build . && cmake --install .