ryanhaining / cppitertools

Implementation of python itertools and builtin iteration functions for C++17
https://twitter.com/cppitertools
BSD 2-Clause "Simplified" License
1.37k stars 115 forks source link

Can't use as subproject #95

Closed Naville closed 1 year ago

Naville commented 1 year ago
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/vendor/cppitertools ${CMAKE_CURRENT_BINARY_DIR}/cppitertools/)
target_link_libraries(MyTOOL PUBLIC cppitertools)

Results in :

CMake Error in cmake/modules/CMakeLists.txt:
  export called with target "MyTOOL" which requires target "cppitertools"
  that is not in any export set.
ryanhaining commented 1 year ago

I actually have never maintained cmake files myself, they are community contributed. Do you happen know anything about this error?

Naville commented 1 year ago

Yeah you need a install/export combination so the parent project can see the target

ryanhaining commented 1 year ago

If you know what to write and want to send a pr I will add it. If I knew anything about CMake I would try, but I only really maintain scons and bazel builds.