build: set wxWidgets_DIR with vcpkg
When using vcpkg as the toolchain, pass NO_DEFAULT_PATH to find_package(wxWidgets ...) so that the default cmake FindwxWidgets.cmake is not included. Set wxWidgets_DIR to the <vcpkg-root>/installed/<triplet>/share/wxwidgets vcpkg port directory for the subsequent find_package() calls to find the port-installed wxWidgetsConfig.cmake file. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
98b51910eb
commit
23e1573442
|
@ -320,9 +320,17 @@ endif()
|
||||||
if(VBAM_STATIC)
|
if(VBAM_STATIC)
|
||||||
set(wxWidgets_USE_STATIC ON)
|
set(wxWidgets_USE_STATIC ON)
|
||||||
endif()
|
endif()
|
||||||
find_package(wxWidgets COMPONENTS xrc xml html adv net core base gl)
|
|
||||||
|
unset(wx_find_extra)
|
||||||
|
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")
|
||||||
|
set(wx_find_extra NO_DEFAULT_PATH)
|
||||||
|
set(wxWidgets_DIR "${VCPKG_ROOT}/installed/${VCPKG_TARGET_TRIPLET}/share/wxwidgets")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(wxWidgets COMPONENTS xrc xml html adv net core base gl ${wx_find_extra})
|
||||||
|
|
||||||
if(NOT wxWidgets_FOUND)
|
if(NOT wxWidgets_FOUND)
|
||||||
find_package(wxWidgets COMPONENTS xrc xml html adv net core base REQUIRED)
|
find_package(wxWidgets COMPONENTS xrc xml html adv net core base ${wx_find_extra} REQUIRED)
|
||||||
target_compile_definitions(visualboyadvance-m PRIVATE NO_OGL)
|
target_compile_definitions(visualboyadvance-m PRIVATE NO_OGL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue