Skip to content

Generated opendhtConfig.cmake config is not portable #776

Description

@novemus

Linux static:

add_library(opendht STATIC IMPORTED)

set_target_properties(opendht PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:PkgConfig::argon2>;\$<LINK_ONLY:PkgConfig::Nettle>;PkgConfig::GnuTLS;PkgConfig::fmt;jsoncpp"
)

Linux shared:

add_library(opendht SHARED IMPORTED)

set_target_properties(opendht PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "opendht_EXPORTS"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "PkgConfig::GnuTLS;PkgConfig::fmt;jsoncpp"
)

Windows static:

add_library(opendht SHARED IMPORTED)

set_target_properties(opendht PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:unofficial::argon2::libargon2>;\$<LINK_ONLY:nettle_lib>;\$<LINK_ONLY:hogweed_lib>;\$<LINK_ONLY:tasn1_lib>;D:/projects/opendht/build/vcpkg_installed/x64-windows-static-release/lib/gnutls.lib;wsock32;ws2_32;unofficial::readline-win32::readline;msgpack-cxx;JsonCpp::JsonCpp;fmt::fmt"
)

Windows shared:

add_library(opendht SHARED IMPORTED)

set_target_properties(opendht PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "opendht_EXPORTS"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "D:/projects/opendht/build/vcpkg_installed/x64-windows-release/lib/gnutls.lib;wsock32;ws2_32;unofficial::readline-win32::readline;msgpack-cxx;JsonCpp::JsonCpp;fmt::fmt"
)

The nettle_lib, hogweed_lib, tasn1_lib, and jsoncpp targets are contextual, and gnutls is imported by build location.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions