Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
*.slo
*.lo
*.o
*~

Makefile
av/av
source/av_ffi_header.cpp
CMakeCache.txt
CMakeFiles/
cmake_install.cmake


*.lai
*.la
Expand All @@ -18,4 +27,13 @@
*.perspectivev3
*.xcuserdatad

build
build
.ninja_deps
.ninja_log
build.ninja
rules.ninja
CMakeScripts/
av.build/
av.xcodeproj/
source/Debug/

12 changes: 6 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "src/luajit-2.0"]
path = src/luajit-2.0
url = http://luajit.org/git/luajit-2.0.git
[submodule "src/hidapi"]
path = src/hidapi
url = git://github.com/signal11/hidapi.git
[submodule "Penlight"]
path = Penlight
url = https://github.com/stevedonovan/Penlight.git
[submodule "LDoc"]
path = LDoc
url = https://github.com/stevedonovan/LDoc.git
44 changes: 44 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
cmake_minimum_required(VERSION 2.8)

project(av)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
set(CMAKE_BUILD_TYPE Release)

# do if/else to fix this on some platforms...
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -pagezero_size 10000 -image_base 100000000")

find_package(LuaJIT REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLFW REQUIRED)

# generate embedded script .cpp (aka av_ffi_header). check "result" variable if desired.
#
execute_process(
COMMAND luajit h2ffi.lua av.h av_ffi_header
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/source
RESULT_VARIABLE result
)

set(SOURCES
${CMAKE_SOURCE_DIR}/source/av.cpp
${CMAKE_SOURCE_DIR}/source/av_audio.cpp
${CMAKE_SOURCE_DIR}/source/RtAudio.cpp
)

set(INCLUDE_DIRS
${LUAJIT_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR}
${GLFW_INCLUDE_DIR}
)
include_directories(${INCLUDE_DIRS})

set(LINK_LIBRARIES
${LUAJIT_LIBRARIES}
${GLFW_LIBRARY}
${OPENGL_LIBRARY}
)

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/av)
add_executable(${CMAKE_PROJECT_NAME} ${SOURCES})
target_link_libraries(${CMAKE_PROJECT_NAME} ${LINK_LIBRARIES})
1 change: 1 addition & 0 deletions LDoc
Submodule LDoc added at 52e9b6
1 change: 1 addition & 0 deletions Penlight
Submodule Penlight added at e7eebb
Binary file removed av.exe
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file removed av_linux
Binary file not shown.
Binary file removed av_osx
Binary file not shown.
70 changes: 70 additions & 0 deletions cmake/FindGLFW.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Locate the glfw library
# This module defines the following variables:
# GLFW_LIBRARY, the name of the library;
# GLFW_INCLUDE_DIR, where to find glfw include files.
# GLFW_FOUND, true if both the GLFW_LIBRARY and GLFW_INCLUDE_DIR have been found.
#
# To help locate the library and include file, you could define an environment variable called
# GLFW_ROOT which points to the root of the glfw library installation. This is pretty useful
# on a Windows platform.
#
#
# Usage example to compile an "executable" target to the glfw library:
#
# FIND_PACKAGE (glfw REQUIRED)
# INCLUDE_DIRECTORIES (${GLFW_INCLUDE_DIR})
# ADD_EXECUTABLE (executable ${EXECUTABLE_SRCS})
# TARGET_LINK_LIBRARIES (executable ${GLFW_LIBRARY})
#
# TODO:
# Allow the user to select to link to a shared library or to a static library.

#Search for the include file...
FIND_PATH(GLFW_INCLUDE_DIR GL/glfw.h DOC "Path to GLFW include directory."
HINTS
$ENV{GLFW_ROOT}
PATH_SUFFIX include
PATHS
/usr/include/
/usr/local/include/
# By default headers are under GL subfolder
/usr/include/GL
/usr/local/include/GL
${GLFW_ROOT_DIR}/include/ # added by ptr
)

FIND_LIBRARY(GLFW_LIBRARY_TEMP DOC "Absolute path to GLFW library."
NAMES glfw GLFW.lib
HINTS
$ENV{GLFW_ROOT}
# In the expanded GLFW source archive. Should be uncommon, but whatever.
PATH_SUFFIXES lib/win32 lib/cocoa lib/x11
PATHS
/usr/local/lib
/usr/lib
${GLFW_ROOT_DIR}/lib-msvc100/release # added by ptr
)

SET(GLFW_FOUND "NO")
IF(GLFW_LIBRARY_TEMP AND GLFW_INCLUDE_DIR)
SET(GLFW_FOUND "YES")
message(STATUS "Found GLFW: ${GLFW_LIBRARY_TEMP}")

# For MinGW library
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
SET(GLFW_LIBRARY_TEMP ${MINGW32_LIBRARY} ${GLFW_LIBRARY_TEMP})
ENDIF(MINGW)

