-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
61 lines (46 loc) · 1.69 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
cmake_minimum_required(VERSION 2.8)
set (CMAKE_CXX_STANDARD 14)
project(HighQualityEllipseDetector)
#matlab_add_mex(NAME mex_file_name SRC source_file.cpp)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
find_package(OpenCV REQUIRED)
include_directories("../Eigen")
include_directories(${OpenCV_INCLUDE_DIRS})
set(SOURCES
main.cpp
generateEllipseCandidates.cpp
)
set(HEADERS
)
SOURCE_GROUP("Source Files" FILES ${SOURCES})
SOURCE_GROUP("Header Files" FILES ${HEADERS})
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
set_target_properties( ${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:${PROJECT_NAME}>")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
option(BuildMatlabMexs "Build mex functions for MATLAB scripts" OFF)
if(BuildMatlabMexs)
set(Matlab_ROOT_DIR "c:/Program Files (x86)/MATLAB/R2016a")
find_package(Matlab)
set(MEX1_SOURCES
generateEllipseCandidates_mex.cpp
generateEllipseCandidates.cpp
)
set(MEX1_HEADERS
)
SOURCE_GROUP("Mex Source Files" FILES ${MEX1_SOURCES})
SOURCE_GROUP("Mex Header Files" FILES ${MEX1_HEADERS})
matlab_add_mex(NAME generateEllipseCandidates SRC ${MEX1_SOURCES})
target_link_libraries(generateEllipseCandidates ${OpenCV_LIBS})
set(MEX2_SOURCES
fitEllipse_mex.cpp
)
set(MEX2_HEADERS
)
SOURCE_GROUP("Mex Source Files" FILES ${MEX1_SOURCES})
SOURCE_GROUP("Mex Header Files" FILES ${MEX1_HEADERS})
matlab_add_mex(NAME fitEllipse SRC ${MEX2_SOURCES})
target_link_libraries(fitEllipse ${OpenCV_LIBS})
endif()