diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 602dc415..e2ed1bec 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -40,29 +40,27 @@ SET(QT_USE_QTGUI 1) SET(QT_USE_QTOPENGL 1) INCLUDE(${QT_USE_FILE}) -#IF (WIN32) - FIND_PACKAGE(OpenGL REQUIRED) +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\ - #Also, glut32.dll goes in C:\Windows\System. Using C:\Windows\System32 doesn't seem to work - - #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} "../../library/include") - LINK_DIRECTORIES("../../library") +#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\ +#Also, glut32.dll goes in C:\Windows\System. Using C:\Windows\System32 doesn't seem to work - #Build - ADD_EXECUTABLE(OpenGLExample ${SRC_FILES}) - TARGET_LINK_LIBRARIES(OpenGLExample ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} debug PolyVoxCore_d.lib optimized PolyVoxCore.lib) +#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) +INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} "../../library/include") +LINK_DIRECTORIES("../../library") - #Install - INSTALL(TARGETS OpenGLExample - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - COMPONENT example - ) - - ADD_DEPENDENCIES(OpenGLExample PolyVoxCore) #This shouldn't be needed -#ENDIF (WIN32) \ No newline at end of file +#Build +ADD_EXECUTABLE(OpenGLExample ${SRC_FILES}) +TARGET_LINK_LIBRARIES(OpenGLExample ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} debug PolyVoxCore_d.lib optimized PolyVoxCore.lib) + +#Install +INSTALL(TARGETS OpenGLExample + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + COMPONENT example +) + +ADD_DEPENDENCIES(OpenGLExample PolyVoxCore) #This shouldn't be needed? diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 2596312f..1aa9f50f 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -141,18 +141,4 @@ if(DOXYGEN_FOUND) add_custom_target(doc COMMAND ${DOXYGEN_EXECUTABLE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Building documentation" VERBATIM) endif() -find_package(SWIG) -if(SWIG_FOUND) - include(${SWIG_USE_FILE}) - - find_package(PythonLibs) - include_directories(${PYTHON_INCLUDE_PATH}) - - set(CMAKE_SWIG_FLAGS "") - set_source_files_properties(bindings/PolyVoxCore.i PROPERTIES CPLUSPLUS ON) - - swig_add_module(PolyVoxCore python bindings/PolyVoxCore.i) - swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore) - set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd") - -endif() +add_subdirectory(bindings) diff --git a/library/bindings/CMakeLists.txt b/library/bindings/CMakeLists.txt new file mode 100644 index 00000000..ee50cdaa --- /dev/null +++ b/library/bindings/CMakeLists.txt @@ -0,0 +1,14 @@ +find_package(SWIG) +if(SWIG_FOUND) + include(${SWIG_USE_FILE}) + + find_package(PythonLibs) + include_directories(${PYTHON_INCLUDE_PATH}) + + set(CMAKE_SWIG_FLAGS "") + set_source_files_properties(bindings/PolyVoxCore.i PROPERTIES CPLUSPLUS ON) + + swig_add_module(PolyVoxCore python bindings/PolyVoxCore.i) + swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore) + set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd") +endif() \ No newline at end of file