Skip to content

Instantly share code, notes, and snippets.

@d-reinhold
Last active December 19, 2015 01:58
Show Gist options
  • Save d-reinhold/5879200 to your computer and use it in GitHub Desktop.
Save d-reinhold/5879200 to your computer and use it in GitHub Desktop.
ProjectM notes:
Install JackOSX 0.90 beta 13 from:
http://www.jackosx.com
Install cmake using Homebrew
Download Qt from:
https://qt-project.org/downloads
I used Qt4 and compiled it statically from source. Static building isn't necessary but made it (in some ways) easier to make a self-contained application.
Download ProjectM source code from:
https://sourceforge.net/projects/projectm/files/2.1.0/projectM-complete-2.1.0-Source.tar.gz/download
cd into the top level directory of the unzipped source. Should contain playlists, presets, src, and other folders.
type 'ccmake .'
Use something similar to the following configuration:
BUILD_PROJECTM_JACK_STATIC ON
BUILD_PROJECTM_QT_STATIC ON
BUILD_PROJECTM_STATIC ON
CMAKE_BACKWARDS_COMPATIBILITY 2.4
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /usr/local
CMAKE_OSX_ARCHITECTURES
CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.7.sdk
DISABLE_MILKDROP_PRESETS OFF
DISABLE_NATIVE_PRESETS OFF
DL_LIBRARIES /usr/lib/libdl.dylib
EXECUTABLE_OUTPUT_PATH /Users/dominick/projectM-build-for-app
GLEW_INCLUDE_DIR /Users/dominick/code/spotify/visualizer/glew-1.9.0/inc
GLEW_LIBRARY /Users/dominick/code/spotify/visualizer/glew-1.9.0/lib
INCLUDE-NATIVE-PRESETS ON
INCLUDE-PROJECTM-JACK ON
INCLUDE-PROJECTM-LIBVISUAL OFF
INCLUDE-PROJECTM-LIBVISUAL-ALS OFF
INCLUDE-PROJECTM-PULSEAUDIO OFF
INCLUDE-PROJECTM-QT ON
INCLUDE-PROJECTM-TEST OFF
INCLUDE-PROJECTM-XMMS OFF
LIBRARY_OUTPUT_PATH /Users/dominick/fixed-projectM-build-for-app
LIB_INSTALL_DIR ${exec_prefix}/lib
QT_JACK_SUPPORT ON
QT_QMAKE_EXECUTABLE QT_QMAKE_EXECUTABLE-NOTFOUND
SDL_INCLUDE_DIR /Library/Frameworks/SDL.framework/Headers
SDL_LIBRARY /Library/Frameworks/SDL.framework;-framework Cocoa
USE_CG OFF
USE_DEVIL OFF
USE_FBO OFF
USE_FTGL OFF
USE_GLES1 OFF
USE_NATIVE_GLEW ON
USE_OPENMP ON
USE_THREADS ON
projectM_FONT_MENU /usr/local/Resources/fonts/VeraMono.ttf
projectM_FONT_TITLE /usr/local/Resources/fonts/Vera.ttf
and press 'c' to start configuring your build.
It can break at this stage if necessary software doesn't exist or can't be found on your system. Just make sure you have everything it asks for and be very explicit about where it is located.
If configuring succeeds, you must press 'g' to generate a bunch of makefiles. This usually won't fail.
When this is over, type make to begin the building process. There are a ton of things that can go wrong here. I've made notes of the most common and frustrating issues that I ran into, and included solutions so you won't have to spend all the hours researching them that I did!
--------------------------------------------------------------------------------
To fix:
Undefined symbols for architecture x86_64:
"_kCFAllocatorDefault", referenced from:
Add:
"-framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration" to the linker command line options.
--------------------------------------------------------------------------------
To fix:
Linking CXX executable /Users/dominick/code/spotify/visualizer/build/bin/projectM-jack
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
(maybe you meant: _SDL_main)
Install SDL via brew `brew install sdl` and use `sdl-config --cflags --libs` to locate SDL libraries for linking projectm-jack and presets
Add:
"-I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa" to linker
--------------------------------------------------------------------------------
To fix:
Linking CXX executable /Users/dominick/code/spotify/visualizer/build/bin/projectM-jack
Undefined symbols for architecture x86_64:
"_glShadeModel", referenced from:
setup_opengl(int, int)in video_init.o
Add:
"-framework OpenGL" to linker
--------------------------------------------------------------------------------
To fix mkdir error:
add <sys/stat.h>
--------------------------------------------------------------------------------
When building with tests, add
#include </Users/dominick/code/spotify/visualizer/projectM-SLIM/src/macos/FTGL/unix/GL/gl.h>
#include </Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/glu.h>
to projectM-test.cpp
--------------------------------------------------------------------------------
To build with jack and Qt and prevent:
make[2]: *** No rule to make target `/projectM-engine/libprojectM.a', needed by `/Users/dominick/projectM-jack-qt-static/projectM-jack'. Stop.
Solution:
Open:
/Users/dominick/code/spotify/visualizer/projectM-SLIM/src/projectM-jack/CMakeFiles/projectM-jack.dir/build.make
and replace
#/Users/dominick/projectM-jack-qt-static/projectM-jack: /projectM-engine/libprojectM.a
#/Users/dominick/projectM-jack-qt-static/projectM-jack: /projectM-qt/libprojectM-qt.a
with:
/Users/dominick/projectM-jack-qt-static/projectM-jack: /Users/dominick/projectM-jack-qt-static/libprojectM.a
/Users/dominick/projectM-jack-qt-static/projectM-jack: /Users/dominick/projectM-jack-qt-static/libprojectM-qt.a
then open:
/Users/dominick/code/spotify/visualizer/projectM-SLIM/src/projectM-jack/CMakeFiles/projectM-jack.dir/link.txt
and replace
/projectM-engine/libprojectM.a
with
/Users/dominick/projectM-jack-qt-static/libprojectM.a
and replace
/projectM-qt/libprojectM-qt.a
with
/Users/dominick/projectM-jack-qt-static/libprojectM-qt.a
--------------------------------------------------------------------------------
If a library is not found, i.e.:
Linking CXX shared library /Users/dominick/projectM-jack-qt-static/libprojectM-qt.dylib
ld: library not found for -lGLEW
collect2: ld returned 1 exit status
Then change /usr/lib/libGLEW.1.9.0.dylib to -L/Developer/SDKs/MacOSX10.7.sdk/usr/lib/libGLEW.1.9.0.dylib
--------------------------------------------------------------------------------
If the linker complains about the GL library:
Linking CXX shared library /Users/dominick/projectM-jack-qt-static/libprojectM-qt.dylib
ld: library not found for -lGL
collect2: ld returned 1 exit status
Delete '-lGL' from the link.txt and make sure '-framework OpenGL' is present
--------------------------------------------------------------------------------
When building with Qt static:
link.txt for projectm-jack:
/usr/bin/c++ -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/projectM-jack.dir/qprojectM-jack.o CMakeFiles/projectM-jack.dir/ConfigFile.o -o /Users/dominick/packaged-projectM-jack2/projectM-jack.app/Contents/MacOS/projectM-jack /Users/dominick/packaged-projectM-jack2/projectM-jack.app/Contents/Plugins/libprojectM.a /Users/dominick/packaged-projectM-jack2/projectM-jack.app/Contents/Plugins/libprojectM-qt.a /Users/dominick/packaged-projectM-jack2/projectM-jack.app/Contents/Plugins/libRenderer.a /Users/dominick/packaged-projectM-jack2/projectM-jack.app/Contents/Plugins/libNativePresetFactory.a /Users/dominick/packaged-projectM-jack2/projectM-jack.app/Contents/Plugins/libMilkdropPresetFactory.a -ljack /usr/local/Trolltech/Qt-4.8.4/lib/libQtGui.a /usr/local/Trolltech/Qt-4.8.4/lib/libQtOpenGL.a /usr/local/Trolltech/Qt-4.8.4/lib/libQtCore.a -framework AGL -framework OpenGL -framework AGL -framework OpenGL /usr/local/Trolltech/Qt-4.8.4/lib/libQtXml.a /usr/local/Trolltech/Qt-4.8.4/lib/libQtSvg.a -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -framework Security -framework Carbon /Users/dominick/code/spotify/visualizer/zlib-1.2.8/libz.a -framework AppKit /usr/local/Trolltech/Qt-4.8.4/plugins/iconengines/libqsvgicon.a /usr/local/Trolltech/Qt-4.8.4/plugins/imageformats/libqico.a /usr/local/Trolltech/Qt-4.8.4/plugins/imageformats/libqsvg.a /usr/local/Trolltech/Qt-4.8.4/plugins/imageformats/libqtga.a /usr/local/Trolltech/Qt-4.8.4/plugins/imageformats/libqjpeg.a /usr/local/Trolltech/Qt-4.8.4/plugins/imageformats/libqgif.a /usr/local/Trolltech/Qt-4.8.4/plugins/imageformats/libqtiff.a
you might need to build zlib?
--------------------------------------------------------------------------------
Use FULL PATHS for images in qplaylistmodel.cpp and ui_qprojectm_mainwindow.h to get icons to appear!!!
ui_qprojectm_mainwindow.h can be overwritten during a build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment