Commits

Jacob Moen committed a26d4c3

Linux fixes

Comments (0)

Files changed (12)

 	add_definitions(-DBOOST_ALL_NO_LIB)
 	set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Boost_LIBRARIES})
 endif()
+
+if(UNIX)
+	find_package(OpenGL)
+	set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OPENGL_LIBRARY})
+
+set(TWOGRE_SOURCE
+	src/LoadOGL.cpp
+	src/TwBar.cpp
+	src/TwColors.cpp
+	src/TwFonts.cpp
+	src/TwMgr.cpp
+	src/TwOgreBoolVariable.cpp
+	src/TwOgreButtonVariable.cpp
+	src/TwOgreColorVariable.cpp
+	src/TwOgreDirection3DVariable.cpp
+	src/TwOgrePosition3DVariable.cpp
+	src/TwOgreQuaternionVariable.cpp
+	src/TwOgreEnumVariable.cpp
+	src/TwOgreIntegerVariable.cpp
+	src/TwOgreRealVariable.cpp
+	src/TwOgreSeparatorVariable.cpp
+	src/TwOgreStringVariable.cpp
+	src/TwOgreVariable.cpp
+	src/TwOgreWindow.cpp
+	src/TwOgreWindowManager.cpp
+	src/TwOpenGL.cpp
+	src/TwPrecomp.cpp
+)
+
+set(TWOGRE_HEADERS
+	include/AntPerfTimer.h
+	include/AntTweakBar.h
+	include/LoadOGL.h
+	include/TwBar.h
+	include/TwColors.h
+	include/TwFonts.h
+	include/TwGraph.h
+	include/TwMgr.h
+	include/TwOgre.h
+	include/TwOgreBoolVariable.h
+	include/TwOgreButtonVariable.h
+	include/TwOgreColorVariable.h
+	include/TwOgreDirection3DVariable.h
+	include/TwOgrePosition3DVariable.h
+	include/TwOgreQuaternionVariable.h
+	include/TwOgreEnumVariable.h
+	include/TwOgreIntegerVariable.h
+	include/TwOgrePrerequisites.h
+	include/TwOgreRealVariable.h
+	include/TwOgreSeparatorVariable.h
+	include/TwOgreStringVariable.h
+	include/TwOgreVariable.h
+	include/TwOgreWindow.h
+	include/TwOgreWindowManager.h
+	include/TwOpenGL.h
+	include/TwPrecomp.h
+	include/resource.h
+)
+
+endif(UNIX)
  
+
+
+if(WIN32)
 set(TWOGRE_SOURCE
 	src/LoadOGL.cpp
 	src/TwBar.cpp
 	src/TwOpenGL.cpp
 	src/TwPrecomp.cpp
 )
+endif(WIN32)
 
 include_directories( "include"
 	${OIS_INCLUDE_DIRS}
 	${OGRE_INCLUDE_DIRS}
 	${OGRE_SAMPLES_INCLUDEPATH}
-	${TWOGRE_HEADERS}
 )
 
+if(UNIX)
+	include_directories(include/GL ${X11_INCLUDE_DIR})
+endif(UNIX)
+
 add_library(twogre STATIC ${TWOGRE_SOURCE} ${TWOGRE_HEADERS})
 set_target_properties(twogre PROPERTIES DEBUG_POSTFIX _d)
 
+if(UNIX)
+	set_target_properties(twogre PROPERTIES
+	    COMPILE_DEFINITIONS "_UNIX")
+endif(UNIX)
+
 set(LIBRARY_OUTPUT_PATH  lib)
 target_link_libraries(twogre ${OGRE_LIBRARIES})
 

demo/Example_WorldEditor/CMakeLists.txt

 	set(EXECUTABLE_OUTPUT_PATH ${TWOGRE_BIN_DIR}/demo/bin)
 endif(MINGW OR UNIX)
 
-# if win32, copy the Ogre DLLs and the media over
+install(TARGETS Example_WorldEditor
+	RUNTIME DESTINATION ${TWOGRE_BIN_DIR}/demo/bin
+	CONFIGURATIONS All)
+
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/demo/Media
+	DESTINATION ${TWOGRE_BIN_DIR}/demo
+	CONFIGURATIONS Release RelWithDebInfo Debug
+)
+
+if(UNIX)
+	install(FILES /usr/local/share/OGRE/plugins.cfg
+		${CMAKE_SOURCE_DIR}/demo/bin/resources.cfg
+		DESTINATION ${TWOGRE_BIN_DIR}/demo/bin
+		CONFIGURATIONS Release RelWithDebInfo
+	)
+
+	install(FILES /usr/local/share/OGRE/plugins_d.cfg
+		${CMAKE_SOURCE_DIR}/demo/bin/resources_d.cfg
+		DESTINATION ${TWOGRE_BIN_DIR}/demo/bin
+		CONFIGURATIONS Debug
+	)
+endif(UNIX)
+
 if(WIN32)
