Commit 0674df59 authored by Declara Denis's avatar Declara Denis Committed by Christian Schulte zu Berge
Browse files

Modified CMake file to support Visual Studio

parent b0737b5f
# CMake file for vis module
IF(${ModuleEnabled})
# Find CUDA
# Find CUDA
FIND_PACKAGE(CUDA REQUIRED)
if(CUDA_FOUND)
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/cudaconfidencemaps/core/*.cpp
modules/cudaconfidencemaps/pipelines/*.cpp
modules/cudaconfidencemaps/processors/*.cpp
)
# Header files (including GLSL files so that they'll appear in VS projects)
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/cudaconfidencemaps/glsl/*.frag
modules/cudaconfidencemaps/glsl/*.geom
modules/cudaconfidencemaps/glsl/*.vert
modules/cudaconfidencemaps/pipelines/*.h
modules/cudaconfidencemaps/processors/*.h
)
# Build CUDA sources
set(CUDA_PROPAGATE_HOST_FLAGS OFF) # Otherwise -std=c++11 is passed, which does not work with cuda compilers
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3)
file(GLOB cuda_SOURCES modules/cudaconfidencemaps/core/*.cu)
cuda_add_library(
CudaConfidenceMaps_CUDA
${cuda_SOURCES}
)
LIST(APPEND ThisModExternalLibs CudaConfidenceMaps_CUDA)
SET(ThisModShaderDirectories "modules/cudaconfidencemaps/glsl")
SET(ThisModDependencies base io)
else()
MESSAGE(FATAL_ERROR "Could not find CUDA SDK.")
endif()
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/cudaconfidencemaps/core/*.cpp
modules/cudaconfidencemaps/pipelines/*.cpp
modules/cudaconfidencemaps/processors/*.cpp
)
# Header files (including GLSL files so that they'll appear in VS projects)
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/cudaconfidencemaps/glsl/*.frag
modules/cudaconfidencemaps/glsl/*.geom
modules/cudaconfidencemaps/glsl/*.vert
modules/cudaconfidencemaps/pipelines/*.h
modules/cudaconfidencemaps/processors/*.h
)
IF(NOT WIN32)
# Otherwise -std=c++11 is passed to the compiler on linux. However official
# c++11 support for cuda is only available in CUDA 7
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
ENDIF()
IF(CMAKE_BUILD_TYPE MATCHES RELEASE)
# Enable optimizations when building a release version
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3)
ENDIF()
# Build CUDA sources
file(GLOB cuda_SOURCES modules/cudaconfidencemaps/core/*.cu)
CUDA_ADD_LIBRARY(CudaConfidenceMaps_CUDA STATIC
${cuda_SOURCES}
)
# Make sure code can find the CUSP include files included with this module
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};"-I ${ThisModDir}/ext/cusplibrary-0.4.0")
LIST(APPEND ThisModExternalLibs CudaConfidenceMaps_CUDA)
SET(ThisModShaderDirectories "modules/cudaconfidencemaps/glsl")
SET(ThisModDependencies base io)
else()
MESSAGE(FATAL_ERROR "Could not find CUDA SDK.")
endif()
ENDIF(${ModuleEnabled})
SET(ThisModStatus EXPERIMENTAL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment