diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fd957d9..8af58ba6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(PolyVox) SET(POLYVOX_VERSION_MAJOR "0") SET(POLYVOX_VERSION_MINOR "2") -SET(POLYVOX_VERSION_PATCH "0") +SET(POLYVOX_VERSION_PATCH "1") SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX_VERSION_PATCH}" CACHE STRING "PolyVox version") MARK_AS_ADVANCED(FORCE POLYVOX_VERSION) @@ -69,7 +69,9 @@ if(CMAKE_CXX_COMPILER MATCHES "clang") ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode endif() -INCLUDE(cmake/Modules/CheckCXX11Features.cmake) +if(NOT MSVC) #This is causing problems in Visual Studio so disable it for now + INCLUDE(cmake/Modules/CheckCXX11Features.cmake) +endif() ADD_SUBDIRECTORY(library) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index f964a8d5..f5cb490c 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -20,12 +20,12 @@ # 3. This notice may not be removed or altered from any source # distribution. -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - 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) +if(NOT MSVC) + #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) +endif() #Projects source files SET(CORE_SRC_FILES diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h index d7cebe0c..325b5ed1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h @@ -1,3 +1,11 @@ +/* + * This file provides the default compiler capabilities for for Visual Studio. + * On other compilers CMake will detect which features are available and create + * a file like this. + * + * To Enable these features in Visual Studio, define the variables in this file. +*/ + #ifndef __PolyVox_CompilerCapabilities_H__ #define __PolyVox_CompilerCapabilities_H__ diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in index 5518dfb2..31f1ba80 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in @@ -1,3 +1,8 @@ +/* + * This file is an input file for the CMake build system. It is processed and + * placed in the build directory by CMake. +*/ + #ifndef __PolyVox_CompilerCapabilities_H__ #define __PolyVox_CompilerCapabilities_H__ diff --git a/library/PolyVoxUtil/CMakeLists.txt b/library/PolyVoxUtil/CMakeLists.txt index a52006c9..7fbdb43e 100644 --- a/library/PolyVoxUtil/CMakeLists.txt +++ b/library/PolyVoxUtil/CMakeLists.txt @@ -20,8 +20,6 @@ # 3. This notice may not be removed or altered from any source # distribution. -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - PROJECT(PolyVoxUtil) #Projects source files diff --git a/library/bindings/CMakeLists.txt b/library/bindings/CMakeLists.txt index d807a118..040d0afe 100644 --- a/library/bindings/CMakeLists.txt +++ b/library/bindings/CMakeLists.txt @@ -48,6 +48,11 @@ if(ENABLE_BINDINGS) set_target_properties(${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTIES OUTPUT_NAME _PolyVoxCore) #set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd") SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCorePython_REAL_NAME} PROPERTY FOLDER "Bindings") + + swig_add_module(PolyVoxCoreCSharp csharp PolyVoxCore.i) + set(SWIG_MODULE_PolyVoxCoreCSharp_EXTRA_FLAGS "-dllimport;PolyVoxCoreCSharp") #This _should_ be inside UseSWIG.cmake - http://www.cmake.org/Bug/view.php?id=13814 + swig_link_libraries(PolyVoxCoreCSharp PolyVoxCore) + SET_PROPERTY(TARGET ${SWIG_MODULE_PolyVoxCoreCSharp_REAL_NAME} PROPERTY FOLDER "Bindings") else() set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE) endif() diff --git a/library/bindings/Raycast.i b/library/bindings/Raycast.i index ed1869ca..8ae2c297 100644 --- a/library/bindings/Raycast.i +++ b/library/bindings/Raycast.i @@ -2,6 +2,8 @@ %{ #include "Raycast.h" +#ifdef SWIGPYTHON + template class PyCallback { @@ -43,11 +45,17 @@ PolyVox::RaycastResult raycastWithEndpointsPython(VolumeType* volData, const Pol return PolyVox::raycastWithEndpoints(volData, v3dStart, v3dEnd, newCallback); } +#endif + %} %include "Raycast.h" +#ifdef SWIGPYTHON + template PolyVox::RaycastResult raycastWithEndpointsPython(VolumeType* volData, const PolyVox::Vector3DFloat& v3dStart, const PolyVox::Vector3DFloat& v3dEnd, PyObject *callback); %template(raycastWithEndpointsSimpleVolumeuint8) raycastWithEndpointsPython, PyCallback > >; + +#endif diff --git a/library/bindings/Vector.i b/library/bindings/Vector.i index 555b7d15..37d0b3ab 100644 --- a/library/bindings/Vector.i +++ b/library/bindings/Vector.i @@ -34,6 +34,13 @@ PROPERTY(PolyVox::Vector, z, getZ, setZ) STR() }; +%feature("pythonprepend") PolyVox::Vector::operator< %{ + import warnings + warnings.warn("deprecated", DeprecationWarning) +%} + +//%csattributes PolyVox::Vector::operator< "[System.Obsolete(\"deprecated\")]" + %define VECTOR3(StorageType,OperationType,ReducedStorageType) %ignore PolyVox::Vector<3,StorageType,OperationType>::Vector(ReducedStorageType,ReducedStorageType,ReducedStorageType,ReducedStorageType); %ignore PolyVox::Vector<3,StorageType,OperationType>::Vector(ReducedStorageType,ReducedStorageType);