forked from BVLC/caffe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
30 lines (23 loc) · 812 Bytes
/
CMakeLists.txt
File metadata and controls
30 lines (23 loc) · 812 Bytes
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
# Collect source files
file(GLOB_RECURSE srcs ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
# Build each source file independently
foreach(source ${srcs})
get_filename_component(name ${source} NAME_WE)
# caffe target already exits
if(name MATCHES "caffe")
set(name ${name}.bin)
endif()
# target
add_executable(${name} ${source})
target_link_libraries(${name} ${Caffe_LINK})
caffe_default_properties(${name})
# set back RUNTIME_OUTPUT_DIRECTORY
caffe_set_runtime_directory(${name} "${PROJECT_BINARY_DIR}/tools")
caffe_set_solution_folder(${name} tools)
# restore output name without suffix
if(name MATCHES "caffe.bin")
set_target_properties(${name} PROPERTIES OUTPUT_NAME caffe)
endif()
# Install
install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach(source)