From ea40314a79efc9ad8dfeca3e1ed245487d75922d Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Sun, 18 Apr 2021 02:28:12 +0200 Subject: [PATCH 1/7] README: Markdown fixes - Change from quad-backticks to triple backticks - Escape underscores (they are for making text italic) - Add commandline prefix to all commands (to better visualize that this is run from the command line) - Add shell highlighting --- README.md | 84 +++++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 5233665d..5c3eead8 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ On windows, the program can be compiled with Visual Studio (recommended) or with * Download and install [Visual Studio Community edition](https://visualstudio.microsoft.com/vs/community/) * Download and install [vcpkg](https://github.com/microsoft/vcpkg) * Use vcpkg to install wxwidgets, boost, hunspell -```` -vcpkg install wxwidgets -vcpkg install boost-smart-ptr -vcpkg install boost-regex -vcpkg install boost-logic -vcpkg install boost-pool -vcpkg install hunspell -vcpkg integrate install -```` +```shell +> vcpkg install wxwidgets +> vcpkg install boost-smart-ptr +> vcpkg install boost-regex +> vcpkg install boost-logic +> vcpkg install boost-pool +> vcpkg install hunspell +> vcpkg integrate install +``` * Then just use "Open Folder" from inside visual studio to open the Magic Set Editor source code root folder. * Select the configuration that you want to build, and hit F7. @@ -43,52 +43,52 @@ The tests can be run from inside visual studio * Download and install [msys2](https://www.msys2.org/) * Install a recent version of the gcc compiler, cmake, and wxWidgets libraries: -```` -pacman -S mingw32/mingw-w64-i686-gcc -pacman -S mingw32/mingw-w64-i686-wxWidgets -pacman -S mingw32/mingw-w64-i686-boost -pacman -S mingw32/mingw-w64-i686-hunspell -pacman -S cmake -```` +```shell +> pacman -S mingw32/mingw-w64-i686-gcc +> pacman -S mingw32/mingw-w64-i686-wxWidgets +> pacman -S mingw32/mingw-w64-i686-boost +> pacman -S mingw32/mingw-w64-i686-hunspell +> pacman -S cmake +``` Use `mingw64/mingw-w64-x86_64-...` instead of for the 64bit build * Build -```` -cmake -G "MSYS Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -cmake --build build -```` +```shell +> cmake -G "MSYS Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release +> cmake --build build +``` ## Building on linux Install the dependencies, for example on a debian based system -```` -sudo apt install g++ -sudo apt install libboost-dev libwxgtk3.0-gtk3-dev libhunspell-dev -```` +```shell +$ sudo apt install g++ +$ sudo apt install libboost-dev libwxgtk3.0-gtk3-dev libhunspell-dev +``` Then use cmake to build -```` -cmake build -DCMAKE_BUILD_TYPE=Release -cmake --build build -```` +```shell +$ cmake build -DCMAKE_BUILD_TYPE=Release +$ cmake --build build +``` Use `CMAKE_BUILD_TYPE=Debug` for a debug build ## Building on Mac Install the dependencies, for example using Homebrew -```` -brew install boost wxwidgets hunspell -```` -Note: Tested with boost 1.72.0_3, wxmac (wxwidgets) 3.0.5.1_1, hunspell 1.7.0_2 +```shell +$ brew install boost wxwidgets hunspell +``` +Note: Tested with boost 1.72.0\_3, wxmac (wxwidgets) 3.0.5.1\_1, hunspell 1.7.0\_2 Then use cmake to build -```` -mkdir build && cd build -cmake -DCMAKE_BUILD_TYPE=Release .. -cmake --build .. -```` +```shell +$ mkdir build && cd build +$ cmake -DCMAKE_BUILD_TYPE=Release .. +$ cmake --build .. +``` Use `CMAKE_BUILD_TYPE=Debug` for a debug build Finally, copy the resources to a SharedSupport directory and run the executable -```` -mkdir SharedSupport && cd SharedSupport -cp -r ../resource SharedSupport/ -./magicseteditor -```` +```shell +$ mkdir SharedSupport && cd SharedSupport +$ cp -r ../resource SharedSupport/ +$ ./magicseteditor +``` From d87443879a29f35f1b4ba72cac1ee3cb3372b280 Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Sun, 18 Apr 2021 02:34:58 +0200 Subject: [PATCH 2/7] README: Keep Mac instructions in sync with Linux This should work the same way. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c3eead8..abf86025 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,8 @@ $ brew install boost wxwidgets hunspell Note: Tested with boost 1.72.0\_3, wxmac (wxwidgets) 3.0.5.1\_1, hunspell 1.7.0\_2 Then use cmake to build ```shell -$ mkdir build && cd build -$ cmake -DCMAKE_BUILD_TYPE=Release .. -$ cmake --build .. +$ cmake build -DCMAKE_BUILD_TYPE=Release +$ cmake --build build ``` Use `CMAKE_BUILD_TYPE=Debug` for a debug build From 4dd64b8e1503cfdf1615623a79b39e2f34dce14a Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Sun, 18 Apr 2021 03:06:28 +0200 Subject: [PATCH 3/7] README: Add cmake dependency This shouldn't come as a surprise to anyone but might as well add it to the instructions. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index abf86025..470b872b 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ The tests can be run from inside visual studio Install the dependencies, for example on a debian based system ```shell -$ sudo apt install g++ +$ sudo apt install g++ cmake $ sudo apt install libboost-dev libwxgtk3.0-gtk3-dev libhunspell-dev ``` Then use cmake to build @@ -75,7 +75,7 @@ Use `CMAKE_BUILD_TYPE=Debug` for a debug build Install the dependencies, for example using Homebrew ```shell -$ brew install boost wxwidgets hunspell +$ brew install boost wxwidgets hunspell cmake ``` Note: Tested with boost 1.72.0\_3, wxmac (wxwidgets) 3.0.5.1\_1, hunspell 1.7.0\_2 Then use cmake to build From 2c4cd5ef0f59becc13ecc011719bc618683c5e50 Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Sun, 18 Apr 2021 03:26:32 +0200 Subject: [PATCH 4/7] README: Add libboost-regex-dev dependency I had to install the libboost-regex-dev package on Ubuntu 20.04 to build there. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 470b872b..cec8ced4 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The tests can be run from inside visual studio Install the dependencies, for example on a debian based system ```shell $ sudo apt install g++ cmake -$ sudo apt install libboost-dev libwxgtk3.0-gtk3-dev libhunspell-dev +$ sudo apt install libboost-dev libboost-regex-dev libwxgtk3.0-gtk3-dev libhunspell-dev ``` Then use cmake to build ```shell From e2da60e75d3b4878a7a61ef458852af9125f0441 Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Sun, 18 Apr 2021 03:14:57 +0200 Subject: [PATCH 5/7] README: Set cmake build path This is apparently how one defines the build directory path using CMake. From `cmake --help`: ... -B = Explicitly specify a build directory. ... --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cec8ced4..38a93a25 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ $ sudo apt install libboost-dev libboost-regex-dev libwxgtk3.0-gtk3-dev libhunsp ``` Then use cmake to build ```shell -$ cmake build -DCMAKE_BUILD_TYPE=Release +$ cmake -Bbuild -DCMAKE_BUILD_TYPE=Release $ cmake --build build ``` Use `CMAKE_BUILD_TYPE=Debug` for a debug build @@ -80,7 +80,7 @@ $ brew install boost wxwidgets hunspell cmake Note: Tested with boost 1.72.0\_3, wxmac (wxwidgets) 3.0.5.1\_1, hunspell 1.7.0\_2 Then use cmake to build ```shell -$ cmake build -DCMAKE_BUILD_TYPE=Release +$ cmake -Bbuild -DCMAKE_BUILD_TYPE=Release $ cmake --build build ``` Use `CMAKE_BUILD_TYPE=Debug` for a debug build From ab6163bae6b61aea8be067261a14578ec7122e33 Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Sun, 18 Apr 2021 01:24:03 +0200 Subject: [PATCH 6/7] CMake: Add UNIX install target Add installation target for UNIX systems. This defaults to install under /usr/local/bin/ and /usr/local/share/magicseteditor/ but is configurable through the CMAKE_INSTALL_PREFIX variable. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 552bb9bb..203cc197 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,12 @@ if(WIN32) ) endif() +if(UNIX) + include(GNUInstallDirs) + install(TARGETS magicseteditor DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}") + install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/data" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/magicseteditor") + install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/resource" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/magicseteditor") +endif() # warnings if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) From 9432a32392200365f4588b8e7fa89a4815427df8 Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Sun, 18 Apr 2021 02:36:08 +0200 Subject: [PATCH 7/7] README: Add install instructions Add installation instructions to the build instructions. --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 38a93a25..c3c09e86 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ Then use cmake to build ```shell $ cmake -Bbuild -DCMAKE_BUILD_TYPE=Release $ cmake --build build +# Optinal systemwide install (/usr/local/). Use --prefix to override. +$ cmake --install build ``` Use `CMAKE_BUILD_TYPE=Debug` for a debug build @@ -82,12 +84,7 @@ Then use cmake to build ```shell $ cmake -Bbuild -DCMAKE_BUILD_TYPE=Release $ cmake --build build +# Optinal systemwide install (/usr/local/). Use --prefix to override. +$ cmake --install build ``` Use `CMAKE_BUILD_TYPE=Debug` for a debug build - -Finally, copy the resources to a SharedSupport directory and run the executable -```shell -$ mkdir SharedSupport && cd SharedSupport -$ cp -r ../resource SharedSupport/ -$ ./magicseteditor -```