Add implicit link directories to package HINT path on MingW

Instead of blacklisting those libraries
This commit is contained in:
LAGonauta 2020-05-20 23:16:39 -03:00
parent e7fd7f4726
commit a6515ed826
3 changed files with 4 additions and 6 deletions

View file

@ -14,12 +14,12 @@ function(find_pkg_config_with_fallback name)
set(${name}_FOUND ${${name}_PKG_CONFIG_FOUND}) set(${name}_FOUND ${${name}_PKG_CONFIG_FOUND})
if(MINGW) if(MINGW)
list(FILTER ${name}_PKG_CONFIG_LIBRARIES EXCLUDE REGEX "(ole32)|(gdi32)|(imm32)|(shell32)|(winmm)|(dwmapi)|(setupapi)|(cfgmgr32)|(ws2_32)") set(MINGWLIBPATH ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
endif(MINGW) endif(MINGW)
# Try to find real file name of libraries # Try to find real file name of libraries
foreach(lib ${${name}_PKG_CONFIG_LIBRARIES}) foreach(lib ${${name}_PKG_CONFIG_LIBRARIES})
find_library(${name}_${lib}_LIBRARY ${lib} HINTS ${${name}_PKG_CONFIG_LIBRARY_DIRS}) find_library(${name}_${lib}_LIBRARY ${lib} HINTS ${${name}_PKG_CONFIG_LIBRARY_DIRS} ${MINGWLIBPATH})
mark_as_advanced(${name}_${lib}_LIBRARY) mark_as_advanced(${name}_${lib}_LIBRARY)
if(NOT ${name}_${lib}_LIBRARY) if(NOT ${name}_${lib}_LIBRARY)
message(${name} ": " ${lib} " library not found") message(${name} ": " ${lib} " library not found")

View file

@ -14,12 +14,12 @@ function(find_pkg_config_with_fallback_on_config_script name)
set(${name}_FOUND ${${name}_PKG_CONFIG_FOUND}) set(${name}_FOUND ${${name}_PKG_CONFIG_FOUND})
if(MINGW) if(MINGW)
list(FILTER ${name}_PKG_CONFIG_LIBRARIES EXCLUDE REGEX "(ole32)|(gdi32)|(imm32)|(shell32)|(winmm)|(dwmapi)|(setupapi)|(cfgmgr32)|(ws2_32)") set(MINGWLIBPATH ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
endif(MINGW) endif(MINGW)
# Try to find real file name of libraries # Try to find real file name of libraries
foreach(lib ${${name}_PKG_CONFIG_LIBRARIES}) foreach(lib ${${name}_PKG_CONFIG_LIBRARIES})
find_library(${name}_${lib}_LIBRARY ${lib} HINTS ${${name}_PKG_CONFIG_LIBRARY_DIRS}) find_library(${name}_${lib}_LIBRARY ${lib} HINTS ${${name}_PKG_CONFIG_LIBRARY_DIRS} ${MINGWLIBPATH})
mark_as_advanced(${name}_${lib}_LIBRARY) mark_as_advanced(${name}_${lib}_LIBRARY)
if(NOT ${name}_${lib}_LIBRARY) if(NOT ${name}_${lib}_LIBRARY)
message(${name} ": " ${lib} " library not found") message(${name} ": " ${lib} " library not found")

View file

@ -1,5 +1,3 @@
set(GETTEXT_PACKAGE "dino") set(GETTEXT_PACKAGE "dino")
find_package(Gettext) find_package(Gettext)
include(${GETTEXT_USE_FILE}) include(${GETTEXT_USE_FILE})