project(VolumeRender)
cmake_minimum_required(VERSION 2.8)
find_package(CUDA)
find_package(GLUT)
find_package(OpenGL)
IF (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
DOC "The directory where GL/glew.h resides")
FIND_LIBRARY( GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library")
ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where GL/glew.h resides")
FIND_LIBRARY( GLEW_LIBRARY
NAMES GLEW glew
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
DOC "The GLEW library")
ENDIF (WIN32)
IF (GLEW_INCLUDE_PATH)
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ELSE (GLEW_INCLUDE_PATH)
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ENDIF (GLEW_INCLUDE_PATH)
MARK_AS_ADVANCED( GLEW_FOUND )
FIND_PATH( SHRUTIL_INCLUDE_PATH shrUtils.h
${CUDA_SDK_ROOT_DIR}/../shared/inc
DOC "The directory where shrutil.h resides")
FIND_LIBRARY( SHRUTIL_LIBRARY
NAMES SHRUTIL shrutil_i386
PATHS
${CUDA_SDK_ROOT_DIR}/../shared/lib
DOC "The SHRUTIL library")
FIND_LIBRARY( CUTIL_LIBRARY
NAMES CUTIL cutil_i386
PATHS
${CUDA_SDK_ROOT_DIR}/lib
DOC "The CUTIL library")
include(FindCUDA)
set(CORELIBS
${GLUT_LIBRARY}
${OPENGL_LIBRARY}
${GLEW_LIBRARY}
${CUDA_SDK_LIBRARIES}
${SHRUTIL_LIBRARY}
${CUTIL_LIBRARY}
m)
set(CUDA_64_BIT_DEVICE_CODE OFF)
set(CMAKE_CXX_FLAGS "-g -Wall -m32")
set(CUDA_VERBOSE_BUILD ON)
if (Apple)
set (CMAKE_OSX_ARCHITECTURES i386)
set (CUDA_64_BIT_DEVICE_CODE OFF)
endif (Apple)
link_libraries(${CORELIBS})
include_directories(
${CUDA_SDK_ROOT_DIR}/common/inc
${CUDA_SDK_ROOT_DIR}/../shared/inc
${CMAKE_CURRENT_SOURCE_DIR}
)
cuda_add_executable(
volumeRender
volumeRender.cpp
volumeRender_kernel.cu
)
With the script above, it compiles/links fine. The problem is XCode project generation. It generates a XCode project, but if I try to build and run the project from within XCode, it again cannot find any library. Does anyone know why XCode can't find the libraries?