From a970bdaef675171c3e0f0d97141522b96ff7ab77 Mon Sep 17 00:00:00 2001 From: Evan Bollig Date: Fri, 6 Jan 2012 19:56:25 -0700 Subject: [PATCH] Build fix for OSX 10.6 and Ubuntu 11.10 Added a find_package for OpenGL and the necessary target_link_libraries to get this framework to build on OSX 10.6. Not sure if the "required" find_package will negatively impact linux/windows. Added support for Ubuntu 11.10 (GNU G++ 4.4 compiler). The default gcc-4.5 compiler is not supported by CUDA, so users specify the 4.4 alternative when first running cmake: "CC=gcc-4.4 CXX=g++-4.4 cmake". The change of compiler is applied by the set(CUDA_NVCC_FLAGS ...). --- CMakeLists.txt | 7 ++++++- src/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23cfdde..5aed845 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0) # CUDA might not be part of CMake 2.6, either install 2.8 or install the CUDA modules yourself. FIND_PACKAGE(Qt4 REQUIRED) FIND_PACKAGE(CUDA REQUIRED) +FIND_PACKAGE(OpenGL REQUIRED) + +# Necessary on Ubuntu 11.10 if we specify the compiler with +# "CXX=g++-4.4 CC=gcc-4.4 cmake" +SET(CUDA_NVCC_FLAGS "-ccbin;${CMAKE_CXX_COMPILER}") install(FILES README.md LICENSE DESTINATION share/doc/${CMAKE_PROJECT_NAME}/) # This is where the source code is. SUBDIRS(src) - \ No newline at end of file + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f1c188..fc7aeef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,6 +49,6 @@ ELSEIF(WIN32) CUDA_ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} WIN32 ${cuda_qt_framework_CUDA_SRCS} ${cuda_qt_framework_SRCS_CXX}) ENDIF() -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${QT_LIBRARIES} ${OPENGL_LIBRARIES}) INSTALL(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION bin)