So I have a library and some associated headers and a little driver.
proj
include
blob.dylib
header1.h
header2.h
src
driver.cpp
I would like to rebundle this into a modern cmake target for find_package
as well as make it accessible when included in some users tree. I was planning on following a guide to enable the library install and etc, but I haven't got that far because I am running into an error.
Currently my cmake file looks like this
cmake_minimum_required(VERSION 3.5)
project(EVAPI VERSION 1.1.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
add_executable(libBlobAPI
src/driver.cpp
)
find_library(BLOB blob)
target_link_libraries(libBlobAPI
BLOB
)
target_include_directories(libBlobAPI
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
but this fails with error:
ld: library not found for -linclude/libBlobAPI.dylib
The question is... What is the canonical way to repackage a library with modern CMake?