From 7d76a1bb69cbb84c0f2700ef081bd0c2fa14015a Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 28 Apr 2011 11:56:33 +0100 Subject: [PATCH] CMake fixes for Windows. --- CMakeLists.txt | 11 ----------- examples/Basic/CMakeLists.txt | 3 +-- examples/OpenGL/CMakeLists.txt | 3 +-- examples/Paging/CMakeLists.txt | 3 +-- library/PolyVoxCore/CMakeLists.txt | 3 ++- library/PolyVoxUtil/CMakeLists.txt | 3 ++- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6332d089..8e151200 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,17 +13,6 @@ FIND_PACKAGE(Doxygen) FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtTest) INCLUDE(${QT_USE_FILE}) -IF(WIN32) - #These are used on Windows to ensure that the .exe's and .dll get placed in the ame directory, so that we can run them. - #Note they are actually deprecated in favour of 'RUNTIME_OUTPUT_DIRECTORY' et al, but these replacements apparently don't - #work on Windows. See http://www.vtk.org/Bug/bug_view_advanced_page.php?bug_id=8366 - SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) - SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) - #These are what _should_ be set. If we require 2.8 then test it with these. - #SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - #SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -ENDIF(WIN32) - if(MSVC AND (MSVC_VERSION LESS 1600)) # Require boost for older (pre-vc2010) Visual Studio compilers # See library/include/polyvoximpl/TypeDef.h diff --git a/examples/Basic/CMakeLists.txt b/examples/Basic/CMakeLists.txt index fe9cf7c0..00ff4208 100644 --- a/examples/Basic/CMakeLists.txt +++ b/examples/Basic/CMakeLists.txt @@ -30,8 +30,7 @@ FIND_PACKAGE(OpenGL REQUIRED) #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) -#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}) #Build ADD_EXECUTABLE(BasicExample ${SRC_FILES}) diff --git a/examples/OpenGL/CMakeLists.txt b/examples/OpenGL/CMakeLists.txt index 570412c0..cde356bd 100644 --- a/examples/OpenGL/CMakeLists.txt +++ b/examples/OpenGL/CMakeLists.txt @@ -36,8 +36,7 @@ FIND_PACKAGE(OpenGL REQUIRED) #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) -#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}) #Build ADD_EXECUTABLE(OpenGLExample ${SRC_FILES}) diff --git a/examples/Paging/CMakeLists.txt b/examples/Paging/CMakeLists.txt index 2ddf3e03..5ea2957f 100644 --- a/examples/Paging/CMakeLists.txt +++ b/examples/Paging/CMakeLists.txt @@ -32,8 +32,7 @@ FIND_PACKAGE(OpenGL REQUIRED) #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) -#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}) #Build ADD_EXECUTABLE(PagingExample ${SRC_FILES}) diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 26e8cf6a..8d76ccf3 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -137,7 +137,8 @@ IF(WIN32) #On windows, we also install the debug information. It's unfortunate that we have to hard-code #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../Debug/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS Debug) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS Debug) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS RelWithDebInfo) ELSE(WIN32) IF(BUILD_STATIC_LIBRARIES) INSTALL(TARGETS PolyVoxCoreStatic diff --git a/library/PolyVoxUtil/CMakeLists.txt b/library/PolyVoxUtil/CMakeLists.txt index c56d15e4..761a0ef7 100644 --- a/library/PolyVoxUtil/CMakeLists.txt +++ b/library/PolyVoxUtil/CMakeLists.txt @@ -74,7 +74,8 @@ IF(WIN32) #On windows, we also install the debug information. It's unfortunate that we have to hard-code #the 'Debug' part of the path, but CMake doesn't seem to provide a way around this. The best I #found was: http://www.cmake.org/pipermail/cmake/2007-October/016924.html (and it is a bit ugly). - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../Debug/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS Debug) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS Debug) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS RelWithDebInfo) ELSE(WIN32) IF(BUILD_STATIC_LIBRARIES) INSTALL(TARGETS PolyVoxUtilStatic