GithubHelp home page GithubHelp logo

asjadenet / wxhellovcpkg Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 10.0 49 KB

Simple sample wxWidgets CMake project for all platforms, especially using Vcpkg and Visual Studio on Windows

License: MIT License

CMake 23.26% C++ 34.82% Batchfile 39.77% Shell 2.15%

wxhellovcpkg's Introduction

wxhellovcpkg

Simple sample wxWidgets CMake project for all platforms, especially using Vcpkg and Visual Studio on Windows

Overview

There has not been an almost standard way to organize C++ development packages on Windows. On Linux or MacOS it's much simpler. Microsoft Vcpkg is quite a good package manager for Windows, that can help a lot. It was hard to get started with wxWidgets and it could take hours to everything set up. Here is simple sample project for a quick start. C++ layout files are generated with wxFormBuilder.

License: MIT

Build status Systems / Compilers CI
Build status Windows VCPKG AppVeyor
Build status Windows wxWidgets source Win64 AppVeyor
Build status Windows wxWidgets source Win32 AppVeyor
Build status Ubuntu Linux GNU 5.4.0 AppVeyor
Build status MacOS AppVeyor

Prerequisites:

  • Windows 10, 8.1, 7, Linux, or MacOS
  • Visual Studio 2017 or Visual Studio 2019 (on Windows)
  • Git
  • CMake (version 3.14 or later for Visual Studio 2019)
  • wxFormBuilder

Quick Start

Windows

Visual Studio and Vcpkg

First, install Vcpkg according to instructions. You can install wxWidgets all available targets:

.\vcpkg install wxwidgets:x64-windows
.\vcpkg install wxwidgets:x64-windows-static
.\vcpkg install wxwidgets:x86-windows
.\vcpkg install wxwidgets:x86-windows-static

Batch file buildmsvc.bat is using environment variable VCPKG. Set it according to your Vcpkg directory location before running:

SET VCPKG=C:\VCPKG

Then clone git directory and build:

git clone https://github.com/asjadenet/wxhellovcpkg.git
cd wxhellovcpkg
buildmsvc.bat

You can specify different targets using command line arguments. For example:

buildmsvc.bat Win32 Debug dynamic

For using Visual Studio 2019, set envionment variable WX_VS_VER before building:

SET WX_VS_VER=2019

Visual Studio and building from source

Sometimes it's better to build wxWidgets libraries from source. For example, source code examples are easier to build and run. Use batch file installwx.bat for this:

Environment variable WX_INSTALL_PATH default value is C:\wxlibs, but you can modify it whenever you want to put wxWidgets libraries and headers.

installwx.bat

It calls batch file initwx.bat. 7zip is necessary for unzipping. Make sure 7z is in your path.

For different targets use command line arguments:

installwx.bat Win32 Debug dynamic

If you want to build samples also, add fourth parameter samples.

installwx.bat Win64 Release static samples

For using Visual Studio 2019, set envionment variable WX_VS_VER before building:

SET WX_VS_VER=2019

If you want to modify helloworld app source code and build, it's necessary only to call build-wxhello.bat.

build-wxhello.bat

For different targets use command line arguments:

build-wxhello.bat Win32 Release static

MSYS2

Install build environment and all dependencies. Here is example how to install cmake and wxWidgets:

pacman -S mingw-w64-i686-cmake mingw-w64-x86_64-cmake
pacman -S mingw-w64-i686-wxWidgets mingw-w64-x86_64-wxWidgets

Then clone git directory and build:

git clone https://github.com/asjadenet/wxhellovcpkg.git
cd wxhellovcpkg

In 64-bit shell run:

./buildmsys64.sh

In 32-bit shell run:

./buildmsys32.sh

Linux

Your can install wxwidgets on Ubuntu Linux using command:

sudo apt-get install libwxgtk3.0-dev

Then clone git directory and build:

git clone https://github.com/asjadenet/wxhellovcpkg.git
cd wxhellovcpkg
chmod +x buildmaclinux.sh
./buildmaclinux.sh

Note:

If you get error warning like this:

Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1009,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1011,wx containers,compatible with 2.8).

It's better to install wxWidgets from source using:

sudo apt-get install libgtk-3-dev
./configure
make
sudo make install
sudo  ldconfig

Mac OS X

Your can just install wxwidgets using command:

brew install wxmac

Then clone git directory and build:

git clone https://github.com/asjadenet/wxhellovcpkg.git
cd wxhellovcpkg
chmod +x buildmaclinux.sh
./buildmaclinux.sh

wxhellovcpkg's People

Contributors

asjadenet avatar

Stargazers

ZTC avatar Rafał Kołucki avatar Dr Amr Osman avatar Parker Liu avatar cjschneider2 avatar  avatar ollydbg avatar Jan avatar  avatar Marek Kraus avatar Valdis Zobēla avatar Nisim Hurst-Tarrab avatar Filippos Sakellaropoulos avatar Vladimir Jigulin avatar Szymon Welgus avatar  avatar  avatar

Watchers

 avatar  avatar

wxhellovcpkg's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.