# OS X uses the Cocoa port so we need to link against Cocoa
IF(APPLE)
SET(GLFW_LIBRARY_TEMP ${GLFW_LIBRARY_TEMP} "-framework Cocoa -framework IOKit")
SET(GLFW_LIBRARY ${GLFW_LIBRARY_TEMP})
ENDIF(APPLE)

# Set the final string here so the GUI reflects the final state.
SET(GLFW_LIBRARY ${GLFW_LIBRARY_TEMP} CACHE STRING "Where the GLFW Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(GLFW_LIBRARY_TEMP "" CACHE INTERNAL "")
ENDIF(GLFW_LIBRARY_TEMP AND GLFW_INCLUDE_DIR)

92 changes: 92 additions & 0 deletions cmake/FindGLUT.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# - try to find glut library and include files
# GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
# GLUT_LIBRARIES, the libraries to link against
# GLUT_FOUND, If false, do not try to use GLUT.
# Also defined, but not for general use are:
# GLUT_glut_LIBRARY = the full path to the glut library.
# GLUT_Xmu_LIBRARY = the full path to the Xmu library.
# GLUT_Xi_LIBRARY = the full path to the Xi Library.

#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)

IF (WIN32)
FIND_PATH( GLUT_INCLUDE_DIR NAMES GL/glut.h
PATHS ${GLUT_ROOT_PATH}/include )
FIND_LIBRARY( GLUT_glut_LIBRARY NAMES glut glut32
PATHS
${OPENGL_LIBRARY_DIR}
${GLUT_ROOT_PATH}/Release
)
ELSE (WIN32)

IF (APPLE)
# These values for Apple could probably do with improvement.
FIND_PATH( GLUT_INCLUDE_DIR glut.h
/System/Library/Frameworks/GLUT.framework/Versions/A/Headers
${OPENGL_LIBRARY_DIR}
)
SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
SET(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
ELSE (APPLE)

FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
/usr/include/GL
/usr/openwin/share/include
/usr/openwin/include
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglut
)

FIND_LIBRARY( GLUT_glut_LIBRARY glut
/usr/openwin/lib
)

# FIND_LIBRARY( GLUT_Xi_LIBRARY Xi
# /usr/openwin/lib
# )

# FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu
# /usr/openwin/lib
# )

ENDIF (APPLE)

ENDIF (WIN32)

SET( GLUT_FOUND "NO" )
IF(GLUT_INCLUDE_DIR)
IF(GLUT_glut_LIBRARY)
# Is -lXi and -lXmu required on all platforms that have it?
# If not, we need some way to figure out what platform we are on.
SET( GLUT_LIBRARIES
${GLUT_glut_LIBRARY}
${GLUT_Xmu_LIBRARY}
${GLUT_Xi_LIBRARY}
${GLUT_cocoa_LIBRARY}
)
SET( GLUT_FOUND "YES" )

#The following deprecated settings are for backwards compatibility with CMake1.4
SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})

ENDIF(GLUT_glut_LIBRARY)
ENDIF(GLUT_INCLUDE_DIR)

MARK_AS_ADVANCED(
GLUT_INCLUDE_DIR
GLUT_glut_LIBRARY
# GLUT_Xmu_LIBRARY
# GLUT_Xi_LIBRARY
)
78 changes: 78 additions & 0 deletions cmake/FindLuaJIT.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Locate Lua library
# This module defines
# LUAJIT_FOUND, if false, do not try to link to Lua
# LUAJIT_LIBRARIES
# LUAJIT_INCLUDE_DIR, where to find lua.h
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/

#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
#
# ################
# 2010 - modified for cronkite to find luajit instead of lua, as it was before.
#

FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
HINTS
$ENV{LUAJIT_DIR}
PATH_SUFFIXES include/luajit-2.0 include/luajit2.0 include/luajit include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)

FIND_LIBRARY(LUAJIT_LIBRARY
NAMES luajit-51 luajit-5.1 luajit
HINTS
$ENV{LUAJIT_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)

IF(LUAJIT_LIBRARY)
# include the math library for Unix
IF(UNIX AND NOT APPLE)
FIND_LIBRARY(LUAJIT_MATH_LIBRARY m)
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
ELSE(UNIX AND NOT APPLE)
SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
ENDIF(UNIX AND NOT APPLE)
ENDIF(LUAJIT_LIBRARY)

INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT DEFAULT_MSG LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)

MARK_AS_ADVANCED(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
12 changes: 12 additions & 0 deletions distclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rm -rf CMakeCache.txt cmake_install.cmake CMakeFiles/ CMakeScripts/
rm -rf av/av
rm -rf Makefile
rm -rf .ninja_deps
rm -rf .ninja_log
rm -rf build.ninja
rm -rf rules.ninja
rm -rf CMakeScripts/
rm -rf av.build/
rm -rf av.xcodeproj/
rm -rf source/Debug/

Loading