-	install(TARGETS Example_WorldEditor
-		RUNTIME DESTINATION ${TWOGRE_BIN_DIR}/demo/bin
-		CONFIGURATIONS All)
- 
-	install(DIRECTORY ${CMAKE_SOURCE_DIR}/demo/Media
-		DESTINATION ${TWOGRE_BIN_DIR}/demo
-		CONFIGURATIONS Release RelWithDebInfo Debug
-	)
- 
 	install(FILES ${CMAKE_SOURCE_DIR}/demo/bin/plugins.cfg
 		${CMAKE_SOURCE_DIR}/demo/bin/resources.cfg
 		DESTINATION ${TWOGRE_BIN_DIR}/demo/bin

include/TwPrecomp.h

 #   include <GL/glx.h>
 #   include <X11/Xatom.h>
 #   include <unistd.h>
+#   include <string.h>
+#   include <cstdlib>
 #   undef _WIN32
 #   undef WIN32
 #   undef _WIN64
 
 
 #endif  // !defined ANT_TW_PRECOMP_INCLUDED
+

src/TwOgreBoolVariable.cpp

 #include <sstream>
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 namespace TwOgre{
 	BoolVariable::BoolVariable(Window *parent, const Ogre::String& name, bool readOnly, const Ogre::String& label, 
 
 		TwDefine(ss.str().c_str());
 	}
-}; // End Namespace
+}; // End Namespace

src/TwOgreColorVariable.cpp

 #include "TwOgreColorVariable.h"
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 namespace TwOgre{
 	ColorVariable::ColorVariable(Window *parent, const Ogre::String& name, bool readOnly, const Ogre::String& label, 
 		mTweakColor[2] = mColor.b;
 		mTweakColor[3] = mColor.a;
 	}
-}; // End Namespace
+}; // End Namespace

src/TwOgreDirection3DVariable.cpp

 #include "TwOgreDirection3DVariable.h"
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 namespace TwOgre{
 	Direction3DVariable::Direction3DVariable(Window *parent, const Ogre::String& name, bool readOnly, const Ogre::String& label, 

src/TwOgreEnumVariable.cpp

 #include <sstream>
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 namespace TwOgre{
 	EnumVariable::EnumVariable(Window *parent, const Ogre::String& name, bool readOnly, const Ogre::String& label, 
 
 		TwDefine(ss.str().c_str());
 	}
-}; // End Namespace
+}; // End Namespace

src/TwOgreIntegerVariable.cpp

 #include <sstream>
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 namespace TwOgre{
 	IntegerVariable::IntegerVariable(Window *parent, const Ogre::String& name, bool readOnly, const Ogre::String& label, 
 
 		TwDefine(ss.str().c_str());
 	}
-}; // End Namespace
+}; // End Namespace

src/TwOgrePosition3DVariable.cpp

 #include <sstream>
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 namespace TwOgre{
     

src/TwOgreQuaternionVariable.cpp

 #include "TwOgreQuaternionVariable.h"
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 #include "OgreStringConverter.h"
 
 namespace TwOgre{
 		mTweakQuaternion[2] = mQuaternion.z;
 		mTweakQuaternion[3] = mQuaternion.w;
 	}
-}; // End Namespace
+}; // End Namespace

src/TwOgreRealVariable.cpp

 #include <sstream>
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 namespace TwOgre{
 	RealVariable::RealVariable(Window *parent, const Ogre::String& name, bool readOnly, const Ogre::String& label, 
 
 		TwDefine(ss.str().c_str());
 	}
-}; // End Namespace
+}; // End Namespace

src/TwOgreStringVariable.cpp

 #include <sstream>
 
 #include "TwOgreWindow.h"
-#include "twOgreWindowManager.h"
+#include "TwOgreWindowManager.h"
 
 // This callbacks are needed to allow AntTweakBar to copy strings into our variable.
 void TW_CALL CopyStdStringToClient(std::string& destinationClientString, const std::string& sourceLibraryString)
 	{
 		mValue = value;
 	}
-}; // End Namespace
+}; // End Namespace
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.