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)
15 SET(${PROJECT_NAME}StaticTarget libosgcudacommon)
17 SET(${PROJECT_NAME}StaticTarget osgcudacommon)
20 # SET(OSG_CUDACOMMON_SRC_INPUT param.cpp
23 SET(OSG_CUDACOMMON_HDR_INPUT helper_cuda.h
26 SetupFiles(OSG_CUDACOMMON_SRC_INPUT
28 "${OSGNVidiaSDKSrcDir}/C/common/src"
29 "${OSG_SUPP_CC_BBASE}/CudaCommon/src")
31 SetupFiles(OSG_CUDACOMMON_HDR_INPUT
33 "${OSGNVidiaSDKSrcDir}/common/inc"
34 "${OSG_SUPP_CC_BBASE}/CudaCommon/src")
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)
45 # INCLUDE_DIRECTORIES("${OSG_GLUT_INCLUDE_DIR}")
46 # INCLUDE_DIRECTORIES("${OSG_GLEW_INCLUDE_DIR}")
53 # ADD_LIBRARY(${${PROJECT_NAME}StaticTarget} STATIC ${OSG_CUDACOMMON_SRCS})
55 # ADD_DEPENDENCIES(ALL_STANDARD_BUILD ${${PROJECT_NAME}StaticTarget})
58 SET_TARGET_PROPERTIES(${${PROJECT_NAME}StaticTarget} PROPERTIES
62 SET(OSGCUDACOMLIB_DEF_STATIC ${OSGCUDACOMLIB_DEF})
64 # SET_TARGET_PROPERTIES(${${PROJECT_NAME}StaticTarget} PROPERTIES
65 # COMPILE_DEFINITIONS "${OSGCUDACOMLIB_DEF_STATIC}")
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 )
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)
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
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
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)