我有这段CMake代码:
if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set ( CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" )
endif()
message ( "CMAKE_INSTALL_PREFIX: " ${CMAKE_INSTALL_PREFIX} )
我第一次运行cmake时,它会正确显示CMAKE_INSTALL_PREFIX指向我的build_dir / install
我第二次运行cmake,它返回到/ usr / local。
怎么了?