arun11299 / cpp-jwt

JSON Web Token library for C++
MIT License
396 stars 111 forks source link

INCLUDES not exported by cmake #65

Closed dempo93 closed 4 years ago

dempo93 commented 4 years ago

Importing the target cpp-jwt::cpp-jwt by means of target_link_libraries(target PUBLIC cpp-jwt::cpp-jwt) results in a compilation error

Cannot open include file: 'jwt/jwt.hpp': No such file or directory

This can be easily avoided by modifying the following install command

install(
  TARGETS ${PROJECT_NAME}
  EXPORT ${PROJECT_NAME}Targets
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

and add an INCLUDES directive

install(
  TARGETS ${PROJECT_NAME}
  EXPORT ${PROJECT_NAME}Targets
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
dempo93 commented 4 years ago

Got confused by my own customization of the CMakeLists file. gonna close