Setup CMake package target and CI auto-deploy tags

cmake --build . --target package # or make package if make is used

can now be used to create binary packages for raylib.

AppVeyor and Travis CI are configured to push the artifacts
that result from building git tags to the related Github releases page.
This commit is contained in:
Ahmad Fatoum 2017-11-24 19:57:44 +01:00
parent 10dc276423
commit 49c5a433df
No known key found for this signature in database
GPG Key ID: C3EAC3DE9321D59B
5 changed files with 82 additions and 56 deletions

View File

@ -12,38 +12,48 @@ os:
env: env:
global: global:
- VERBOSE=1 - VERBOSE=1
matrix: matrix: # We don't install x11 32-bit libraries, so skip shared libraries on -m32
- CFLAGS=-m64 SHARED=ON - ARCH=i386 SHARED=OFF
- CFLAGS=-m32 SHARED=OFF - ARCH=amd64 SHARED=ON
# We don't install x11 32-bit libraries, so skip shared libraries on -m32
matrix:
exclude: # This is already covered by building universal (fat) libraries by default
- os: osx
env: ARCH=i386 SHARED=OFF
before_script: before_script:
- export CFLAGS="-std=gnu99 $CFLAGS" - export CFLAGS="-std=gnu99"
before_install: before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then - if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get install -y gcc-multilib sudo apt-get install -y gcc-multilib
libopenal-dev libopenal-dev
libxcursor-dev libxinerama-dev libxcursor-dev libxinerama-dev
mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev; mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev
libgl1-mesa-dev libglu1-mesa-dev libglew-dev;
export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
if [ "$ARCH" == "i386" ]; then export CFLAGS="$CFLAGS -m32"; fi;
if [ "$ARCH" == "amd64" ]; then export CFLAGS="$CFLAGS -m64"; fi;
fi fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew install glfw; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export RAYLIB_PACKAGE_SUFFIX="-macOS"; fi
- "$CC --version" - "$CC --version"
script: script:
- mkdir build - mkdir build
- cd build - cd build
- cmake -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. - cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF ..
- make - make
# - make package - make package
# - sudo make install
# deploy:
#deploy: provider: releases
# provider: releases api_key:
# api_key: secure: LvqUIAN/3dJul+Ra2iK3tSaNG5IwsNMmGIwVMy0DK5IBCxiQPBc9pWGiE30RTBPt6Z+N4BhMEE8DtUl+vnISlMoHWNIIhF2zwC66hs/F7zY7qEITMRSmfiLcqxQysknFOnJB06CATgXcFqlEo9j+t4abrG/f3qcb92J4O2uNz336Au2myTx93Q5MxbyA7KiUuEutFnb2dWiPCY4d+sGeXEfsiD2R7aj/8MaWOkoGdZVrTkI9juMgvpImkjQBArvqdjUMeT3MsRrwgOIq5v2GFV9dOl8k1WzPeT8B2JHh00ed/o1/wuFq/cLLOxtYo2+Pv3+xatOrlexoX0WkDm7C9/L1W5U4rLexU3CQ9mMBmHPnp6k/WXZ5QXEE4uUF0+LpN3XlIXzFpdZmZiVV8VLxg2WvyncMmivYiu7/MTkyfZxyKkzwl7sZZslzHA9kOGedGaN7b7/2B77OFHoQK8lKfdFml7jJnarh+89nenNZYMab0E8qkOJOyb2bYlDTa0/2nyxGiyymYgq6YHLNrDbhqB/1LzdgzjMliQ8ri5q9Ux2vjfcqOzhfAmcwFwnY/D6yXJWYi0DWpHZdpKl3du6dYDrypW91/yDWbwiJ/YhrE7ZunzrcB6GH/QkbuzWxdCth39rQAHih8DG01co/K3Gvi4yGjvIH5tFUpyEolMnpMiA=
# secure: XXX file_glob: true
# file_glob: true file: raylib-*.tar.gz
# file: raylib-*.tar.gz skip_cleanup: true
# skip_cleanup: true on:
# on: repo: raysan5/raylib
# branch: master branch:
# tags: true - develop
- master

View File

