Skip to content

Commit

Permalink
can build libprojectM+renderer+presetfactories and projectM-SDL with …
Browse files Browse the repository at this point in the history
…some Make. cmake status: BTFO
  • Loading branch information
revmischa committed Sep 18, 2017
1 parent 67eaf6d commit 7828b8f
Show file tree
Hide file tree
Showing 19 changed files with 148 additions and 27 deletions.
12 changes: 0 additions & 12 deletions .gitignore
Expand Up @@ -2,15 +2,3 @@ xcuserdata
src/projectM-emscripten/build/presets
presets/custom
project.xcworkspace

# cmake
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake

3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "build"]
path = build
url = https://github.com/c3d/build.git
4 changes: 4 additions & 0 deletions Makefile
@@ -0,0 +1,4 @@
all: src.build

src.build:
$(MAKE) -C src
1 change: 1 addition & 0 deletions build
Submodule build added at 7f0436
9 changes: 9 additions & 0 deletions src/Makefile
@@ -0,0 +1,9 @@
.PHONY: libprojectM SDL

all: libprojectM SDL

libprojectM:
$(MAKE) -C libprojectM

SDL:
$(MAKE) -C projectM-sdl
8 changes: 4 additions & 4 deletions src/libprojectM/Common.hpp
Expand Up @@ -46,7 +46,7 @@
//extern FILE *debugFile;
#endif

#ifdef MACOS
#ifdef __APPLE__
#include <cstdio>
extern FILE *fmemopen(void *buf, size_t len, const char *pMode);
#endif /** MACOS */
Expand Down Expand Up @@ -75,7 +75,7 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode);
#define projectM_isnan(x) ((x) != (x))
#endif

#ifdef MACOS
#ifdef __APPLE__
#define projectM_isnan(x) ((x) != (x))
#endif

Expand All @@ -87,7 +87,7 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode);
#define projectM_fmax(x,y) ((x) >= (y) ? (x): (y))
#endif

#ifdef MACOS
#ifdef __APPLE__
#define projectM_fmax(x,y) ((x) >= (y) ? (x): (y))
#endif

Expand All @@ -99,7 +99,7 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode);
#define projectM_fmin(x,y) ((x) <= (y) ? (x): (y))
#endif

#ifdef MACOS
#ifdef __APPLE__
#define projectM_fmin(x,y) ((x) <= (y) ? (x): (y))
#endif

Expand Down
19 changes: 19 additions & 0 deletions src/libprojectM/Makefile
@@ -0,0 +1,19 @@
BUILD=../../build/

SOURCES=projectM.cpp PCM.cpp Preset.cpp fftsg.cpp KeyHandler.cpp \
timer.cpp wipemalloc.cpp PresetLoader.cpp PresetChooser.cpp \
PipelineMerger.cpp ConfigFile.cpp \
TimeKeeper.cpp PresetFactory.cpp PresetFactoryManager.cpp

CONFIG=libgl

CPPFLAGS+= -I . -I Renderer
LDFLAGS+=-lgl
LIBRARIES=Renderer MilkdropPresetFactory NativePresetFactory

PRODUCTS=libprojectM.lib

include $(BUILD)rules.mk

$(BUILD)rules.mk:
cd .. && git submodule update --init --recursive
28 changes: 28 additions & 0 deletions src/libprojectM/MilkdropPresetFactory/Makefile
@@ -0,0 +1,28 @@
BUILD=../../../build/

SOURCES= \
BuiltinFuncs.cpp \
Func.cpp MilkdropPreset.cpp \
PresetFrameIO.cpp \
CustomShape.cpp \
Eval.cpp \
MilkdropPresetFactory.cpp \
PerPixelEqn.cpp BuiltinParams.cpp \
InitCond.cpp Parser.cpp \
CustomWave.cpp Expr.cpp \
PerPointEqn.cpp Param.cpp \
PerFrameEqn.cpp \
IdlePreset.cpp \
../PresetFactory.cpp \


CPPFLAGS+= -I. -I..
#LDFLAGS+=-lftgl -lgl -lfreetype -lprojectM

#LIBRARIES=../libprojectM
PRODUCTS=MilkdropPresetFactory.lib

include $(BUILD)rules.mk

$(BUILD)rules.mk:
cd .. && git submodule update --init --recursive
10 changes: 10 additions & 0 deletions src/libprojectM/NativePresetFactory/Makefile
@@ -0,0 +1,10 @@
BUILD=../../../build/

SOURCES=NativePresetFactory.cpp
CPPFLAGS+= -I. -I..
PRODUCTS=NativePresetFactory.lib

include $(BUILD)rules.mk

$(BUILD)rules.mk:
cd .. && git submodule update --init --recursive
2 changes: 1 addition & 1 deletion src/libprojectM/PresetLoader.cpp
Expand Up @@ -23,7 +23,7 @@ extern "C"
}
#endif

