CMakeList.txt 中使用了缓存,应该可以加速编译,但是会影响到其他数据包,以后在ros包里遇到这样CACHE的变量要注意啊!
cpp
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
MESSAGE(STATUS "Setting build type to 'Release' as none was specified.")
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the build type" FORCE)
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Coverage" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
ENDIF()
其实可以把CACHE去掉,再编译就没有问题了。
cpp
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
MESSAGE(STATUS "Setting build type to 'Release' as none was specified.")
SET(CMAKE_BUILD_TYPE Release)
ENDIF()
不知道有没有遇到过的朋友,一起来解释一下