-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (47 loc) · 1.65 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
cmake_minimum_required(VERSION 2.4)
PROJECT(sliceMe)
#set(SLICEME_DIR ${CMAKE_SOURCE_DIR})
set(SLICEME_DIR ${PROJECT_SOURCE_DIR})
include(CMakeLists_common.txt)
####################################################################### LIBRARY
add_library(superpixel
${SLICEME_FILES}
)
TARGET_LINK_LIBRARIES(superpixel ${OPENCV_LIBRARIES} ${SUPERPIXEL_LIBRARY})
if(UNIX)
SET_TARGET_PROPERTIES(superpixel PROPERTIES COMPILE_FLAGS -fPIC)
endif(UNIX)
SET_TARGET_PROPERTIES(superpixel PROPERTIES ENABLE_EXPORTS TRUE)
###################################################################### BINARIES
SET_SOURCE_FILES_PROPERTIES( ${SLICEME_DIR}/core/train.c ${INFERENCE_FILES} ${SLICEME_FILES} PROPERTIES LANGUAGE CXX )
SET_SOURCE_FILES_PROPERTIES( ${SLICEME_DIR}/core/getopt_long.c ${SLICEME_DIR}/core/getopt.h ${SLICEME_DIR}/core/getopt.c PROPERTIES LANGUAGE C )
if(WIN32)
set(INFERENCE_FILES_WIN32
${SLICEME_DIR}/core/gettimeofday.c
${SLICEME_DIR}/core/getopt.c
${SLICEME_DIR}/core/getopt_long.c
)
endif()
ADD_EXECUTABLE(train
${SLICEME_DIR}/core/train.c
${INFERENCE_FILES}
${SLICEME_FILES}
${INFERENCE_FILES_WIN32}
)
TARGET_LINK_LIBRARIES(train ${SLICEME_THIRD_PARTY_LIBRARIES})
ADD_EXECUTABLE(predict
${SLICEME_DIR}/core/predict.cpp
${INFERENCE_FILES}
${SLICEME_FILES}
${INFERENCE_FILES_WIN32}
)
TARGET_LINK_LIBRARIES(predict ${SLICEME_THIRD_PARTY_LIBRARIES})
set(BUILD_PREDICT_MBEST ON CACHE BOOL "build also predict mbest (only supported in linux)")
if(BUILD_PREDICT_MBEST)
ADD_EXECUTABLE(predict_mbest
${SLICEME_DIR}/core/predict_mbest.cpp
${INFERENCE_FILES}
${SLICEME_FILES}
)
TARGET_LINK_LIBRARIES(predict_mbest ${SLICEME_THIRD_PARTY_LIBRARIES})
endif(BUILD_PREDICT_MBEST)