-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
41 lines (31 loc) · 1.21 KB
/
Copy pathCMakeLists.txt
File metadata and controls
41 lines (31 loc) · 1.21 KB
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
cmake_minimum_required(VERSION 2.8)
# change paths to your C++ compiler
# set( CMAKE_C_COMPILER /opt/local/bin/gcc-mp-5 )
# set( CMAKE_CXX_COMPILER /opt/local/bin/g++-mp-5 )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 " )
project( bewis )
# Find OpenCV
find_package(OpenCV REQUIRED)
# Find OpenMP
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
# Build wizard Library
# Build bemis program
set(BGWIZSRC_NAME wisardlib/bgwis.cpp)
set(MAINSRC_NAME bewis.cpp)
set(MAINSRC_NAMEX bewisx.cpp)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ./wisardlib)
set(LIB_NAME wisard)
set(BIN_NAME bewis)
set(BIN_NAMEX bewisx)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
add_library(${LIB_NAME} SHARED ${BGWIZSRC_NAME} wisardlib/wisard.cpp wisardlib/wnet_lib.cpp)
target_link_libraries( ${LIB_NAME} ${OpenCV_LIBS})
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
add_executable(${BIN_NAME} ${MAINSRC_NAME})
target_link_libraries(${BIN_NAME} ${LIB_NAME} ${OpenCV_LIBS})
add_executable(${BIN_NAMEX} ${MAINSRC_NAMEX})
target_link_libraries(${BIN_NAMEX} ${LIB_NAME} ${OpenCV_LIBS})