#ifdef MACOS
#ifdef __APPLE__
extern "C"
{
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libprojectM/Renderer/FBO.hpp
Expand Up @@ -81,7 +81,7 @@ class RenderTarget {

/** Opaque pbuffer context and pbuffer */
/*
#ifdef MACOS
#ifdef __APPLE__
void *origContext;
void *pbufferContext;
void *pbuffer;
Expand Down
40 changes: 40 additions & 0 deletions src/libprojectM/Renderer/Makefile
@@ -0,0 +1,40 @@
BUILD=../../../build/

SOURCES= \
SOIL2/image_DXT.c \
SOIL2/image_helper.c \
SOIL2/SOIL2.c \
SOIL2/etc1_utils.c \
FBO.cpp \
MilkdropWaveform.cpp \
PerPixelMesh.cpp \
Pipeline.cpp \
Renderer.cpp \
ShaderEngine.cpp \
UserTexture.cpp \
Waveform.cpp \
Filters.cpp \
PerlinNoise.cpp \
PipelineContext.cpp \
Renderable.cpp \
BeatDetect.cpp \
Shader.cpp \
TextureManager.cpp \
VideoEcho.cpp \
RenderItemDistanceMetric.cpp \
RenderItemMatcher.cpp \
../KeyHandler.cpp


CONFIG=libftgl libGL libfreetype

CPPFLAGS+= -I. -I.. -ISOIL2
LDFLAGS+=-lftgl -lgl -lfreetype -lprojectM

LIBRARIES=../libprojectM
PRODUCTS=Renderer.lib

include $(BUILD)rules.mk

$(BUILD)rules.mk:
cd .. && git submodule update --init --recursive
4 changes: 2 additions & 2 deletions src/libprojectM/Renderer/TextureManager.cpp
Expand Up @@ -28,7 +28,7 @@
#include <dirent.h>
#endif

#ifdef MACOS
#ifdef __APPLE__
#include <dirent.h>
#endif
#include "TextureManager.hpp"
Expand Down Expand Up @@ -219,7 +219,7 @@ unsigned int TextureManager::getTextureMemorySize()

void TextureManager::loadTextureDir()
{
std::string dirname = CMAKE_INSTALL_PREFIX "/share/projectM/textures";
std::string dirname = "/usr/local/share/projectM/textures";

DIR * m_dir;

Expand Down
2 changes: 1 addition & 1 deletion src/libprojectM/Renderer/VideoEcho.cpp
Expand Up @@ -77,7 +77,7 @@ void VideoEcho::Draw(RenderContext &context)
default: flipx=1;flipy=1; break;
}

float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
double pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
{-0.5*flipx, 0.5*flipy},
{ 0.5*flipx, 0.5*flipy},
{ 0.5*flipx, -0.5*flipy}};
Expand Down
4 changes: 2 additions & 2 deletions src/libprojectM/projectM.hpp
Expand Up @@ -43,7 +43,7 @@
#endif
#include <sys/types.h>

#ifdef MACOS
#ifdef __APPLE__
//#include <MacWindows.h>
//#include <gl.h>
//#include <glu.h>
Expand Down Expand Up @@ -84,7 +84,7 @@ class MasterRenderItemMerge;
#pragma warning (disable:4305)
#endif /** WIN32 */

#ifdef MACOS2
#ifdef __APPLE__2
#define inline
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/projectM-moviegen/projectMmovie.c
Expand Up @@ -229,7 +229,7 @@ fprintf( debugFile, "post SDL_SetVideoMode()\n" );
}
#endif

#ifdef MACOS
#ifdef __APPLE__
globalPM->fontURL = (char *)malloc( sizeof( char ) * 512 );
strcpy( globalPM->fontURL, "../../fonts" );

Expand Down
18 changes: 18 additions & 0 deletions src/projectM-sdl/Makefile
@@ -0,0 +1,18 @@
BUILD=../../build/

SOURCES= \
pmSDL.cpp \
projectM_SDL_main.cpp

CPPFLAGS+=-I. -I../libprojectM
CPPFLAGS_macosx-clang+=-F/Library/Frameworks

LDFLAGS+=-framework OpenGL -F/Library/Frameworks -framework SDL2
LIBRARIES=../libprojectM ../libprojectM/Renderer ../libprojectM/NativePresetFactory ../libprojectM/MilkdropPresetFactory

PRODUCTS=projectMSDL.exe

include $(BUILD)rules.mk

$(BUILD)rules.mk:
cd .. && git submodule update --init --recursive
5 changes: 3 additions & 2 deletions src/projectM-sdl/pmSDL.cpp
Expand Up @@ -69,6 +69,7 @@ int projectMSDL::openAudioInput() {
audioSampleRate = have.freq;
audioSampleCount = have.samples;
audioFormat = have.format;
audioInputDevice = audioDeviceID;

return 1;
}
Expand Down Expand Up @@ -144,8 +145,8 @@ void projectMSDL::addFakePCM() {
}

void projectMSDL::resize(unsigned int width, unsigned int height) {
width = width;
height = height;
this->width = width;
this->height = height;
settings.windowWidth = width;
settings.windowHeight = height;
projectM_resetGL(width, height);
Expand Down
2 changes: 1 addition & 1 deletion src/projectM-sdlvis/projectMvis.cc
Expand Up @@ -256,7 +256,7 @@ fprintf( debugFile, "post SDL_SetVideoMode()\n" );
}
#endif

#ifdef MACOS
#ifdef __APPLE__
globalPM->fontURL = (char *)malloc( sizeof( char ) * 512 );
strcpy( globalPM->fontURL, "../../fonts" );

Expand Down

0 comments on commit 7828b8f

Please sign in to comment.