I'm trying to integrating ome-files in a CMake C++ project. In my hands, the following is a minimal CMakeLists.txt to successfully build a ome-files project. I am building on macOS 10.12.6 with clang 4.0.
cmake_minimum_required(VERSION 3.9)
project(ome-test)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_PREFIX_PATH "$ENV{OME_FILES_ROOT}")
find_package(Boost COMPONENTS log iostreams) # <- Build fails without this line
find_package(OMEXML REQUIRED)
find_package(OMEFiles REQUIRED)
include_directories($ENV{OME_FILES_ROOT}/include)
add_executable(ome-test main.cpp)
target_link_libraries(ome-test OME::Files)
CMake Error at CMakeLists.txt:14 (add_executable):
Target "ome-test" links to target "Threads::Threads" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:14 (add_executable):
Target "ome-test" links to target "Threads::Threads" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:14 (add_executable):
Target "ome-test" links to target "Boost::log_setup" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:14 (add_executable):
Target "ome-test" links to target "Boost::log" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:14 (add_executable):
Target "ome-test" links to target "Boost::iostreams" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
[SNIP]
CMake Error at CMakeLists.txt:14 (add_executable):
Target "ome-test" links to target "Boost::filesystem" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
I have the build working now but thought I'd let you know as it look a while to figure this out.