diff --git a/cmake/modules/FindGLUT.cmake b/cmake/modules/FindGLUT.cmake index c952a3df11..29ed46cb34 100644 --- a/cmake/modules/FindGLUT.cmake +++ b/cmake/modules/FindGLUT.cmake @@ -4,14 +4,14 @@ # GLUT_FOUND # GLUT_INCLUDE_DIR # GLUT_LIBRARIES -# GLUT_DLL_PATH - Optionally defined for Win32 +# GLUT_DLL_PATH - Optionally defined for Win32, if not in path # # Created on 2/6/2014 by Stephen Birarda # # Adapted from FindGLUT.cmake available in tlorach's OpenGLText Repository # https://raw.github.com/tlorach/OpenGLText/master/cmake/FindGLUT.cmake -if (GLUT_INCLUDE_DIR AND GLUT_LIBRARIES AND (NOT WIN32 OR GLUT_DLL_PATH)) +if (GLUT_INCLUDE_DIR AND GLUT_LIBRARIES) set(GLUT_FOUND TRUE) else () if (WIN32) @@ -23,7 +23,6 @@ else () endif() find_library(GLUT_glut_LIBRARY freeglut PATH_SUFFIXES lib/${WIN_ARCH_DIR} HINTS ${WIN_GLUT_SEARCH_DIRS}) - find_path(GLUT_DLL_PATH freeglut.dll PATH_SUFFIXES bin/${WIN_ARCH_DIR} HINTS ${WIN_GLUT_SEARCH_DIRS}) else () find_path(GLUT_INCLUDE_DIR GL/glut.h "${GLUT_LOCATION}/include" @@ -71,12 +70,7 @@ else () endif () include(FindPackageHandleStandardArgs) - - if (WIN32) - find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIR GLUT_LIBRARIES GLUT_DLL_PATH) - else () - find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIR GLUT_LIBRARIES) - endif() + find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIR GLUT_LIBRARIES) if (GLUT_FOUND) if (NOT GLUT_FIND_QUIETLY) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 40fc59030f..e94bcfe7e4 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -228,15 +228,8 @@ else (APPLE) # link target to external libraries if (WIN32) - find_package(GLEW REQUIRED) - include_directories(${GLEW_INCLUDE_DIRS}) - target_link_libraries(${TARGET_NAME} "${GLEW_LIBRARY}" wsock32.lib opengl32.lib) - - # have CMake copy the dlls for GLUT and GLEW as a post build step - add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${GLUT_DLL_PATH}/freeglut.dll - $ - ) + find_package(GLEW REQUIRED) + include_directories(${GLEW_INCLUDE_DIRS}) + target_link_libraries(${TARGET_NAME} "${GLEW_LIBRARY}" wsock32.lib opengl32.lib) endif() endif (APPLE)