SET(JWT_SOURCE_DIRS
  jwt
  base64
  validators
  validators/claims
  util
  jwe
)

FOREACH( DIR ${JWT_SOURCE_DIRS} )
  AUX_SOURCE_DIRECTORY(${DIR} JWT_SRC)
  SET(JWT_SRC ${JWT_SRC} ${SRC} )
ENDFOREACH( DIR ${JWT_SOURCE_DIRS} )

FILE(GLOB JWT_HDR include/jwt/*.h??)


ADD_LIBRARY(jwt ${JWT_SRC} ${JWT_HDR})
IF(UNIX)
    TARGET_LINK_LIBRARIES (jwt ${OPENSSL_LIBRARIES})
    SET_PROPERTY(TARGET jwt PROPERTY CXX_STANDARD 11)
ELSEIF(MSVC)
    TARGET_LINK_LIBRARIES (jwt libcrypto libssl)
ENDIF(UNIX)

IF(UNIX AND ENABLE_GPERF_TOOLS MATCHES "ON")
    TARGET_LINK_LIBRARIES(jwt-cpp profiler)
    TARGET_LINK_LIBRARIES(jwt-cpp tcmalloc)
ENDIF(UNIX AND ENABLE_GPERF_TOOLS MATCHES "ON")

SET_TARGET_PROPERTIES(jwt PROPERTIES PUBLIC_HEADER "${JWT_HDR}")
# Install targets.
INSTALL(TARGETS jwt
        EXPORT JwtTargets
        LIBRARY DESTINATION "${JWT_INSTALL_LIB_DIR}" COMPONENT lib
        ARCHIVE DESTINATION "${JWT_INSTALL_LIB_DIR}" COMPONENT lib
        PUBLIC_HEADER DESTINATION "${JWT_INSTALL_INCLUDE_DIR}/jwt" COMPONENT lib)

ADD_STYLE_CHECK_TARGET(lint "${JWT_SRC}")


SET(JWT_SOURCE_DIRS
  jwt
  base64
  validators
  validators/claims
  util
  jwe
)

FOREACH( DIR ${JWT_SOURCE_DIRS} )
  AUX_SOURCE_DIRECTORY(${DIR} JWT_SRC)
  SET(JWT_SRC ${JWT_SRC} ${SRC} )
ENDFOREACH( DIR ${JWT_SOURCE_DIRS} )

FILE(GLOB JWT_HDR include/jwt/*.h include/jwt/*.h??)


ADD_LIBRARY(jwt ${JWT_SRC} ${JWT_HDR})
IF(UNIX)
    TARGET_LINK_LIBRARIES (jwt ${OPENSSL_LIBRARIES})
    SET_PROPERTY(TARGET jwt PROPERTY CXX_STANDARD 11)
ELSEIF(MSVC)
    TARGET_LINK_LIBRARIES (jwt libcrypto libssl)
ENDIF(UNIX)

IF(UNIX AND ENABLE_GPERF_TOOLS MATCHES "ON")
    TARGET_LINK_LIBRARIES(jwt-cpp profiler)
    TARGET_LINK_LIBRARIES(jwt-cpp tcmalloc)
ENDIF(UNIX AND ENABLE_GPERF_TOOLS MATCHES "ON")

SET_TARGET_PROPERTIES(jwt PROPERTIES PUBLIC_HEADER "${JWT_HDR}")
# Install targets.
INSTALL(TARGETS jwt
        EXPORT JwtTargets
        LIBRARY DESTINATION "${JWT_INSTALL_LIB_DIR}" COMPONENT lib
        ARCHIVE DESTINATION "${JWT_INSTALL_LIB_DIR}" COMPONENT lib
        PUBLIC_HEADER DESTINATION "${JWT_INSTALL_INCLUDE_DIR}/jwt" COMPONENT lib)

ADD_STYLE_CHECK_TARGET(lint "${JWT_SRC}")


Include header files in install target
Include header files in install target