环境:Linux CMake
修改CMakeLists.txt
同时将模块编译生成动态库和静态库的方法:
ADD_LIBRARY(nyutil SHARED ${SRC_LIST})
ADD_LIBRARY(nyutil_static STATIC ${SRC_LIST})
SET_TARGET_PROPERTIES(nyutil_static PROPERTIES OUTPUT_NAME "nyutil")
SET_TARGET_PROPERTIES(nyutil PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(nyutil_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
将模块同时编译生成.a和.so
本文出自 “None” 博客,请务必保留此出处http://evely.blog.51cto.com/1089422/1864456
原文地址:http://evely.blog.51cto.com/1089422/1864456