Skip to content

Commit

Permalink
(conan-io#5190) (conan-io#19991) (conan-io#20092) new wxwidgets recip…
Browse files Browse the repository at this point in the history
…e; ported from bincrafters to v2
  • Loading branch information
gmeeker authored and Werni2A committed Jan 20, 2024
1 parent a48edf4 commit a174237
Show file tree
Hide file tree
Showing 9 changed files with 623 additions and 0 deletions.
22 changes: 22 additions & 0 deletions recipes/wxwidgets/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
sources:
"3.1.4":
url: "https://github.com/wxWidgets/wxWidgets/archive/v3.1.4.tar.gz"
sha256: "f2698297b2d2c6d2372c23144c133e531248a64286c78ae17179155c94971d6f"
"3.1.5":
url: "https://github.com/wxWidgets/wxWidgets/archive/v3.1.5.tar.gz"
sha256: "e8fd5f9fbff864562aa4d9c094f898c97f5e1274c90f25beb0bfd5cb61319dea"
"3.2.0":
url: "https://github.com/wxWidgets/wxWidgets/archive/v3.2.0.tar.gz"
sha256: "43480e3887f32924246eb439520a3a2bc04d7947712de1ea0590c5b58dedadd9"
"3.2.1":
url: "https://github.com/wxWidgets/wxWidgets/archive/v3.2.1.tar.gz"
sha256: "89065a28e03fbf4ae90f2f56b7badb4c408daa6fd5df2986505e6057eba75144"
"3.2.2.1":
url: "https://github.com/wxWidgets/wxWidgets/archive/v3.2.2.1.tar.gz"
sha256: "0b96807e700288652f1538d8f7db25559cbb890f15fe2001ca7eef6f7cce3262"
"3.2.3":
url: "https://github.com/wxWidgets/wxWidgets/archive/v3.2.3.tar.gz"
sha256: "0eb9499c06778c6746dbd4aee2a124f1995a5db331e282d15237b0046c1788af"
patches:
"3.1.4":
- patch_file: "patches/d9deaa8b76128613a84f3d085eb1e4b05631083a.patch"
473 changes: 473 additions & 0 deletions recipes/wxwidgets/all/conanfile.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 90277f3955..966be07ec8 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -34,6 +34,11 @@ macro(wx_get_dependencies var lib)
foreach(dep IN LISTS deps)
if(TARGET ${dep})
- get_target_property(dep_name ${dep} OUTPUT_NAME)
+ get_target_property(dep_type ${dep} TYPE)
+ if (dep_type STREQUAL "INTERFACE_LIBRARY")
+ get_target_property(dep_name ${dep} INTERFACE_OUTPUT_NAME)
+ else()
+ get_target_property(dep_name ${dep} OUTPUT_NAME)
+ endif()
set(dep_name "-l${dep_name}")
else()
get_filename_component(dep_name ${dep} NAME)
13 changes: 13 additions & 0 deletions recipes/wxwidgets/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)

find_package(wxWidgets REQUIRED)

if(MSVC)
add_definitions("-DUNICODE")
add_definitions("-D_UNICODE")
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
endif()

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} wxWidgets::wxWidgets)
26 changes: 26 additions & 0 deletions recipes/wxwidgets/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")
27 changes: 27 additions & 0 deletions recipes/wxwidgets/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <cstdlib>
#include <iostream>
#include <wx/utils.h>
#include <wx/init.h>
#if wxUSE_STC
#include <wx/stc/stc.h>
#endif

int main()
{
int argc = 0;
wxChar * argv[] = {NULL};
if (!wxEntryStart(argc, argv)) {
std::cerr << "wxEntryStart failed!" << std::endl;
return EXIT_FAILURE;
}
wxVersionInfo vi = wxGetLibraryVersionInfo();
std::cout << "wxWidgets version: ";
std::cout << vi.GetMajor() << ".";
std::cout << vi.GetMinor() << ".";
std::cout << vi.GetMicro() << std::endl;
#if wxUSE_STC
wxStyledTextCtrl * stc = new wxStyledTextCtrl();
#endif
wxEntryCleanup();
return EXIT_SUCCESS;
}
15 changes: 15 additions & 0 deletions recipes/wxwidgets/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)


include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

if(MSVC)
add_definitions("-DUNICODE")
add_definitions("-D_UNICODE")
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
endif()

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
17 changes: 17 additions & 0 deletions recipes/wxwidgets/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conans import ConanFile, CMake, tools
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
13 changes: 13 additions & 0 deletions recipes/wxwidgets/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
versions:
"3.2.3":
folder: "all"
"3.2.2.1":
folder: "all"
"3.2.1":
folder: "all"
"3.2.0":
folder: "all"
"3.1.5":
folder: "all"
"3.1.4":
folder: "all"

0 comments on commit a174237

Please sign in to comment.