Closed ferdymercury closed 3 years ago
In the new version, maybe something like https://cmake.org/cmake/help/v3.9/manual/cmake-packages.7.html#id16 could do the job:
file (GLOB HEADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/include "*.hpp")#https://stackoverflow.com/questions/275868/how-to-automatically-add-header-files-to-project
install(
FILES
${HEADER_FILES}
DESTINATION
include
COMPONENT
Devel
)
It's even simpler than this: in "modern" CMake versions, target_link_libraries
can take care of everything so your CMakeLists.txt can just contain
cmake_minimum_required(VERSION 3.5)
project(test-odil-external)
cmake_policy(SET CMP0074 NEW)
find_package(Odil 0.12.0 REQUIRED)
add_executable(foo foo.cpp)
target_link_libraries(foo Odil::libodil)
(doc updated in 802c748)
Great, works now, thanks!
Before the latest commits https://github.com/lamyj/odil/commit/928da234f38c176c0b8142fa20fe1b796ab5a2d0 from September, the following was working:
Now, however, ODIL_INCLUDE_DIRS is not defined any more, and the compilation fails as the headers are no longer found. Is there an alternative way to do this now? Maybe the README can be updated to reflect it?
Thanks for your help!