forked from Sologala/pyStag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
79 lines (59 loc) · 1.62 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
project(Stag)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
ENDIF()
MESSAGE("Build type: " ${CMAKE_BUILD_TYPE})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -w ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -w ")
# Check C++11 or C++0x support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(OpenCV REQUIRED)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
file(GLOB SRC_FILE1 "src/*.c*")
file(GLOB SRC_FILE2 "src/ED/*.c*")
include_directories(
${OpenCV_INCLUDE_DIRS}
src/
src/ED/
)
add_library(
LibStag SHARED
${SRC_FILE1}
${SRC_FILE2}
)
target_link_libraries(
LibStag
${OpenCV_LIBS}
)
# for pybind11
include_directories(
pybindSrc/opencv2numpy
# You need to change this follow Path to your own Path.
# "# You need to change this follow Path to your own Path. "
# "# You need to change this follow Path to your own Path. "
# "# You need to change this follow Path to your own Path. "
# "# You need to change this follow Path to your own Path. "
/Users/bytedance/anaconda3/lib/python3.8/site-packages/numpy/core/include
)
add_subdirectory(pybindSrc/pybind11)
pybind11_add_module(pyStag
pybindSrc/pyStag.cpp
pybindSrc/opencv2numpy/converter.cpp
)
target_link_libraries(pyStag
${OpenCV_LIBS}
LibStag
)
# for c++
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/app)
add_executable(
testrun
main.cpp
)
target_link_libraries(
testrun
LibStag
)