Skip to content

Commit

Permalink
fix to work with macosx (cmake -g "Unix Makefiles")
Browse files Browse the repository at this point in the history
  • Loading branch information
edy555 committed Mar 16, 2012
1 parent 1df30ef commit 8a51849
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Modules/CMakeASM_YASMInformation.cmake
@@ -1,7 +1,13 @@
set(ASM_DIALECT "_YASM")
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)

if(UNIX)
if(APPLE)
if(BITS EQUAL 64)
set(CMAKE_ASM_YASM_COMPILER_ARG1 "-f macho64 -DARCH_X86_64 -DPREFIX")
else()
set(CMAKE_ASM_YASM_COMPILER_ARG1 "-f macho32 -DPREFIX")
endif()
elseif(UNIX)
if(BITS EQUAL 64)
set(CMAKE_ASM_YASM_COMPILER_ARG1 "-f elf64 -DARCH_X86_64")
else()
Expand Down
4 changes: 4 additions & 0 deletions examples/27c3_slides/CMakeLists.txt
Expand Up @@ -30,6 +30,10 @@ if(CURSES_FOUND AND FFMPEG_FOUND)

target_link_libraries(slides openlase ${FFMPEG_LIBRARIES} ${CURSES_LIBRARIES})

if(APPLE)
target_link_libraries(slides "-framework CoreFoundation" "-framework VideoDecodeAcceleration" "-framework QuartzCore" bz2 z)
endif(APPLE)

function(svg2ild NAME)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.ild
DEPENDS ${CMAKE_SOURCE_DIR}/tools/svg2ild.py
Expand Down
2 changes: 2 additions & 0 deletions examples/CMakeLists.txt
Expand Up @@ -28,8 +28,10 @@ target_link_libraries(scope ${JACK_LIBRARIES} m)
add_executable(simple simple.c)
target_link_libraries(simple openlase)

if(NOT APPLE)
add_executable(pong pong.c)
target_link_libraries(pong openlase)
endif()

if(ALSA_FOUND)
add_executable(midiview midiview.c)
Expand Down
1 change: 1 addition & 0 deletions libol/CMakeLists.txt
Expand Up @@ -15,6 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
include (CheckFunctionExists)

check_include_files(malloc.h HAVE_MALLOC_H)
check_function_exists(memalign HAVE_MEMALIGN)
Expand Down
2 changes: 2 additions & 0 deletions libol/trace.c
Expand Up @@ -22,7 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif

#include "trace.h"
#include "align.h"
Expand Down
6 changes: 5 additions & 1 deletion tools/CMakeLists.txt
Expand Up @@ -25,7 +25,11 @@ target_link_libraries(playilda ${JACK_LIBRARIES})
if(FFMPEG_FOUND)
include_directories(${FFMPEG_INCLUDE_DIR})
add_executable(playvid playvid.c)
target_link_libraries(playvid openlase ${FFMPEG_LIBRARIES})
target_link_libraries(playvid openlase ${FFMPEG_LIBRARIES})

if(APPLE)
target_link_libraries(playvid "-framework CoreFoundation" "-framework VideoDecodeAcceleration" "-framework QuartzCore" bz2 z)
endif(APPLE)
else()
message(STATUS "Will NOT build playvid (FFmpeg missing)")
endif()
Expand Down
1 change: 0 additions & 1 deletion tools/playvid.c
Expand Up @@ -158,7 +158,6 @@ int av_vid_init(char *file)
return -1;

dump_format(pFormatCtx, 0, file, 0);

videoStream=-1;
for (i=0; i<pFormatCtx->nb_streams; i++) {
if (pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
Expand Down
6 changes: 6 additions & 0 deletions tools/simulator.c
Expand Up @@ -25,9 +25,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <math.h>
#include <jack/jack.h>

#ifdef __APPLE__
#include <GLUT/glut.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#endif

int window;

Expand Down

0 comments on commit 8a51849

Please sign in to comment.