@ -31,7 +31,7 @@ features
* Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD) * Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)
* Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi** and **HTML5** * Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi** and **HTML5**
* VR stereo rendering support with configurable HMD device parameters * VR stereo rendering support with configurable HMD device parameters
* Minimal external dependencies (GLFW3, OpenGL, OpenAL) * Minimal external dependencies (OpenGL, OpenAL)
* Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go)) * Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go))
raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option I found for raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option I found for
@ -44,10 +44,12 @@ to accomodate to Android, Raspberry Pi and HTML5.
*On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.* *On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.*
building build and installation
-------- ----------------------
For detailed building instructions, check [raylib Wiki](https://github.com/raysan5/raylib/wiki). Binary releases for Windows, Linux and macOS are available at the [Github Releases](https://github.com/raysan5/raylib/releases) page.
To build raylib yourself, check out the [raylib Wiki](https://github.com/raysan5/raylib/wiki) for detailed instructions.
raylib has been developed using exclusively two tools: raylib has been developed using exclusively two tools:

View File

@ -10,29 +10,30 @@ init:
- cmake -E remove c:\programdata\chocolatey\bin\cpack.exe - cmake -E remove c:\programdata\chocolatey\bin\cpack.exe
- set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=% - set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=%
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=% - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- set PATH=%prefix_dir%\bin;%PATH% - if [%BITS%]==[32] set MINGW=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32
- if [%BITS%]==[64] set MINGW=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64
- if [%COMPILER%]==[mingw] set PATH=%MINGW%\bin;%PATH%
- set RAYLIB_PACKAGE_SUFFIX=-Win%BITS%-%COMPILER%
- set VERBOSE=1
environment: environment:
matrix: matrix:
- compiler: MinGW-w64 - compiler: mingw
bits: 32 bits: 32
prefix_dir: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32 - compiler: mingw
- compiler: MinGW-w64
bits: 64 bits: 64
prefix_dir: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 - compiler: msvc15
- compiler: MSVC15
bits: 32 bits: 32
- compiler: MSVC15 - compiler: msvc15
bits: 64 bits: 64
before_build: before_build:
- appveyor DownloadFile http://openal-soft.org/openal-binaries/openal-soft-1.17.2-bin.zip - appveyor DownloadFile http://openal-soft.org/openal-binaries/openal-soft-1.17.2-bin.zip
- 7z x openal-soft-1.17.2-bin.zip - 7z x openal-soft-1.17.2-bin.zip
- move openal-soft-1.17.2-bin src\external\openal - move openal-soft-1.17.2-bin src\external\openal
- if [%COMPILER%]==[MinGW-w64] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" - if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles"
- if [%COMPILER%]==[MSVC15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015" - if [%COMPILER%]==[msvc15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015"
- if [%COMPILER%]==[MSVC15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64" - if [%COMPILER%]==[msvc15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64"
- set VERBOSE=1
- mkdir build - mkdir build
- cd build - cd build
@ -41,25 +42,26 @@ build_script:
- cmake --build . --target install - cmake --build . --target install
after_build: after_build:
# - cmake --build . --target package - cmake --build . --target package
before_test: before_test:
test_script: test_script:
#artifacts: artifacts:
# - path: 'build\*.zip' - path: 'build\*.zip'
#
#deploy: deploy:
# description: 'Automatic build by CI' description: 'Automatic build by CI'
# provider: GitHub provider: GitHub
# auth_token: auth_token:
# secure: XXX secure: lqkfPGZPK828Mmopbicrng08QaaQXAshp0a9E3bMXt8+hpA8vCfDAT3jgU8kaSsW
# artifact: /.*\.zip/ artifact: /.*\.zip/
# draft: false draft: false
# prerelease: false prerelease: false
# force_update: true force_update: true
# on: on:
# branch: master branch:
# appveyor_repo_tag: true # deploy on tag push only - master
# - develop
appveyor_repo_tag: true # deploy on tag push only

View File

@ -5,7 +5,7 @@ includedir=${prefix}/include
Name: raylib Name: raylib
Description: Simple and easy-to-use library to learn videogames programming Description: Simple and easy-to-use library to learn videogames programming
URL: https://github.com/raysan5/raylib URL: http://github.com/raysan5/raylib
Version: @PROJECT_VERSION@ Version: @PROJECT_VERSION@
Libs: -L${libdir} -lraylib Libs: -L${libdir} -lraylib
Libs.private:@PKG_CONFIG_LIBS_PRIVATE@ Libs.private:@PKG_CONFIG_LIBS_PRIVATE@

View File

@ -2,8 +2,7 @@
project(raylib) project(raylib)
include("../utils.cmake") include("../utils.cmake")
set(raylib_VERSION_MAJOR 1) set(PROJECT_VERSION 1.9.0dev)
set(raylib_VERSION_MINOR 8)
set(RAYLIB raylib) # Name of the generated library set(RAYLIB raylib) # Name of the generated library
@ -173,3 +172,16 @@ message(STATUS "Compiling with the flags:")
message(STATUS " PLATFORM=" ${PLATFORM}) message(STATUS " PLATFORM=" ${PLATFORM})
message(STATUS " GRAPHICS=" ${GRAPHICS}) message(STATUS " GRAPHICS=" ${GRAPHICS})
# Packaging
SET(CPACK_PACKAGE_NAME "raylib")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to learn videogames programming")
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE.md")
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows
include(CPack)