Skip to content

Commit

Permalink
cmake: on windows download wxWidgets libraries if not found installed
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Apr 26, 2024
1 parent 5ee55c3 commit 538f5a4
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ if(ENABLE_LIBRARY)
endif(MSVC)

add_subdirectory(GFIR)
set(LIME_SUITE_LIBS LimeSuite)
endif()

########################################################################
Expand All @@ -165,7 +164,45 @@ set(wxWidgets_USE_DEBUG OFF)
set(wxWidgets_USE_UNICODE ON)
set(wxWidgets_USE_UNIVERSAL OFF)
set(wxWidgets_USE_STATIC ON)
find_package(wxWidgets COMPONENTS richtext xml html xrc adv aui core base gl)
find_package(wxWidgets COMPONENTS richtext adv core base gl)
include(FetchContent)
if (NOT wxWidgets_FOUND AND WIN32)
cmake_policy(SET CMP0135 NEW)
message(STATUS "Downloading wxWidgets headers.")
set(wxRoot ${PROJECT_BINARY_DIR}/_deps/wxWidgets)
if (CMAKE_CL_64)
FetchContent_Declare(
wxWidgets
URL https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxMSW-3.2.4_vc14x_x64_Dev.7z
URL_HASH SHA1=19cf62ade3c3fc55813ad9a2f1a49220574cb54a
SOURCE_DIR ${wxRoot}
EXCLUDE_FROM_ALL
)
else()
FetchContent_Declare(
wxWidgets
URL https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxMSW-3.2.4_vc14x_Dev.7z
URL_HASH SHA1=29647b24e5120b62e588827c163f0fe660936002
SOURCE_DIR ${wxRoot}
EXCLUDE_FROM_ALL
)
endif()

FetchContent_Declare(
wxWidgetsHeaders
URL https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxWidgets-3.2.4-headers.7z
URL_HASH SHA1=86022483a0bfe81edf5aee38de07a0800f0a0602
SOURCE_DIR ${wxRoot}/include
EXCLUDE_FROM_ALL
)

FetchContent_MakeAvailable(wxWidgets wxWidgetsHeaders)

# find downloaded libraries
set(wxWidgets_ROOT_DIR ${wxRoot})
find_package(wxWidgets COMPONENTS richtext adv core base gl)
endif()

message(STATUS "wxWidgets_DEFINITIONS: ${wxWidgets_DEFINITIONS}")
message(STATUS "wxWidgets_INCLUDE_DIRS: ${wxWidgets_INCLUDE_DIRS}")
message(STATUS "wxWidgets_LIBRARIES: ${wxWidgets_LIBRARIES}")
Expand Down

0 comments on commit 538f5a4

Please sign in to comment.