Sfoglia il codice sorgente

Closer, but not there yet.

Cameron Hart 14 anni fa
parent
commit
11738ef5a9

+ 1 - 0
BUILD.txt

@@ -11,6 +11,7 @@ http://download.sourceforge.net/libpng/libpng-1.5.4.tar.gz
 http://cdnetworks-us-1.dl.sourceforge.net/project/libpng/libpng15/1.5.2/lpng152.zip
 
 Freetype2
+http://download.savannah.gnu.org/releases/freetype/freetype-2.4.5.tar.gz
 http://surfnet.dl.sourceforge.net/project/freetype/freetype2/2.4.5/ft245.zip
 
 PhysFS

+ 7 - 5
Bindings/Contents/CMakeLists.txt

@@ -1,3 +1,10 @@
+INCLUDE(PolycodeIncludes)
+
+INCLUDE_DIRECTORIES(
+    ${LUA_INCLUDE_DIR}
+    LUA/Include
+)
+
 SET(polycodeLua_SRCS
     LUA/Source/PolycodeLUA.cpp
 )
@@ -8,11 +15,6 @@ SET(polycodeLua_HDRS
     LUA/Include/PolycodeLUA2D.h
 )
 
-INCLUDE_DIRECTORIES(
-    ${LUA_INCLUDE_DIR}
-    LUA/Include
-)
-
 IF(POLYCODE_BUILD_SHARED)
     ADD_LIBRARY(PolycodeLua SHARED ${polycodeLua_SRCS} ${polycodeLua_HDRS})
     TARGET_LINK_LIBRARIES(PolycodeLua PolyCore ${LUA_LIBRARY})

+ 3 - 2
Build/CMakeModules/ExternalFreetype.cmake

@@ -8,6 +8,7 @@ SET(freetype_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/Dependencies/freetype)
 IF(MSVC10)
 	# BUILD_COMMAND would be better but it returns a single string which is escaped when it shouldn't be
 	SET(freetype_BUILD msbuild.exe builds/win32/vc2010/freetype.sln /p:Configuration=Release)
