Commit f65ca611 authored by Arnout's avatar Arnout

Imported Upstream version 0.4.1

parents
Pedro Lopez-Cabanillas <plcl@users.sf.net>
# MIDI Sequencer C++ Library
# Copyright (C) 2005-2010 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA
# The name of our project is "DRUMSTICK". CMakeLists files in this project can
# refer to the root source directory of the project as ${DRUMSTICK_SOURCE_DIR}
# and to the root binary directory of the project as ${DRUMSTICK_BINARY_DIR}
PROJECT(DRUMSTICK)
# CMake minimum version
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET(_INIT_LIB_SUFFIX "64")
ELSE(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET(_INIT_LIB_SUFFIX "")
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET(LIB_SUFFIX ${_INIT_LIB_SUFFIX} CACHE STRING "optional library install directory suffix: 32, 64, none")
#Comment out if relative paths break the link scripts
#SET(CMAKE_USE_RELATIVE_PATHS OFF)
# Assorted settings
SET(CMAKE_COLOR_MAKEFILE ON)
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
#SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_SKIP_RULE_DEPENDENCY FALSE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# Additional CMake modules for 3rd party library checks reside here
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_admin")
# DRUMSTICK version string
SET (VERSION_MAJOR "0")
SET (VERSION_MINOR "4")
SET (VERSION_PATCH "1")
SET (VERSION_SUFFIX "")
SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX})
MESSAGE(STATUS "drumstick ${VERSION} prefix: ${CMAKE_INSTALL_PREFIX}")
# User options
OPTION(STATIC_DRUMSTICK "Build a static library (.a) instead of dynamic (.so)" OFF)
MESSAGE(STATUS "Build configuration: ${CMAKE_BUILD_TYPE}")
# LIBRARY BUILD TYPE
IF(STATIC_DRUMSTICK)
SET(BUILD_SHARED_LIBS OFF)
MESSAGE(STATUS "Building static libraries")
ELSE(STATIC_DRUMSTICK)
SET(BUILD_SHARED_LIBS ON)
MESSAGE(STATUS "Building dynamic libraries")
ENDIF(STATIC_DRUMSTICK)
# Check for Qt
SET(QT_MIN_VERSION "4.4.0")
FIND_PACKAGE(Qt4 REQUIRED)
IF(QT4_FOUND)
MESSAGE (STATUS "Found Qt4 ${QT_EDITION} version = ${QTVERSION}")
SET (QT_USE_QTSVG TRUE)
INCLUDE (${QT_USE_FILE})
INCLUDE_DIRECTORIES (${QT_INCLUDES})
LINK_DIRECTORIES (${QT_LIBRARY_DIR})
LINK_LIBRARIES (${QT_LIBRARIES})
ADD_DEFINITIONS (-DQT_STRICT_ITERATORS)
ELSE(QT4_FOUND)
MESSAGE(FATAL_ERROR "Qt4 not found")
ENDIF(QT4_FOUND)
# Check for PKG-CONFIG
FIND_PACKAGE(PkgConfig REQUIRED)
IF(PKG_CONFIG_FOUND)
MESSAGE(STATUS "Program pkg-config found (${PKG_CONFIG_EXECUTABLE})")
ELSE(PKG_CONFIG_FOUND)
MESSAGE(FATAL_ERROR "Program pkg-config not found")
ENDIF(PKG_CONFIG_FOUND)
# Initialize some variables
SET(HAVE_ALSA FALSE)
# Check for ALSA 1.0.0
PKG_CHECK_MODULES(ALSA alsa>=1.0.0)
IF(ALSA_FOUND)
SET(HAVE_ALSA TRUE)
ADD_DEFINITIONS(-DHAVE_ALSA)
SET(ALSA_LIBS ${ALSA_LIBRARIES})
LIST(APPEND ALSA_LIB_DIR ${ALSA_LIBRARY_DIRS} ${ALSA_LIBDIR})
LIST(APPEND ALSA_INC_DIR ${ALSA_INCLUDE_DIRS} ${ALSA_INCLUDEDIR})
ELSE(ALSA_FOUND)
MESSAGE(STATUS "Warning: ALSA library not found.")
ENDIF(ALSA_FOUND)
LINK_DIRECTORIES (
${DRUMSTICK_BINARY_DIR}/lib
${ALSA_LIB_DIR}
)
INCLUDE_DIRECTORIES ( BEFORE
${DRUMSTICK_SOURCE_DIR}/library
${DRUMSTICK_SOURCE_DIR}/library/include
${ALSA_INC_DIR}
)
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
CONFIGURE_FILE(
"${CMAKE_SOURCE_DIR}/Doxyfile.in"
"${CMAKE_CURRENT_BINARY_DIR}/Doxyfile"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET ( doxygen
${DOXYGEN} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ENDIF(DOXYGEN_FOUND)
ADD_SUBDIRECTORY(library)
ADD_SUBDIRECTORY(utils)
ADD_SUBDIRECTORY(icons)
IF(${CMAKE_SYSTEM} MATCHES "Linux")
ADD_SUBDIRECTORY(doc)
ENDIF(${CMAKE_SYSTEM} MATCHES "Linux")
CONFIGURE_FILE(drumstick-alsa.pc.in drumstick-alsa.pc IMMEDIATE @ONLY)
CONFIGURE_FILE(drumstick-file.pc.in drumstick-file.pc IMMEDIATE @ONLY)
CONFIGURE_FILE(drumstick.spec.in drumstick.spec IMMEDIATE @ONLY)
INSTALL( FILES
${CMAKE_CURRENT_BINARY_DIR}/drumstick-file.pc
${CMAKE_CURRENT_BINARY_DIR}/drumstick-alsa.pc
DESTINATION lib${LIB_SUFFIX}/pkgconfig )
# XML mime types
set( SHARED_MIME_INFO_MINIMUM_VERSION "0.30" )
set( XDG_MIME_INSTALL_DIR "share/mime/packages" )
find_package( SharedMimeInfo )
install( FILES drumstick.xml DESTINATION ${XDG_MIME_INSTALL_DIR} )
update_xdg_mimetypes( ${XDG_MIME_INSTALL_DIR} )
# uninstall custom target
CONFIGURE_FILE(
"${CMAKE_SOURCE_DIR}/cmake_admin/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET ( uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
IF(${CMAKE_SYSTEM} MATCHES "Linux")
# tarball target
ADD_CUSTOM_TARGET ( tarball
COMMAND mkdir -p drumstick-${VERSION}
COMMAND cp -r cmake_admin drumstick-${VERSION}
COMMAND cp -r library drumstick-${VERSION}
COMMAND cp -r utils drumstick-${VERSION}
COMMAND cp -r doc drumstick-${VERSION}
COMMAND cp -r icons drumstick-${VERSION}
COMMAND cp CMakeLists.txt AUTHORS COPYING ChangeLog INSTALL NEWS README TODO drumstick*.in drumstick.pro drumstick.xml configure* Doxyfile.in link-drumstick chkcoverage drumstick-${VERSION}
COMMAND tar -cj --exclude=.[a-z]* -f drumstick-${VERSION}.tar.bz2 drumstick-${VERSION}
COMMAND tar -cz --exclude=.[a-z]* -f drumstick-${VERSION}.tar.gz drumstick-${VERSION}
COMMAND rm -rf drumstick-${VERSION}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ENDIF(${CMAKE_SYSTEM} MATCHES "Linux")
This diff is collapsed.
2010-07-12
* removed PCH build option
2010-07-11
* Fixed bug in class SequencerInputThread: realtime priority must be applied
in run() instead of start() to avoid changing the scheduling policy of the
parent. This is a problem when running FluidSynth in systems affected by a
glib-2.22 bug that has not yet been fixed.
Reference: https://bugzilla.gnome.org/show_bug.cgi?id=599079
2010-07-07
* smfplayer renamed as guiplayer, with a new windows layout and
supporting Cakewalk WRK files playback
* release 0.4.0
2010-07-03
* subdirectory "tests" renamed as "utils".
* visibility attribute for public classes.
2010-06-10
* Compile fix for 0.3.2
* release 0.3.2a
2010-06-09
* Command line arguments for all the utilities/test programs.
2010-05-28
* fix a crash in drumstick-sysinfo when a timer module is not loaded.
2010-05-13
* Man pages for the utilities/test programs.
2010-05-10
* New test program: DrumGrid
2010-04-19
* Release 0.3.1
* Allow to build drumstick-file library under Windows
* New method MidiClient::parseAddress() replacing the ALSA function
snd_seq_parse_address() in MidiPort::subscribeTo() and similar methods.
* Fixed MidiClient::getAvailableInputs() and getAvailableOutputs() forcing
to always retrieve the clients list.
2010-03-09
* Release 0.3.0
* API changes:
SequencerEvent::isChannel() returns true for SND_SEQ_EVENT_NOTE
QueueTimer::setId(const TimerId& id) new method overload
Timer::bestGlobalTimerId() new static function
getRuntimeALSALibraryVersion() new global function
getRuntimeALSALibraryNumber() new global function
getRuntimeALSADriverVersion() new global function
getRuntimeALSADriverNumber() new global function
2010-03-02
* New class QWrk, for reading Cakewalk files
2010-02-17
* Split: drumstick-file and drumstick-alsa
2010-01-07
* Renamed to 'drumstick' and moved to a new project repository
2009-12-27
* Release 0.2.0
* API changes:
SequencerInputThread::start() added a priority parameter
SequencerEvent::isChannel() new static method
SequencerOutputThread::stopped() method removed, converted into a signal
SequencerOutputThread::start() added a priority parameter
SequencerOutputThread::shutupSound() method removed
SequencerOutputThread::stopRequested() method added
QSmfPrivate class added
QSmf::writeMetaEvent() new method overload
QSmf::getTextCodec() new method
QSmf::setTextCodec() new method
QSmf::signalSMFVariable() signal dropped
QSmf::signalSMFMetaUnregistered() signal added
Subscriber::operator==() removed unimplemented operator prototype
2009-08-27
* Public release 0.1.0
2008-12-29 0.0.2pre5
* Snapshot included in kmetronome-0.9.0 and kmidimon-0.6.0
2008-11-09 0.0.2pre1
* Initial pre-release
2008-05-12 0.0.1
* Development started
This diff is collapsed.
Basic build commands
--------------------
$ cd drumstick-x.x.x
$ mkdir -p build
$ cd build
$ cmake ..
(or ccmake ..)
(or cmake-gui ..)
(or cmake .. -options, see below...)
For simple test/development scenarios you can also use Qmake, but the Qmake-
based build system provides only minimal functionality.
$ make
(or make VERBOSE=1)
$ sudo make install
$ sudo ldconfig
(not needed if you only want STATIC_DRUMSTICK)
Requirements
------------
Minimum supported versions:
* CMake 2.6
* Qt4 4.4
* For Linux: ALSA 1.0
* shared-mime-info 0.30
See http://freedesktop.org/wiki/Software/shared-mime-info
The utility "update-mime-database" must be executed after installing the library
"drumstick-file" and the "drumstick.xml" file. This is automatically done by
the cmake build system unless you defined DESTDIR. In this case, your package
manager should perform it as a post-install step.
* Doxygen 1.5
See http://www.doxygen.org
If you want to generate the documentation for the libraries
If you want to generate and install the man pages, the build system can do it
if you have installed in your system the following packages:
* xsltproc program.
* docbook XSLT stylesheets.
The package names depend on the Linux distribution. For Debian they are:
xsltproc, docbook-xsl and docbook-xml. For openSUSE: libxslt, docbook_4, and
docbook-xsl-stylesheets.
Optional CMake parameters
-------------------------
-DSTATIC_DRUMSTICK=YES|ON|1
Build a static library instead of a shared object
-DSTATIC_DRUMSTICK=NO|OFF|0
Build a dynamic library (default)
-DCMAKE_BUILD_TYPE=Debug
Compile with debug flags enabled
-DCMAKE_BUILD_TYPE=Release
Compile without debug flags, and optimization enabled
-DCMAKE_CXX_FLAGS="-W -Wall"
Specify custom compilation flags
-DCMAKE_INSTALL_PREFIX=/usr/local
Specify the desired install prefix
Barcelona. Thursday, January 7, 2010
Project "aseqmm" has been renamed to "drumstick"
RSS newsfeed available at:
http://sourceforge.net/export/rss2_keepsake.php?group_id=296480
See INSTALL
\ No newline at end of file
Functions from ALSA library reported by chkcoverage.
The following functions won't be used in drumstick.
MISC (event filter)
snd_seq_change_bit
snd_seq_get_bit
snd_seq_set_bit
snd_seq_unset_bit
CLIENT - private functions
snd_seq_hw_open
snd_seq_hw_ops
snd_seq_create_event
snd_seq_event_types
TIMER - private functions
snd_timer_async
snd_timer_name
snd_timer_hw_open
snd_timer_nonblock
snd_timer_query_hw_open
snd_timer_type
#!/bin/bash
echo "List of ALSA sequencer/midi/timer symbols not yet wrapped by drumstick"
K=0
objdump -t -j *UND* build/library/libdrumstick.a | awk '{print $4}' | grep "^snd" > lib.txt
nm --defined-only -D /usr/lib/libasound.so | awk '{print $3}'| egrep "^snd_(seq|midi|timer)" |\
while read W; do
grep -q $W lib.txt
if [ "$?" != "0" ]; then
let K++
echo "$K $W"
fi
done
rm -f lib.txt
# origin: http://www.cmake.org/Wiki/CMakeMacroLibtoolFile
MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
GET_TARGET_PROPERTY (${_variable} ${_target} ${_property})
IF (${_variable} MATCHES ".*NOTFOUND$")
SET (${_variable} ${_default_value})
ENDIF (${_variable} MATCHES ".*NOTFOUND$")
ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT)
MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "")
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "")
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 0)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_age ${_target} LT_VERSION_AGE 0)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_revision ${_target} LT_VERSION_REVISION 0)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_installed ${_target} LT_INSTALLED yes)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "")
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "")
GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
SET(_laname ${_laname}.la)
SET(_laname_file "${CMAKE_CURRENT_BINARY_DIR}/${_laname}")
FILE(WRITE ${_laname_file} "# ${_laname} - a libtool library file, generated by cmake \n")
FILE(APPEND ${_laname_file} "# The name that we can dlopen(3).\n")
FILE(APPEND ${_laname_file} "dlname='${_soname}'\n")
FILE(APPEND ${_laname_file} "# Names of this library\n")
FILE(APPEND ${_laname_file} "library_names='${_soname}.${_target_current}.${_target_age}.${_target_revision} ${_soname}.${_target_current} ${_soname}'\n")
FILE(APPEND ${_laname_file} "# The name of the static archive\n")
FILE(APPEND ${_laname_file} "old_library='${_target_static_lib}'\n")
FILE(APPEND ${_laname_file} "# Libraries that this one depends upon.\n")
FILE(APPEND ${_laname_file} "dependency_libs='${_target_dependency_libs}'\n")
FILE(APPEND ${_laname_file} "# Version information.\n")
FILE(APPEND ${_laname_file} "current=${_target_current}\n")
FILE(APPEND ${_laname_file} "age=${_target_age}\n")
FILE(APPEND ${_laname_file} "revision=${_target_revision}\n")
FILE(APPEND ${_laname_file} "# Is this an already installed library?\n")
FILE(APPEND ${_laname_file} "installed=${_target_installed}\n")
FILE(APPEND ${_laname_file} "# Should we warn about portability when linking against -modules?\n")
FILE(APPEND ${_laname_file} "shouldnotlink=${_target_shouldnotlink}\n")
FILE(APPEND ${_laname_file} "# Files to dlopen/dlpreopen\n")
FILE(APPEND ${_laname_file} "dlopen='${_target_dlopen}'\n")
FILE(APPEND ${_laname_file} "dlpreopen='${_target_dlpreopen}'\n")
FILE(APPEND ${_laname_file} "# Directory that this library needs to be installed in:\n")
FILE(APPEND ${_laname_file} "libdir='${CMAKE_INSTALL_PREFIX}/${_install_DIR}'\n")
INSTALL(FILES ${_laname_file} DESTINATION ${_install_DIR})
ENDMACRO(CREATE_LIBTOOL_FILE)
# MIDI Sequencer C++ Library
# Copyright (C) 2008-2010 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; If not, see <http://www.gnu.org/licenses/>.
MACRO(CREATE_MANPAGES)
SET(outfiles)
FOREACH (it ${ARGN})
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfile}.1)
SET(outfiles ${outfiles} ${outfile})
ADD_CUSTOM_COMMAND( OUTPUT ${outfile}
COMMAND ${XSLTPROC_EXECUTABLE}
--nonet --xinclude --xincludestyle
--output ${outfile}
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
${infile}
DEPENDS ${infile})
ENDFOREACH (it)
ADD_CUSTOM_TARGET(manpages ALL DEPENDS ${outfiles})
INSTALL ( FILES ${outfiles}
DESTINATION share/man/man1 )
ENDMACRO(CREATE_MANPAGES)
# MIDI Sequencer C++ Library
# Copyright (C) 2008-2010 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA
# Try to find precompiled headers support for GCC 3.4 and 4.x
# Once done this will define:
#
# Variable:
# PCHSupport_FOUND
#
# Macro:
# ADD_PRECOMPILED_HEADER
IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS -dumpversion
OUTPUT_VARIABLE gcc_compiler_version)
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
GET_FILENAME_COMPONENT(_name ${_input} NAME)
SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
SET(_outdir "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
MAKE_DIRECTORY(${_outdir})
IF(NOT CMAKE_BUILD_TYPE)
SET(_output "${_outdir}/Custom.c++")
ELSE(NOT CMAKE_BUILD_TYPE)
SET(_output "${_outdir}/${CMAKE_BUILD_TYPE}.c++")
ENDIF(NOT CMAKE_BUILD_TYPE)
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(_compiler_FLAGS ${CMAKE_CXX_FLAGS} ${${_flags_var_name}})
SEPARATE_ARGUMENTS(_compiler_FLAGS)
#MESSAGE("_compiler_FLAGS: ${_compiler_FLAGS}")
GET_DIRECTORY_PROPERTY(_dir_FLAGS INCLUDE_DIRECTORIES)
FOREACH(item ${_dir_FLAGS})
LIST(APPEND _include_FLAGS "-I${item}")
ENDFOREACH(item)
#MESSAGE("_include_FLAGS: ${_include_FLAGS}")
GET_DIRECTORY_PROPERTY(_definitions24 DEFINITIONS)
GET_DIRECTORY_PROPERTY(_definitions26 COMPILE_DEFINITIONS)
SET(_definitions ${_definitions24})
SEPARATE_ARGUMENTS(_definitions)
FOREACH(def ${_definitions26})
LIST(APPEND _definitions "-D${def}")
ENDFOREACH(def)
STRING(TOUPPER "COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE}" _defs_var_name)
GET_DIRECTORY_PROPERTY(_definitions_buildtype ${_defs_var_name})
FOREACH(def ${_definitions_buildtype})
LIST(APPEND _definitions "-D${def}")
ENDFOREACH(def)
LIST(REMOVE_DUPLICATES _definitions)
#MESSAGE("_definitions: ${_definitions}")
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND ${CMAKE_CXX_COMPILER}
${_compiler_FLAGS}
${_include_FLAGS}
${_definitions}
-x c++-header
-o ${_output} ${_source}
DEPENDS ${_source} )
ADD_CUSTOM_TARGET(${_targetName} DEPENDS ${_output})
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_name} -Winvalid-pch -H")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_name} -Winvalid-pch")
ENDMACRO(ADD_PRECOMPILED_HEADER)
# - Try to find the shared-mime-info package
#
# SHARED_MIME_INFO_MINIMUM_VERSION - Set this to the minimum version you need, default is 0.18
#
# Once done this will define
#
# SHARED_MIME_INFO_FOUND - system has the shared-mime-info package
# UPDATE_MIME_DATABASE_EXECUTABLE - the update-mime-database executable
# Copyright (c) 2007, Pino Toscano, <toscano.pino@tiscali.it>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# the minimum version of shared-mime-database we require
if (NOT SHARED_MIME_INFO_MINIMUM_VERSION)
set(SHARED_MIME_INFO_MINIMUM_VERSION "0.18")
endif (NOT SHARED_MIME_INFO_MINIMUM_VERSION)
if (UPDATE_MIME_DATABASE_EXECUTABLE)
# in cache already
set(SHARED_MIME_INFO_FOUND TRUE)
else (UPDATE_MIME_DATABASE_EXECUTABLE)
include (MacroEnsureVersion)
find_program (UPDATE_MIME_DATABASE_EXECUTABLE NAMES update-mime-database)
if (UPDATE_MIME_DATABASE_EXECUTABLE)
exec_program (${UPDATE_MIME_DATABASE_EXECUTABLE} ARGS -v RETURN_VALUE _null OUTPUT_VARIABLE _smiVersionRaw)
string(REGEX REPLACE "update-mime-database \\([a-zA-Z\\-]+\\) ([0-9]\\.[0-9]+).*"
"\\1" smiVersion "${_smiVersionRaw}")
set (SHARED_MIME_INFO_FOUND TRUE)
endif (UPDATE_MIME_DATABASE_EXECUTABLE)
if (SHARED_MIME_INFO_FOUND)
if (NOT SharedMimeInfo_FIND_QUIETLY)
message(STATUS "Found shared-mime-info version: ${smiVersion}")
macro_ensure_version(${SHARED_MIME_INFO_MINIMUM_VERSION} ${smiVersion} _smiVersion_OK)
if (NOT _smiVersion_OK)
message(FATAL_ERROR "The found version of shared-mime-info (${smiVersion}) is below the minimum required (${SHARED_MIME_INFO_MINIMUM_VERSION})")
endif (NOT _smiVersion_OK)
endif (NOT SharedMimeInfo_FIND_QUIETLY)
else (SHARED_MIME_INFO_FOUND)
if (SharedMimeInfo_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find shared-mime-info. See http://freedesktop.org/wiki/Software/shared-mime-info.")
endif (SharedMimeInfo_FIND_REQUIRED)
endif (SHARED_MIME_INFO_FOUND)
endif (UPDATE_MIME_DATABASE_EXECUTABLE)
mark_as_advanced(UPDATE_MIME_DATABASE_EXECUTABLE)
macro(UPDATE_XDG_MIMETYPES _path)
get_filename_component(_xdgmimeDir "${_path}" NAME)
if("${_xdgmimeDir}" STREQUAL packages )
get_filename_component(_xdgmimeDir "${_path}" PATH)
else("${_xdgmimeDir}" STREQUAL packages )
set(_xdgmimeDir "${_path}")
endif("${_xdgmimeDir}" STREQUAL packages )
install(CODE "
set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
if (NOT DESTDIR_VALUE)
# under Windows relative paths are used, that's why it runs from CMAKE_INSTALL_PREFIX
execute_process(COMMAND ${UPDATE_MIME_DATABASE_EXECUTABLE} ${_xdgmimeDir}
WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\")
endif (NOT DESTDIR_VALUE)
")
endmacro (UPDATE_XDG_MIMETYPES)
# This file defines the following macros for developers to use in ensuring
# that installed software is of the right version:
#
# MACRO_ENSURE_VERSION - test that a version number is greater than
# or equal to some minimum
# MACRO_ENSURE_VERSION_RANGE - test that a version number is greater than
# or equal to some minimum and less than some
# maximum
# MACRO_ENSURE_VERSION2 - deprecated, do not use in new code
#
# MACRO_ENSURE_VERSION
# This macro compares version numbers of the form "x.y.z" or "x.y"
# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK)
# will set FOO_VERSION_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
# Leading and trailing text is ok, e.g.
# MACRO_ENSURE_VERSION( "2.5.31" "flex 2.5.4a" VERSION_OK)
# which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system