if(BUILD_SHARED_LIBS)
target_compile_definitions(${libname}++ PRIVATE LIBCONFIG_STATIC)
else()
target_compile_definitions(${libname} PUBLIC LIBCONFIG_STATIC)
target_compile_definitions(${libname}++ PUBLIC LIBCONFIGXX_STATIC) <-- who forgot LIBCONFIG_STATIC ???
endif()
# must be:
...
target_compile_definitions(${libname}++ PUBLIC LIBCONFIG_STATIC LIBCONFIGXX_STATIC)
Workaround - in your CMake add definition manually:
target_compile_definitions(${LIBCONFIG_}++ PUBLIC LIBCONFIG_STATIC)
MSVC:
warning C4273: 'config_read': inconsistent dll linkage
Clang:warning: 'config_read' redeclared without 'dllimport' attribute: previous 'dllimport' ignored [-Winconsistent-dllimport]
libconfig\lib\CMakeLists.txt
simply misses:Workaround - in your CMake add definition manually: