martinmoene / span-lite

span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library
Boost Software License 1.0
494 stars 40 forks source link

CMakeLists.txt - Missing include directory for BUILD_INTERFACE #23

Closed meldavis closed 6 years ago

meldavis commented 6 years ago

The CMakeLists.txt sets the target_include_directories to an uninitialized variable.

https://github.com/martinmoene/span-lite/blob/c85c2fdb246b3654e0efea027243ceba8103ff71/CMakeLists.txt#L24-L25

Should be:

target_include-directories(
   ${package_name} INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
martinmoene commented 6 years ago

Thanks @meldavis . For now, I'll add

set( include_source_dir "${PROJECT_SOURCE_DIR}/include" )

This may lateron be followed with a CMake package definition, like the one of gsl-lite.