ubuntu下CMake编译生成动态库和静态库,以OpenTLD为例。

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u014365862/article/details/78663269


迅速上手,能随便跑起来的OpenTLD

opencv2.4.8,下载:Here.


ubuntu下CMake编译生成动态库(.so)和静态库(.a),以OpenTLD为例。

直接看CMakeLists.txt吧。

cmake_minimum_required( VERSION 2.8 )



set(PROJECT_NAME OpenTLD)  

project(${PROJECT_NAME})    



configure_file(h2.mp4 h2.mp4 COPYONLY)

configure_file(parameters.yml parameters.yml COPYONLY)



# Find necessary packages

# OpenCV  

# find_package(OpenCV REQUIRED)

# include_directories(${OpenCV_INCLUDE_DIRS})

include_directories(/usr/local/include/)

LINK_DIRECTORIES(/usr/local/lib/)



# matlab  

include_directories(${PROJECT_SOURCE_DIR}/include/)

LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib/)



# .so

# add_library(tld SHARED TLD.cpp)

# .a

# add_library(tld STATIC TLD.cpp)



add_library(tld_utils STATIC tld_utils.cpp)

add_library(LKTracker STATIC LKTracker.cpp)

add_library(ferNN STATIC FerNNClassifier.cpp)

add_library(tld STATIC TLD.cpp)

     

set(SRCS OpenTLD.cpp)  

add_executable(${PROJECT_NAME} ${SRCS})





target_link_libraries(${PROJECT_NAME} tld LKTracker ferNN tld_utils)

# target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES}) 

target_link_libraries(${PROJECT_NAME} -lopencv_highgui -lopencv_core -lopencv_nonfree -lopencv_legacy -lopencv_video -lopencv_imgproc) 


展开阅读全文

没有更多推荐了,返回首页