+    SET(freetype_LIB ${freetype_PREFIX}/src/freetype/objs/win32/vc2010/freetype245.lib)
 ENDIF(MSVC10)
 
 ExternalProject_Add(freetype
@@ -21,6 +22,6 @@ ExternalProject_Add(freetype
 )
 
 # tell CMake to use this version
-SET(FREETYPE_INCLUDE_DIR)
-SET(FREETYPE_LIBRARY)
+SET(FREETYPE_INCLUDE_DIR ${freetype_PREFIX}/src/freetype/include)
+
 

+ 3 - 3
Build/CMakeModules/ExternalOpenAL.cmake

@@ -12,6 +12,6 @@ ExternalProject_Add(openal
 )
 
 # tell CMake to use this version
-SET(OPENAL_INCLUDE_DIR)
-SET(OPENAL_LIBRARY)
-SET(OPENAL_FOUND)
+SET(OPENAL_INCLUDE_DIR ${openal_PREFIX}/include)
+SET(OPENAL_LIBRARY ${openal_PREFIX}/lib/OpenAL32${CMAKE_LINK_LIBRARY_SUFFIX})
+

+ 2 - 6
Build/CMakeModules/ExternalPNG.cmake

@@ -22,11 +22,7 @@ EXTERNALPROJECT_ADD(libpng
 )
 
 # tell CMake to use this version
-#  PNG_INCLUDE_DIR, where to find png.h, etc.
-#  PNG_LIBRARIES, the libraries to link against to use PNG.
-#  PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
-#  PNG_FOUND, If false, do not try to use PNG.
-
 SET(PNG_INCLUDE_DIR ${png_PREFIX}/include)
-SET(PNG_LIBRARIES ${png_PREFIX}/lib)
+SET(PNG_LIBRARY ${png_PREFIX}/lib/libpng15.${CMAKE_LINK_LIBRARY_SUFFIX})
+
 

+ 2 - 3
Build/CMakeModules/ExternalPhysFS.cmake

@@ -11,6 +11,5 @@ ExternalProject_Add(physfs
 )
 
 # tell CMake to use this version
-SET(PHYSFS_INCLUDE_DIR)
-SET(PHYSFS_LIBRARY)
-SET(PHYSFS_FOUND)
+SET(PHYSFS_INCLUDE_DIR ${physfs_PREFIX}/include)
+SET(PHYSFS_LIBRARY physfs ${physfs_PREFIX}/lib/physfs${CMAKE_LINK_LIBRARY_SUFFIX})

+ 3 - 6
Build/CMakeModules/ExternalVorbisFile.cmake

@@ -26,6 +26,7 @@ EXTERNALPROJECT_ADD(ogg
 # Set the build target for the appropriate build
 IF(MSVC10)
 	SET(vorbis_BUILD msbuild.exe win32/VS2010/vorbis_dynamic.sln /p:Configuration=Release)
+    SET(VORBISFILE_LIBRARY src/vorbis/win32/VS2010/Win32/Release/libvorbisfile.lib)
 ENDIF(MSVC10)
 
 EXTERNALPROJECT_ADD(vorbis
@@ -41,11 +42,7 @@ EXTERNALPROJECT_ADD(vorbis
 )
 
 # tell CMake to use this version
-#  PNG_INCLUDE_DIR, where to find png.h, etc.
-#  PNG_LIBRARIES, the libraries to link against to use PNG.
-#  PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
-#  PNG_FOUND, If false, do not try to use PNG.
+SET(OGG_INCLUDE_DIR ${vorbis_PREFIX}/src/ogg/include)
+SET(VORBISFILE_INCLUDE_DIR ${vorbis_PREFIX}/src/vorbis/include)
 
-SET(VORBISFILE_INCLUDE_DIR ${vorbis_PREFIX}/include)
-SET(VORBISFILE_LIBRARY ${vorbis_PREFIX}/lib)
 

+ 23 - 0
Build/CMakeModules/PolycodeIncludes.cmake

@@ -0,0 +1,23 @@
+# platform specific defines and include directories for win and sdl
+IF(MSVC)
+    ADD_DEFINITIONS(/D_UNICODE /DUNICODE)
+    INCLUDE_DIRECTORIES(${PolyCode_SOURCE_DIR}/Core/Build/MSVC/Polycore)
+ELSEIF(APPLE)
+    ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
+ELSE(MSVC)
+    ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
+    INCLUDE_DIRECTORIES(${PolyCode_SOURCE_DIR}/Core/Build/Linux)
+ENDIF(MSVC)
+
+# Set up common include directories
+INCLUDE_DIRECTORIES(
+    ${PolyCode_SOURCE_DIR}/Core/Contents/Include
+    ${OPENGL_INCLUDE_DIR}
+    ${OPENAL_INCLUDE_DIR}
+    ${FREETYPE_INCLUDE_DIR}
+    ${PHYSFS_INCLUDE_DIR}
+    ${OGG_INCLUDE_DIR}
+    ${VORBISFILE_INCLUDE_DIR}
+    ${PNG_INCLUDE_DIR}
+    ${OPENGLEXT_INCLUDE_DIR}
+)

+ 8 - 18
Core/CMakeLists.txt

@@ -35,25 +35,15 @@ IF(UNIX AND NOT APPLE)
     FIND_PACKAGE(SDL REQUIRED)
 ENDIF(UNIX AND NOT APPLE)
 
-FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile)
-
-# platform specific defines and include directories for win and sdl
+# Get missing GL headers for Windows
 IF(MSVC)
-    ADD_DEFINITIONS(/D_UNICODE /DUNICODE)
-    INCLUDE_DIRECTORIES(${PolyCode_SOURCE_DIR}/Core/Build/MSVC/Polycore)
-ELSEIF(APPLE)
-    ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
-ELSE(MSVC)
-    ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
-    INCLUDE_DIRECTORIES(${PolyCode_SOURCE_DIR}/Core/Build/Linux)
+    FILE(DOWNLOAD 
+        http://www.opengl.org/registry/api/glext.h 
+        ${CMAKE_CURRENT_BINARY_DIR}/Dependencies/opengl/include/GL/glext.h)
+    FILE(DOWNLOAD 
+        http://www.opengl.org/registry/api/wglext.h
+        ${CMAKE_CURRENT_BINARY_DIR}/Dependencies/opengl/include/GL/wglext.h)
+    SET(OPENGLEXT_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Dependencies/opengl/include)
 ENDIF(MSVC)
 
-# Set up common include directories
-INCLUDE_DIRECTORIES(
-    ${PolyCode_SOURCE_DIR}/Core/Contents/Include
-    ${OPENGL_INCLUDE_DIR}
-    ${OPENAL_INCLUDE_DIR}
-    ${FREETYPE_INCLUDE_DIRS}
-)
-
 ADD_SUBDIRECTORY(Contents)

+ 8 - 3
Core/Contents/CMakeLists.txt

@@ -1,3 +1,6 @@
+
+INCLUDE(PolycodeIncludes)
+
 SET(polycore_SRCS
     Source/OSBasics.cpp
     Source/PolyBezierCurve.cpp
@@ -201,9 +204,7 @@ ELSE(MSVC)
 ENDIF(MSVC)
 
 IF(POLYCODE_BUILD_SHARED)
-    ADD_LIBRARY(PolyCore SHARED ${polycore_SRCS} ${polycore_HDRS})
-    TARGET_LINK_LIBRARIES(
-        PolyCore
+    LINK_LIBRARIES(
         ${OPENGL_LIBRARIES}
         ${OPENAL_LIBRARY}
         ${PNG_LIBRARIES}
@@ -212,6 +213,10 @@ IF(POLYCODE_BUILD_SHARED)
         ${VORBISFILE_LIBRARY}
         ${SDL_LIBRARY}
     )
+    ADD_LIBRARY(PolyCore SHARED ${polycore_SRCS} ${polycore_HDRS})
+    TARGET_LINK_LIBRARIES(
+        PolyCore
+    )
 ENDIF(POLYCODE_BUILD_SHARED)
 
 IF(POLYCODE_BUILD_STATIC)