Convert build system to use cmake and fix for Mac OS X build
This commit is contained in:
parent
5d147c9f04
commit
e40c32d8ad
|
|
@ -1,2 +1,5 @@
|
|||
*.o
|
||||
dsd
|
||||
*.[ao]
|
||||
*.so*
|
||||
*.dylib
|
||||
build
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
project(dsd)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
FILE(GLOB SRCS *.c)
|
||||
|
||||
INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}" "${CMAKE_INSTALL_PREFIX}/include")
|
||||
LINK_DIRECTORIES("${CMAKE_INSTALL_PREFIX}/lib")
|
||||
|
||||
ADD_EXECUTABLE(dsd ${SRCS})
|
||||
TARGET_LINK_LIBRARIES(dsd mbe)
|
||||
|
||||
install(TARGETS dsd DESTINATION bin)
|
||||
|
||||
# uninstall target
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
6
Makefile
6
Makefile
|
|
@ -14,9 +14,9 @@
|
|||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -O2 -Wall
|
||||
INCLUDES = -I. -I/usr/local/include -I/usr/include
|
||||
LIBS = -L/usr/local/lib -lm -lmbe
|
||||
CFLAGS = -O2 -Wall -g
|
||||
INCLUDES = -I. -I/usr/local/include -I/usr/include -I../mbelib-master
|
||||
LIBS = -L/usr/local/lib -L../mbelib-master -lm -lmbe
|
||||
INSTALL=install
|
||||
AR=ar
|
||||
RANLIB=ranlib
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
cmake_policy(SET CMP0007 OLD)
|
||||
list(REVERSE files)
|
||||
foreach (file ${files})
|
||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
if (EXISTS "$ENV{DESTDIR}${file}")
|
||||
execute_process(
|
||||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
if(NOT ${rm_retval} EQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
endif (NOT ${rm_retval} EQUAL 0)
|
||||
else (EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
endif (EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
||||
2
dsd.h
2
dsd.h
|
|
@ -31,7 +31,7 @@
|
|||
#ifdef SOLARIS
|
||||
#include <sys/audioio.h>
|
||||
#endif
|
||||
#ifdef BSD
|
||||
#if defined(BSD) && !defined(__APPLE__)
|
||||
#include <sys/soundcard.h>
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ openAudioOutDevice (dsd_opts * opts, int speed)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef BSD
|
||||
#if defined(BSD) && !defined(__APPLE__)
|
||||
|
||||
int fmt;
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ openAudioInDevice (dsd_opts * opts)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef BSD
|
||||
#if defined(BSD) && !defined(__APPLE__)
|
||||
int fmt;
|
||||
|
||||
if (opts->split == 1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue