From 2.8.12, CMake disallow the mix of plain and keword
target_link_libraries signature (CMP0023).
This policy results in cmake configuration failure when BUILD_COVERAGE
is turned on.
This commit revises add_nncc_library in order to enforce the use of keyword
signature (e.g. PUBLIC) for following target_link_library calls.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
add_library(${ARGV})
if(ENABLE_COVERAGE)
target_compile_options(${ARGV0} PUBLIC -g -O0 -fprofile-arcs -ftest-coverage)
- target_link_libraries(${ARGV0} gcov)
+ target_link_libraries(${ARGV0} PUBLIC gcov)
+ else()
+ # NOTE This line disallows target_link_libraries call with plain signature
+ target_link_libraries(${ARGV0} PUBLIC c)
endif(ENABLE_COVERAGE)
endfunction(add_nncc_library)
add_nncc_library(nncc_frontend_caffe_core ${CAFFE_PROTO_SOURCES})
target_include_directories(nncc_frontend_caffe_core PUBLIC ${CAFFE_PROTO_INCLUDE_DIRS})
-target_link_libraries(nncc_frontend_caffe_core libprotobuf)
+target_link_libraries(nncc_frontend_caffe_core PRIVATE libprotobuf)
add_nncc_example_executable(caffe_core_io_example examples/caffe_core_io.cpp)
nncc_target_link_libraries(caffe_core_io_example nncc_frontend_caffe_core)