test case fix for Clip layer gradient
[platform/upstream/caffe.git] / tools / CMakeLists.txt
1 # Collect source files
2 file(GLOB_RECURSE srcs ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
3
4 # Build each source file independently
5 foreach(source ${srcs})
6   get_filename_component(name ${source} NAME_WE)
7
8   # caffe target already exits
9   if(name MATCHES "caffe")
10     set(name ${name}.bin)
11   endif()
12
13   # target
14   add_executable(${name} ${source})
15   target_link_libraries(${name} ${Caffe_LINK})
16   caffe_default_properties(${name})
17
18   # set back RUNTIME_OUTPUT_DIRECTORY
19   caffe_set_runtime_directory(${name} "${PROJECT_BINARY_DIR}/tools")
20   caffe_set_solution_folder(${name} tools)
21
22   # restore output name without suffix
23   if(name MATCHES "caffe.bin")
24     set_target_properties(${name} PROPERTIES OUTPUT_NAME caffe)
25   endif()
26
27   # Install
28   install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_BINDIR})
29
30 endforeach(source)