diff --git a/CMakeLists.txt b/CMakeLists.txt index c8a24dbc..30ca06f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,4 @@ PROJECT(PolyVox) #ADD_SUBDIRECTORY(PolyVoxCore) #ADD_SUBDIRECTORY(PolyVoxUtil) ADD_SUBDIRECTORY(library) -ADD_SUBDIRECTORY(examples/OpenGL) - -ADD_DEPENDENCIES(OpenGLExample PolyVoxCore) \ No newline at end of file +ADD_SUBDIRECTORY(examples/OpenGL) \ No newline at end of file diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 0f243852..d47300ec 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -16,9 +16,9 @@ SET(CMAKE_DEBUG_POSTFIX "_d") SOURCE_GROUP("Sources" FILES ${SRC_FILES}) #SOURCE_GROUP("Headers" FILES ${INC_FILES}) -FIND_PACKAGE(OpenGL REQUIRED) - IF (WIN32) + FIND_PACKAGE(OpenGL REQUIRED) + #NOTE: In Windows I haven't had much luck getting the FindGLUT script to work correctly. #The easiest solution has been to install GLUT alongside OpenGL, which is already in the system path. #This means glut.h and glut32.lib go in the 'include' and 'lib' folders within Microsoft Visual Studio 8\VC\PlatformSDK\ @@ -32,11 +32,13 @@ IF (WIN32) #Build ADD_EXECUTABLE(OpenGLExample ${SRC_FILES}) TARGET_LINK_LIBRARIES(OpenGLExample glut32.lib ${OPENGL_gl_LIBRARY} debug PolyVoxCore_d.lib optimized PolyVoxCore.lib) -ENDIF (WIN32) -#Install -INSTALL(TARGETS OpenGLExample - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) \ No newline at end of file + #Install + INSTALL(TARGETS OpenGLExample + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + + ADD_DEPENDENCIES(OpenGLExample PolyVoxCore) +ENDIF (WIN32) \ No newline at end of file diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index a4e937a8..f74b376f 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -124,3 +124,13 @@ INSTALL(TARGETS PolyVoxUtil ) INSTALL(FILES ${UTIL_INC_FILES} DESTINATION include/PolyVoxUtil) + +#Set up OGREConfig.cmake +if(WIN32) + set(CONFIG_FILE_DIR "CMake") +else(WIN32) + set(CONFIG_FILE_DIR "lib/PolyVox/CMake") +endif(WIN32) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PolyVoxConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake DESTINATION ${CONFIG_FILE_DIR}) diff --git a/library/PolyVoxConfig.cmake.in b/library/PolyVoxConfig.cmake.in new file mode 100644 index 00000000..7b47786c --- /dev/null +++ b/library/PolyVoxConfig.cmake.in @@ -0,0 +1,23 @@ +# Find PolyVox includes and library +# +# This module defines +# PolyVox_INCLUDE_DIRS +# PolyVox_LIBRARIES, the libraries to link against to use OGRE. +# PolyVox_LIBRARY_DIRS, the location of the libraries +# PolyVox_FOUND, If false, do not try to use OGRE +# +# Copyright © 2008, Matt Williams +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(FindPackageMessage) + +set(PREFIX "@CMAKE_INSTALL_PREFIX@") +set(PolyVox_LIBRARY_DIRS "${PREFIX}/lib") +set(PolyVox_INCLUDE_DIRS "${PREFIX}/include/PolyVoxCore" "${PREFIX}/include/PolyVoxUtil") +set(PolyVox_LIBRARIES "PolyVoxUtil" "PolyVoxCore") + +message(STATUS "Found PolyVox") +message(STATUS " libraries : '${PolyVox_LIBRARIES}' from ${PolyVox_LIBRARY_DIRS}") +message(STATUS " includes : ${PolyVox_INCLUDE_DIRS}") diff --git a/library/include/PolyVoxCore/BlockVolumeIterator.inl b/library/include/PolyVoxCore/BlockVolumeIterator.inl index bc117e15..b1c6d04b 100644 --- a/library/include/PolyVoxCore/BlockVolumeIterator.inl +++ b/library/include/PolyVoxCore/BlockVolumeIterator.inl @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "Block.h" #include "BlockVolume.h" #include "Vector.h" +#include "Region.h" #pragma endregion namespace PolyVox diff --git a/library/include/PolyVoxCore/Utility.h b/library/include/PolyVoxCore/Utility.h index a2c5b655..49996368 100644 --- a/library/include/PolyVoxCore/Utility.h +++ b/library/include/PolyVoxCore/Utility.h @@ -26,6 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxForwardDeclarations.h" +#include + namespace PolyVox { POLYVOX_API uint8 logBase2(uint32 uInput); diff --git a/library/include/PolyVoxCore/Vector.inl b/library/include/PolyVoxCore/Vector.inl index e21dfd2e..376582bd 100644 --- a/library/include/PolyVoxCore/Vector.inl +++ b/library/include/PolyVoxCore/Vector.inl @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include +#include namespace PolyVox {