2014-12-17 12:09:14 +03:00
|
|
|
# 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
|
2015-02-18 19:38:33 +03:00
|
|
|
caffe_set_runtime_directory(${name} "${PROJECT_BINARY_DIR}/tools")
|
2014-12-17 12:09:14 +03:00
|
|
|
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 bin)
|
2014-07-01 11:56:20 +04:00
|
|
|
endforeach(source)
|