I have an external library here:
${PROJECT_SOURCE_DIR}/thirdparty/yaml-cpp/
Runs Makefile: thirdparty/Makefile . I execute this make file as follows:
add_custom_target( yaml-cpp COMMAND make WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/thirdparty )
Then I try to link the library which is building on thirdparty/yaml-cpp/build/libyaml-cpp.a . This is the part that does not work :
target_link_libraries(load_balancer_node ${CMAKE_SOURCE_DIR}/thirdparty/yaml-cpp/build/libyaml-cpp.a)
I get an error message:
Target "yaml-cpp" of type UTILITY may not be linked into another target. One may link only to STATIC or SHARED libraries, or to executables with the ENABLE_EXPORTS property set.
How to execute this make file and link the .a file?
source share