Add a CompilerCapabilities.h.in file which is filled in by CMake

It will #define a each of the basic features detected by CMake which can
then be used by other headers (like TypeDef.h) to set things up for
PolyVox.

It is this file which you will have to manually edit and rename if you want
to skip using CMake.
This commit is contained in:
Matt Williams 2012-11-23 11:45:13 +00:00
parent 596bf12877
commit 3902e00a0f
10 changed files with 19 additions and 8 deletions

View File

@ -50,7 +50,7 @@ SOURCE_GROUP("Headers" FILES ${INC_FILES})
FIND_PACKAGE(OpenGL REQUIRED) FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include)
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
#Build #Build

View File

@ -56,7 +56,7 @@ SOURCE_GROUP("Headers" FILES ${INC_FILES})
FIND_PACKAGE(OpenGL REQUIRED) FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include)
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
#Build #Build

View File

@ -52,7 +52,7 @@ SOURCE_GROUP("Headers" FILES ${INC_FILES})
FIND_PACKAGE(OpenGL REQUIRED) FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include)
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
#Build #Build

View File

@ -50,7 +50,7 @@ SOURCE_GROUP("Headers" FILES ${INC_FILES})
FIND_PACKAGE(OpenGL REQUIRED) FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include)
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
#Build #Build

View File

@ -24,6 +24,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(PolyVoxCore) PROJECT(PolyVoxCore)
#Set up the C++11 feature header file based on the CheckCXX11Features script
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/include/PolyVoxCore/Impl/CompilerCapabilities.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/PolyVoxCore/Impl/CompilerCapabilities.h)
#Projects source files #Projects source files
SET(CORE_SRC_FILES SET(CORE_SRC_FILES
source/ArraySizes.cpp source/ArraySizes.cpp
@ -128,7 +131,7 @@ SOURCE_GROUP("Sources\\Impl" FILES ${IMPL_SRC_FILES})
SOURCE_GROUP("Headers\\Impl" FILES ${IMPL_INC_FILES}) SOURCE_GROUP("Headers\\Impl" FILES ${IMPL_INC_FILES})
#Tell CMake the paths #Tell CMake the paths
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include)
#Core #Core
#Build #Build

View File

@ -0,0 +1,6 @@
#ifndef __PolyVox_CompilerCapabilities_H__
#define __PolyVox_CompilerCapabilities_H__
#cmakedefine HAS_CXX11_CONSTEXPR
#endif

View File

@ -24,6 +24,8 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_TypeDef_H__ #ifndef __PolyVox_TypeDef_H__
#define __PolyVox_TypeDef_H__ #define __PolyVox_TypeDef_H__
#include "PolyVoxCore/Impl/CompilerCapabilities.h"
//Definitions needed to make library functions accessable //Definitions needed to make library functions accessable
// See http://gcc.gnu.org/wiki/Visibility for more info. // See http://gcc.gnu.org/wiki/Visibility for more info.
#if defined _WIN32 || defined __CYGWIN__ #if defined _WIN32 || defined __CYGWIN__

View File

@ -45,7 +45,7 @@ SOURCE_GROUP("Sources" FILES ${UTIL_SRC_FILES})
SOURCE_GROUP("Headers" FILES ${UTIL_INC_FILES}) SOURCE_GROUP("Headers" FILES ${UTIL_INC_FILES})
#Tell CMake the paths #Tell CMake the paths
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_BINARY_DIR}/include)
#There has to be a better way! #There has to be a better way!
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/debug ${PolyVoxCore_BINARY_DIR}/release ${PolyVoxCore_BINARY_DIR}) LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/debug ${PolyVoxCore_BINARY_DIR}/release ${PolyVoxCore_BINARY_DIR})

View File

@ -36,7 +36,7 @@ if(ENABLE_BINDINGS)
include(${SWIG_USE_FILE}) include(${SWIG_USE_FILE})
include_directories(${PYTHON_INCLUDE_PATH}) include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore) include_directories(${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore ${PolyVoxCore_BINARY_DIR}/include)
link_directories(${PolyVoxCore_BINARY_DIR}) link_directories(${PolyVoxCore_BINARY_DIR})
set(CMAKE_SWIG_FLAGS "") set(CMAKE_SWIG_FLAGS "")

View File

@ -39,7 +39,7 @@ MACRO(CREATE_TEST headerfile sourcefile executablename)
SET_PROPERTY(TARGET ${executablename} PROPERTY FOLDER "Tests") SET_PROPERTY(TARGET ${executablename} PROPERTY FOLDER "Tests")
ENDMACRO(CREATE_TEST) ENDMACRO(CREATE_TEST)
INCLUDE_DIRECTORIES(${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES(${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${PolyVoxCore_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR})
REMOVE_DEFINITIONS(-DQT_GUI_LIB) #Make sure the tests don't link to the QtGui REMOVE_DEFINITIONS(-DQT_GUI_LIB) #Make sure the tests don't link to the QtGui
# Test Template. Copy and paste this template for consistant naming. # Test Template. Copy and paste this template for consistant naming.