cppunitlite的代码就不用上了哈,反正都可以随便下的,而且成熟。
主要是学习下CMAKE怎么build库文件吧。
跨平台 的哦,当然会方便多了,而且 build的过程中,可以随便建立一个目录b,然后在b的目录下,
cmake cppunitlite的目录就OK了,还不影响 代码的完整性。写测试程序的时候我们也可以随意使用了。
CMakeLists.txt
project(CPPUNITLITE_LIBRARY)
set(CPPUNITLITE_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
CACHE INTERNAL "cppunitlite include directories"
)
# cppunitlite lib and dependencies
# saves the variable in internal cache for later use
set(CPPUNITLITE_LIBRARY
cppunitlite
CACHE INTERNAL "cppunitlite library"
)
SET( CPPUNITLITE_SRCS
failure.cpp
simplestring.cpp
test.cpp
testregistry.cpp
testresult.cpp
)
ADD_DEFINITIONS( -D_CRT_SECURE_NO_DEPRECATE )
ADD_LIBRARY (${CPPUNITLITE_LIBRARY} ${CPPUNITLITE_SRCS})
|
阅读(2164) | 评论(0) | 转发(0) |