fixed: c++11 build problems ("" operator)
[opensg.git] / Source / Contrib / ComputeBase / Support / CudaCommon / CMakeLists.txt
blob0ffbe87885d6877f8e05accb2d96ebafd035bca3
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 INCLUDE(OSGContribComputeBase.SetupHelper)
6 SET(OSG_CUDA_COMMON_BUILD FALSE CACHE INTERNAL "" FORCE)
8 MESSAGE(STATUS "add CudaCommon")
10 IF(OSGNVidiaSDKSrcDir)
12   PROJECT(OSGCudaCommon)
14   IF(WIN32)
15     SET(${PROJECT_NAME}StaticTarget    libosgcudacommon)
16   ELSE(WIN32)
17     SET(${PROJECT_NAME}StaticTarget    osgcudacommon)
18   ENDIF(WIN32)
20 #  SET(OSG_CUDACOMMON_SRC_INPUT param.cpp
21 #                               paramgl.cpp)
23   SET(OSG_CUDACOMMON_HDR_INPUT helper_cuda.h
24                                helper_cuda_gl.h)
26   SetupFiles(OSG_CUDACOMMON_SRC_INPUT 
27              OSG_CUDACOMMON_SRCS 
28              "${OSGNVidiaSDKSrcDir}/C/common/src"
29              "${OSG_SUPP_CC_BBASE}/CudaCommon/src")
31   SetupFiles(OSG_CUDACOMMON_HDR_INPUT 
32              OSG_CUDACOMMON_HDR 
33              "${OSGNVidiaSDKSrcDir}/common/inc"
34              "${OSG_SUPP_CC_BBASE}/CudaCommon/src")
36   IF(NOT WIN32)
37     IF(NOT EXISTS ${_OSGSUPP_DST_DIR}/GL/glew.h)
38       FILE(MAKE_DIRECTORY ${_OSGSUPP_DST_DIR}/GL)
39       FILE(WRITE ${_OSGSUPP_DST_DIR}/GL/glew.h "/* dummy on unix */\n#include <GL/gl.h>")
40     ENDIF(NOT EXISTS ${_OSGSUPP_DST_DIR}/GL/glew.h)
41   ENDIF(NOT WIN32)
44   IF(WIN32)
45 #    INCLUDE_DIRECTORIES("${OSG_GLUT_INCLUDE_DIR}")
46 #    INCLUDE_DIRECTORIES("${OSG_GLEW_INCLUDE_DIR}")
47   ENDIF(WIN32)
49   IF(BUILD_STATIC_LIBS)
51     ## device lib
53 #    ADD_LIBRARY(${${PROJECT_NAME}StaticTarget} STATIC ${OSG_CUDACOMMON_SRCS})
55 #    ADD_DEPENDENCIES(ALL_STANDARD_BUILD ${${PROJECT_NAME}StaticTarget})
57     IF(WIN32)
58       SET_TARGET_PROPERTIES(${${PROJECT_NAME}StaticTarget} PROPERTIES
59                             DEBUG_POSTFIX "D")
60     ENDIF(WIN32)
62     SET(OSGCUDACOMLIB_DEF_STATIC ${OSGCUDACOMLIB_DEF})
64 #    SET_TARGET_PROPERTIES(${${PROJECT_NAME}StaticTarget} PROPERTIES
65 #                          COMPILE_DEFINITIONS "${OSGCUDACOMLIB_DEF_STATIC}")
68     IF(WIN32)
69       INSTALL(TARGETS ${${PROJECT_NAME}StaticTarget}
70                   CONFIGURATIONS ${_OSG_INSTALL_CONFIGS}
71                   RUNTIME DESTINATION bin COMPONENT libraries 
72                   LIBRARY DESTINATION lib COMPONENT libraries 
73                   ARCHIVE DESTINATION lib COMPONENT libraries )
74     ELSE(WIN32)
75 #      INSTALL(TARGETS ${${PROJECT_NAME}StaticTarget}
76 #                  RUNTIME DESTINATION lib${OSG_LIBDIR_SUFFIX} COMPONENT static_libraries 
77 #                  LIBRARY DESTINATION lib${OSG_LIBDIR_SUFFIX} COMPONENT static_libraries 
78 #                  ARCHIVE DESTINATION lib${OSG_LIBDIR_SUFFIX} COMPONENT static_libraries)
79     ENDIF(WIN32)
81   ENDIF(BUILD_STATIC_LIBS)
83   INSTALL(FILES ${OSG_CUDACOMMON_HDR} 
84           DESTINATION include${OSG_SUPPORT_INC_SUBDIR}/cuda
85           COMPONENT code_headers
86           PERMISSIONS OWNER_WRITE OWNER_READ
87                       GROUP_READ
88                       WORLD_READ)
90   IF(NOT WIN32)
91     INSTALL(FILES ${_OSGSUPP_DST_DIR}/GL/glew.h
92             DESTINATION include${OSG_SUPPORT_INC_SUBDIR}/cuda/GL
93             COMPONENT code_headers
94             PERMISSIONS OWNER_WRITE OWNER_READ
95                         GROUP_READ
96                         WORLD_READ)
97   ENDIF(NOT WIN32)
99   SET(OSG_CUDA_COMMON_BUILD TRUE CACHE INTERNAL "" FORCE)
100   SET(OSG_CUDA_COMMON_INCLUDEDIR "${CMAKE_BINARY_DIR}/${OSG_SUPP_CC_BBASE}/CudaCommon/src" CACHE PATH "")
102 ELSE(OSGNVidiaSDKSrcDir)
103   SET(OSGNVidiaSDKSrcDir "" CACHE PATH "")
104 ENDIF(OSGNVidiaSDKSrcDir)