nemtrif / utfcpp

UTF-8 with C++ in a Portable Way
Boost Software License 1.0
1.58k stars 200 forks source link

cmake dependency totally broken #104

Closed neheb closed 1 year ago

neheb commented 1 year ago

problem one is that in the generated Targets.cmake file, warnings that should not be exported are:

set_target_properties(utf8cpp PROPERTIES
  INTERFACE_COMPILE_OPTIONS "\$<\$<CXX_COMPILER_ID:MSVC>:/W4>;\$<\$<NOT:\$<CXX_COMPILER_ID:MSVC>>:-Wall;-Wextra;-Wpedantic;-Wconversion>"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/utf8cpp"
)

problem two is that on both fedora and debian, the generated ConfigVersion.cmake specifies that it's only for 32-bit, which is nonsense:

# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "4")
  math(EXPR installedBits "4 * 8")
  set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
  set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()

this prevents usage with find_package("utf8cpp")

neheb commented 1 year ago

Maybe the latter is fixed by https://github.com/nemtrif/utfcpp/pull/101

neheb commented 1 year ago

Other fixed by https://github.com/nemtrif/utfcpp/pull/105

nemtrif commented 1 year ago

At this point I am seriously considering removing this CMake nonsense, but in the meantime if someone else can confirm there is a problem and #105 fixes it, I'll take the pull request.

neheb commented 1 year ago

Which nonsense?

The CMake files should be cleaned up FWIW. tests/CMakeLists.txt should be all using a loop probably.

edit: meson uses pkgconfig first and cmake config second. The former works better. Not implemented here.

neheb commented 1 year ago

ping