mirror of
https://github.com/halpz/re3.git
synced 2025-06-27 00:36:19 +00:00
Add basic support for cmake on linux
This commit is contained in:
28
cmake/FindMPG123.cmake
Normal file
28
cmake/FindMPG123.cmake
Normal file
@ -0,0 +1,28 @@
|
||||
# - Find mpg123
|
||||
# Find the native mpg123 includes and library
|
||||
#
|
||||
# MPG123_INCLUDE_DIR - where to find mpg123.h
|
||||
# MPG123_LIBRARIES - List of libraries when using mpg123.
|
||||
# MPG123_FOUND - True if mpg123 found.
|
||||
|
||||
IF(MPG123_INCLUDE_DIR AND MPG123_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
SET(MPG123_FIND_QUIETLY TRUE)
|
||||
ENDIF(MPG123_INCLUDE_DIR AND MPG123_LIBRARIES)
|
||||
|
||||
FIND_PATH(MPG123_INCLUDE_DIR mpg123.h
|
||||
PATHS "${MPG123_DIR}"
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(MPG123_LIBRARIES NAMES mpg123 mpg123-0
|
||||
PATHS "${MPG123_DIR}"
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
|
||||
# MARK_AS_ADVANCED(MPG123_LIBRARIES MPG123_INCLUDE_DIR)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set MPG123_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPG123 DEFAULT_MSG MPG123_LIBRARIES MPG123_INCLUDE_DIR)
|
67
cmake/FindSndFile.cmake
Normal file
67
cmake/FindSndFile.cmake
Normal file
@ -0,0 +1,67 @@
|
||||
# Found on http://hg.kvats.net
|
||||
#
|
||||
# - Try to find libsndfile
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# SNDFILE_FOUND - system has libsndfile
|
||||
# SNDFILE_INCLUDE_DIRS - the libsndfile include directory
|
||||
# SNDFILE_LIBRARIES - Link these to use libsndfile
|
||||
#
|
||||
# Copyright (C) 2006 Wengo
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
if (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(SNDFILE_FOUND TRUE)
|
||||
else (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
|
||||
|
||||
find_path(SNDFILE_INCLUDE_DIR
|
||||
NAMES
|
||||
sndfile.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
)
|
||||
|
||||
find_library(SNDFILE_LIBRARY
|
||||
NAMES
|
||||
sndfile
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
set(SNDFILE_INCLUDE_DIRS
|
||||
${SNDFILE_INCLUDE_DIR}
|
||||
)
|
||||
set(SNDFILE_LIBRARIES
|
||||
${SNDFILE_LIBRARY}
|
||||
)
|
||||
|
||||
if (SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
|
||||
set(SNDFILE_FOUND TRUE)
|
||||
endif (SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
|
||||
|
||||
if (SNDFILE_FOUND)
|
||||
if (NOT SndFile_FIND_QUIETLY)
|
||||
message(STATUS "Found libsndfile: ${SNDFILE_LIBRARIES}")
|
||||
endif (NOT SndFile_FIND_QUIETLY)
|
||||
else (SNDFILE_FOUND)
|
||||
if (SndFile_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find libsndfile")
|
||||
endif (SndFile_FIND_REQUIRED)
|
||||
endif (SNDFILE_FOUND)
|
||||
|
||||
# show the SNDFILE_INCLUDE_DIRS and SNDFILE_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(SNDFILE_INCLUDE_DIRS SNDFILE_LIBRARIES)
|
||||
|
||||
endif (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
|
Reference in New Issue
Block a user