基础的CMakeLists.txt的样例

15 篇文章 0 订阅
7 篇文章 0 订阅
cmake_minimum_required(VERSION 2.8)

project(inpainting)

find_package(OpenCV REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS} "inc")

#这部分是c++11的设置
if(CMAKE_VERSION VERSION_LESS "3.1")
    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        set(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")    
    endif()        
else()
	set(CMAKE_CXX_STANDARD 11)
endif()

if (WIN32)
	add_definitions("-D_SCL_SECURE_NO_WARNINGS")
endif()


# Library

add_library(inpaint 
	inc/inpaint/stats.h
	inc/inpaint/patch.h
	inc/inpaint/gradient.h
    inc/inpaint/integral.h
    inc/inpaint/timer.h
	inc/inpaint/criminisi_inpainter.h
	inc/inpaint/template_match_candidates.h
	inc/inpaint/patch_match.h
	src/criminisi_inpainter.cpp
	src/template_match_candidates.cpp
	src/patch_match.cpp
)
	
target_link_libraries(inpaint ${OpenCV_LIBRARIES})
	
# Samples

add_executable(inpaint_image_criminisi examples/inpaint_image_criminisi.cpp)
target_link_libraries(inpaint_image_criminisi inpaint ${OpenCV_LIBRARIES})

add_executable(patch_match examples/patch_match.cpp)
target_link_libraries(patch_match inpaint ${OpenCV_LIBRARIES})

# Tests

include_directories("tests")
add_executable(inpaint_tests 
	tests/catch.hpp
	tests/gradient.cpp
	tests/patch.cpp
    tests/integral.cpp
	tests/criminisi_inpainter.cpp
    tests/template_match_candidates.cpp
	tests/patch_match.cpp
)
target_link_libraries (inpaint_tests inpaint ${OpenCV_LIBRARIES})

# Benchmarks

include_directories("benchmarks")
add_executable(inpaint_benchmarks 
	benchmarks/catch.hpp
	benchmarks/patch.cpp	
)
target_link_libraries (inpaint_benchmarks inpaint ${OpenCV_LIBRARIES})

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值