dynamic header for GLUT include

This commit is contained in:
Stephen Birarda 2013-02-08 12:17:35 -08:00
parent 9ab476d3ee
commit 13a0597ab6
15 changed files with 37 additions and 39 deletions

View file

@ -2,14 +2,20 @@ cmake_minimum_required(VERSION 2.8)
project(interface) project(interface)
file(GLOB INTERFACE_SRCS src/*.cpp src/*.h)
add_executable(interface ${INTERFACE_SRCS})
if (APPLE) if (APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreServices -framework Carbon") set(CMAKE_EXE_LINKER_FLAGS "-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreServices -framework Carbon")
set(GLUT_HEADER_INCLUDE "<GLUT/glut.h>")
else (APPLE)
set(GLUT_HEADER_INCLUDE "<GL/glut.h>")
endif (APPLE) endif (APPLE)
configure_file(InterfaceConfig.h.in ${PROJECT_BINARY_DIR}/includes/InterfaceConfig.h)
file(GLOB INTERFACE_SRCS src/*.cpp src/*.h)
include_directories(${PROJECT_BINARY_DIR}/includes)
add_executable(interface ${INTERFACE_SRCS})
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED) find_package(GLUT REQUIRED)
find_package(GLM REQUIRED) find_package(GLM REQUIRED)

View file

@ -0,0 +1,14 @@
//
// InterfaceConfig.h
// interface
//
// Created by Stephen Birarda on 2/8/13.
// Copyright (c) 2013 High Fidelity, Inc.. All rights reserved.
//
#ifndef interface__InterfaceConfig__
#define interface__InterfaceConfig__
#include @GLUT_HEADER_INCLUDE@
#endif

View file

@ -12,7 +12,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "Util.h" #include "Util.h"
#include "world.h" #include "world.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
#include <iostream> #include <iostream>
class VoxelSystem { class VoxelSystem {

View file

@ -9,11 +9,7 @@
#ifndef __interface__Field__ #ifndef __interface__Field__
#define __interface__Field__ #define __interface__Field__
#ifdef __APPLE__ #include "InterfaceConfig.h"
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <iostream> #include <iostream>
#include "world.h" #include "world.h"
#include "Util.h" #include "Util.h"

View file

@ -12,7 +12,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "Util.h" #include "Util.h"
#include "world.h" #include "world.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
#include <iostream> #include <iostream>

View file

@ -14,7 +14,7 @@
#include "Util.h" #include "Util.h"
#include "Field.h" #include "Field.h"
#include "world.h" #include "world.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
const float RADIUS_RANGE = 10.0; const float RADIUS_RANGE = 10.0;

View file

@ -12,7 +12,7 @@
#include <iostream> #include <iostream>
#include "Field.h" #include "Field.h"
#include "world.h" #include "world.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
#include "SerialInterface.h" #include "SerialInterface.h"
enum eyeContactTargets {LEFT_EYE, RIGHT_EYE, MOUTH}; enum eyeContactTargets {LEFT_EYE, RIGHT_EYE, MOUTH};

View file

@ -12,7 +12,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "Util.h" #include "Util.h"
#include "world.h" #include "world.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
#include <iostream> #include <iostream>
class Lattice { class Lattice {

View file

@ -12,7 +12,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "Util.h" #include "Util.h"
#include "World.h" #include "World.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
#include <iostream> #include <iostream>
class Oscilloscope { class Oscilloscope {

View file

@ -12,7 +12,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "Util.h" #include "Util.h"
#include "world.h" #include "world.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
class ParticleSystem { class ParticleSystem {
public: public:

View file

@ -9,7 +9,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "util.h" #include "util.h"
#include "world.h" #include "world.h"
#include <GLUT/glut.h> #include "InterfaceConfig.h"
#include <iostream> #include <iostream>
// These includes are for serial port reading/writing // These includes are for serial port reading/writing

View file

@ -8,11 +8,7 @@
#include "Texture.h" #include "Texture.h"
#ifdef __APPLE__ #include "InterfaceConfig.h"
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <LodePNG/lodepng.h> #include <LodePNG/lodepng.h>
#include <vector> #include <vector>
#include <cstdio> #include <cstdio>

View file

@ -10,11 +10,7 @@
#define __interface__Texture__ #define __interface__Texture__
#include <iostream> #include <iostream>
#ifdef __APPLE__ #include "InterfaceConfig.h"
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
int load_png_as_texture(char* filename); int load_png_as_texture(char* filename);

View file

@ -6,11 +6,7 @@
// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. // Copyright (c) 2012 High Fidelity, Inc. All rights reserved.
// //
#ifdef __APPLE__ #include "InterfaceConfig.h"
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <iostream> #include <iostream>
#include "world.h" #include "world.h"
#include <glm/glm.hpp> #include <glm/glm.hpp>

View file

@ -16,13 +16,9 @@
//#define MARKER_CAPTURE // yep. //#define MARKER_CAPTURE // yep.
#ifdef __APPLE__ #include "InterfaceConfig.h"
#include <GLUT/glut.h>
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#include <OpenGL/glext.h> #include <OpenGL/glext.h>
#else
#include <GL/glut.h>
#endif
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <math.h> #include <math.h>
@ -38,8 +34,6 @@
#include <termios.h> #include <termios.h>
#include <glm/glm.hpp> #include <glm/glm.hpp>
// Bring in OpenCV
#include "SerialInterface.h" #include "SerialInterface.h"
#include "Field.h" #include "Field.h"
#include "world.h" #include "world.h"