libname(jcon jcon)
find_package(Qt5 COMPONENTS Network WebSockets Test REQUIRED)

ExternalProject_Add(
   jcon_BUILD
   URL ""
   SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jcon-cpp
   UPDATE_COMMAND ""
   INSTALL_DIR ${ThirdParty_Install_Dir}
   CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_STAGING_PREFIX:PATH=${ThirdParty_Install_Dir} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
   CMAKE_GENERATOR "${CMAKE_GENERATOR}"
   CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
   BUILD_BYPRODUCTS ${jcon_LIBRARY_STATIC}
)
add_library(jcon_IMP STATIC IMPORTED GLOBAL)
add_dependencies(jcon_IMP jcon_BUILD)
#TODO: cmake workaround
file(MAKE_DIRECTORY ${ThirdParty_Install_Dir}/include)
set_property(TARGET jcon_IMP PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ThirdParty_Install_Dir}/include)
SET_PROPERTY(TARGET jcon_IMP APPEND PROPERTY IMPORTED_LOCATION ${jcon_LIBRARY_STATIC} )
set_property(TARGET jcon_IMP APPEND PROPERTY INTERFACE_LINK_LIBRARIES Qt5::Network Qt5::WebSockets Qt5::Test)
