Skip to content

Commit

Permalink
Merge pull request #217 from winterheart/cmake
Browse files Browse the repository at this point in the history
Update CMake project
  • Loading branch information
psi29a authored Nov 1, 2020
2 parents 7f2aee8 + 3262b15 commit 9755157
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 218 deletions.
36 changes: 19 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
os:
- linux
- osx
osx_image: xcode8.3
dist: trusty
sudo: required
- linux
- osx
dist: focal

addons:
apt:
packages:
- libopenal-dev
homebrew:
packages:
- openal-soft
- pkg-config

language: c
env:
- BUILD_TYPE=Debug
- BUILD_TYPE=Release
- BUILD_TYPE=Debug
- BUILD_TYPE=Release
matrix:
include:
- os: linux
env:
ANALYZE="scan-build-3.6 --use-cc clang-3.6 --use-c++ clang++-3.6 "
ANALYZE="scan-build --use-cc clang --use-c++ clang++"
compiler: clang
branches:
only:
- master
- coverity_scan
- /wildmidi-.*$/

before_install:
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./CI/before_install.linux.sh; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./CI/before_install.osx.sh; fi
before_script:
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./CI/before_script.linux.sh; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./CI/before_script.osx.sh; fi
script:
- cd ./build
- if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then ${ANALYZE}make -j3; fi
- cmake -B build -DWANT_PLAYER=ON -DWANT_ALSA=OFF -DWANT_OPENAL=ON -DWANT_OSS=OFF
- ${ANALYZE} cmake --build build -j3 --verbose

notifications:
irc:
irc:
channels:
- "chat.freenode.net#wildmidi"
on_success: change
Expand Down
19 changes: 0 additions & 19 deletions CI/before_install.linux.sh

This file was deleted.

5 changes: 0 additions & 5 deletions CI/before_install.osx.sh

This file was deleted.

8 changes: 0 additions & 8 deletions CI/before_script.linux.sh

This file was deleted.

19 changes: 0 additions & 19 deletions CI/before_script.osx.sh

This file was deleted.

35 changes: 6 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# ########## Project setup ##########
PROJECT(wildmidi C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
PROJECT(wildmidi LANGUAGES C VERSION 0.4.4)

# WildMIDI Version
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 4)
SET(VERSION_RELEASE 4)
SET(WILDMIDI_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}")
SET(WILDMIDI_VERSION ${PROJECT_VERSION})

# Lib Versions
SET(SOVERSION 2)
Expand All @@ -19,6 +16,7 @@ INCLUDE(CMakeDependentOption)
INCLUDE(CheckCCompilerFlag)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckIncludeFile)
INCLUDE(GNUInstallDirs)
INCLUDE(TestBigEndian)

# Set a default build type if none was specified
Expand Down Expand Up @@ -65,12 +63,6 @@ IF (UNIX)
)
ENDIF (UNIX)

# Usage of RPATH for macOS is enabled by default; this just suppresses the CMP0042 warning
# when building libwildmidi_dynamic.
IF (POLICY CMP0042)
CMAKE_POLICY(SET CMP0042 NEW)
ENDIF ()

IF (OPENBSD) # Set RPATH for OpenBSD so WildMIDI can find libWildMidi.so
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
Expand Down Expand Up @@ -101,7 +93,7 @@ IF (WIN32)
ENDIF (WIN32)

# Compiler specific settings
IF (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
ADD_DEFINITIONS(
-Wall -W
-fno-common
Expand Down Expand Up @@ -234,13 +226,6 @@ IF (UNIX AND NOT APPLE)
IF (NOT M_LIBRARY)
SET(M_LIBRARY "")
ENDIF ()

## Debian and non debian Linux building
IF (DPKG_PROGRAM)
## Debian specific
ELSE ()
## Non debian specific
ENDIF ()
ENDIF (UNIX AND NOT APPLE)

IF (APPLE AND WANT_PLAYER)
Expand All @@ -265,16 +250,8 @@ IF (APPLE AND WANT_PLAYER)
ENDIF ()
ENDIF ()

IF (WIN32)
IF (WANT_PLAYER)
LINK_LIBRARIES(winmm)
ENDIF ()
ENDIF (WIN32)

# ######### General setup ##########
INCLUDE_DIRECTORIES(BEFORE "${PROJECT_SOURCE_DIR}/include")
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/include")
INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}/include")
INCLUDE_DIRECTORIES(BEFORE "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
IF (NOT HAVE_STDINT_H) # AND NOT HAVE_INTTYPES_H
INCLUDE_DIRECTORIES(BEFORE "${PROJECT_SOURCE_DIR}/include/stdint")
ENDIF ()
Expand Down
Loading

0 comments on commit 9755157

Please sign in to comment.