-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
52 lines (35 loc) · 1.44 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 2.8)
project(luaOpenCV)
option(BUILD_TESTS "Builds the unit test" TRUE)
option(LOCAL_LUA_DIRECTORY "local lua library directory" "third_party/lua-5.3.3")
set(LOCAL_LUA_DIRECTORY "third_party/lua-5.3.3")
include(cmake/FindLua.cmake)
set(CMAKE_PREFIX_PATH third_party/opencvlib)
FIND_PACKAGE(OpenCV 3.1.0 REQUIRED)
include_directories(BEFORE ${LUA_INCLUDE_DIRS})
link_directories(${LUA_LIBRARY_DIRS})
include_directories(third_party/kaguya/include)
include_directories(BEFORE ${OpenCV_INCLUDE_DIRS})
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
else(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(MSVC)
set(LUA_OPENCV_SRCS src/raw_bind.cc src/manual_bind.cc)
add_library(cv SHARED ${LUA_OPENCV_SRCS})
target_link_libraries(cv ${OpenCV_LIBS} ${LUA_LIBRARIES})
if(BUILD_TESTS)
enable_testing()
include_directories(third_party/googletest/googletest/include)
include_directories(third_party/googletest/googletest/)
set(GTEST_SRCS third_party/googletest/googletest/src/gtest-all.cc)
set(LUA_OPENCV_TEST_SRCS
test/test_main.cc
test/test_mat.cc
test/test_draw.cc
test/test_type.cc
test/test_image.cc)
add_executable(test_runner ${GTEST_SRCS} ${LUA_OPENCV_SRCS} ${LUA_OPENCV_TEST_SRCS})
target_link_libraries(test_runner ${OpenCV_LIBS} ${LUA_LIBRARIES})
add_test(NAME cvbind_test COMMAND test_runner WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
endif(BUILD_TESTS)