2014-07-01 11:56:20 +04:00
|
|
|
project( Tools )
|
|
|
|
|
|
|
|
# Find all source files
|
2014-08-17 11:26:35 +04:00
|
|
|
file(GLOB_RECURSE TOOLS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
2014-07-01 11:56:20 +04:00
|
|
|
|
2014-09-28 11:11:05 +04:00
|
|
|
set (CAFFE_WHOLE_LINK -Wl,--whole-archive caffe -Wl,--no-whole-archive)
|
|
|
|
|
2014-07-01 11:56:20 +04:00
|
|
|
# Build each source file independently
|
2014-08-17 11:26:35 +04:00
|
|
|
foreach(source ${TOOLS_SOURCES})
|
2014-07-01 11:56:20 +04:00
|
|
|
get_filename_component(name ${source} NAME_WE)
|
2014-08-17 11:28:14 +04:00
|
|
|
add_executable(${name}.bin ${source})
|
|
|
|
set_target_properties(${name}.bin PROPERTIES OUTPUT_NAME ${name})
|
2014-09-28 11:11:05 +04:00
|
|
|
target_link_libraries(${name}.bin ${CAFFE_WHOLE_LINK})
|
2014-07-01 11:56:20 +04:00
|
|
|
|
|
|
|
### Install #################################################################################
|
|
|
|
|
2014-08-17 11:28:14 +04:00
|
|
|
install(TARGETS ${name}.bin DESTINATION tools)
|
2014-07-01 11:56:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
endforeach(source)
|
|
|
|
|