#cmake变量BUILD_SHARED_LIB 是一个全局变量
set(BUILD_SHARED_LIBS OFF)
#例如设置使用opencv的静态库
if(NOT DEFINED OpenCV_STATIC)
# look for global setting
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
set(OpenCV_STATIC OFF)
else()
set(OpenCV_STATIC ON)
endif()
版权声明:本文为idream68原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。