Merge changes from internal branch.
- Better support for win64.
This commit is contained in:
parent
1975883bed
commit
b8eb12afc1
@ -21,7 +21,13 @@ IF(UNIX)
|
|||||||
|
|
||||||
ELSE(UNIX)
|
ELSE(UNIX)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET (NV_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
|
# It's not OK to trust $ENV{PROCESSOR_ARCHITECTURE}: its value depends on the type of executable being run,
|
||||||
|
# so a 32-bit cmake (the default binary distribution) will always say "x86" regardless of the actual target.
|
||||||
|
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
SET (NV_SYSTEM_PROCESSOR "AMD64")
|
||||||
|
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
SET (NV_SYSTEM_PROCESSOR "x86")
|
||||||
|
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
ENDIF(UNIX)
|
ENDIF(UNIX)
|
||||||
|
|
||||||
|
@ -34,9 +34,13 @@ ENDIF (CUDA_COMPILER)
|
|||||||
FIND_PATH (CUDA_INCLUDE_PATH cuda_runtime.h
|
FIND_PATH (CUDA_INCLUDE_PATH cuda_runtime.h
|
||||||
$ENV{CUDA_INC_PATH}
|
$ENV{CUDA_INC_PATH}
|
||||||
${CUDA_COMPILER_SUPER_DIR}/include
|
${CUDA_COMPILER_SUPER_DIR}/include
|
||||||
${CUDA_COMPILER_DIR}
|
|
||||||
DOC "The directory where CUDA headers reside")
|
DOC "The directory where CUDA headers reside")
|
||||||
|
|
||||||
|
FIND_PATH (CUTIL_INCLUDE_PATH cutil.h
|
||||||
|
"$ENV{NVSDKCUDA_ROOT}/common/inc"
|
||||||
|
"$ENV{PROGRAMFILES}/NVIDIA Corporation/NVIDIA CUDA SDK/common/inc"
|
||||||
|
DOC "The directory where the CUTIL headers reside")
|
||||||
|
|
||||||
FIND_LIBRARY (CUDA_RUNTIME_LIBRARY
|
FIND_LIBRARY (CUDA_RUNTIME_LIBRARY
|
||||||
NAMES cudart
|
NAMES cudart
|
||||||
PATHS
|
PATHS
|
||||||
@ -45,6 +49,13 @@ FIND_LIBRARY (CUDA_RUNTIME_LIBRARY
|
|||||||
${CUDA_COMPILER_DIR}
|
${CUDA_COMPILER_DIR}
|
||||||
DOC "The CUDA runtime library")
|
DOC "The CUDA runtime library")
|
||||||
|
|
||||||
|
FIND_LIBRARY (CUTIL_LIBRARY
|
||||||
|
NAMES cutil32 cutil64
|
||||||
|
PATHS
|
||||||
|
"$ENV{NVSDKCUDA_ROOT}/common/lib"
|
||||||
|
"$ENV{PROGRAMFILES}/NVIDIA Corporation/NVIDIA CUDA SDK/common/lib"
|
||||||
|
DOC "The CUTIL library")
|
||||||
|
|
||||||
IF (CUDA_INCLUDE_PATH AND CUDA_RUNTIME_LIBRARY)
|
IF (CUDA_INCLUDE_PATH AND CUDA_RUNTIME_LIBRARY)
|
||||||
SET (CUDA_FOUND TRUE)
|
SET (CUDA_FOUND TRUE)
|
||||||
ELSE (CUDA_INCLUDE_PATH AND CUDA_RUNTIME_LIBRARY)
|
ELSE (CUDA_INCLUDE_PATH AND CUDA_RUNTIME_LIBRARY)
|
||||||
@ -56,6 +67,17 @@ SET (CUDA_LIBRARIES ${CUDA_RUNTIME_LIBRARY})
|
|||||||
MARK_AS_ADVANCED (CUDA_FOUND CUDA_COMPILER CUDA_RUNTIME_LIBRARY)
|
MARK_AS_ADVANCED (CUDA_FOUND CUDA_COMPILER CUDA_RUNTIME_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
|
IF (CUTIL_INCLUDE_PATH AND CUTIL_LIBRARY)
|
||||||
|
SET (CUTIL_FOUND 1 CACHE STRING "Set to 1 if CUDA is found, 0 otherwise")
|
||||||
|
ELSE (CUTIL_INCLUDE_PATH AND CUTIL_LIBRARY)
|
||||||
|
SET (CUTIL_FOUND 0 CACHE STRING "Set to 1 if CUDA is found, 0 otherwise")
|
||||||
|
ENDIF (CUTIL_INCLUDE_PATH AND CUTIL_LIBRARY)
|
||||||
|
|
||||||
|
SET (CUTIL_LIBRARIES ${CUTIL_LIBRARY})
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED (CUTIL_FOUND)
|
||||||
|
|
||||||
|
|
||||||
#SET(CUDA_OPTIONS "-ncfe")
|
#SET(CUDA_OPTIONS "-ncfe")
|
||||||
SET(CUDA_OPTIONS "--host-compilation=C++")
|
SET(CUDA_OPTIONS "--host-compilation=C++")
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# On OSX default to using the framework version of Cg.
|
# On OSX default to using the framework version of Cg.
|
||||||
|
|
||||||
IF (APPLE)
|
IF (APPLE)
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
|
INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
|
||||||
SET(CG_FRAMEWORK_INCLUDES)
|
SET(CG_FRAMEWORK_INCLUDES)
|
||||||
@ -38,13 +37,25 @@ IF (APPLE)
|
|||||||
)
|
)
|
||||||
ELSE (APPLE)
|
ELSE (APPLE)
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
|
|
||||||
|
# When compiling 64-bit programs, the binaries and libs are in bin.x64 and lib.x64 directories,
|
||||||
|
|
||||||
|
# This will have only effect for 64bit versions of cmake, when running the default 32bit version
|
||||||
|
# both ProgramFiles and ProgramFiles(x86) point to the same place in Win64
|
||||||
|
SET(PFx86_VARNAME "ProgramFiles(x86)")
|
||||||
|
SET(PFx86 $ENV{${PFx86_VARNAME}})
|
||||||
|
|
||||||
|
# Let's play safe in case we are cross compiling to 64 bit: for cgc it doesn't really matter
|
||||||
FIND_PROGRAM( CG_COMPILER cgc
|
FIND_PROGRAM( CG_COMPILER cgc
|
||||||
|
$ENV{CG_BIN64_PATH}
|
||||||
$ENV{CG_BIN_PATH}
|
$ENV{CG_BIN_PATH}
|
||||||
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/bin
|
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/bin
|
||||||
|
$ENV{PFx86}/NVIDIA\ Corporation/Cg/bin
|
||||||
$ENV{PROGRAMFILES}/Cg
|
$ENV{PROGRAMFILES}/Cg
|
||||||
${PROJECT_SOURCE_DIR}/../Cg
|
${PROJECT_SOURCE_DIR}/../Cg
|
||||||
DOC "The Cg Compiler"
|
DOC "The Cg Compiler"
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (CG_COMPILER)
|
IF (CG_COMPILER)
|
||||||
GET_FILENAME_COMPONENT(CG_COMPILER_DIR ${CG_COMPILER} PATH)
|
GET_FILENAME_COMPONENT(CG_COMPILER_DIR ${CG_COMPILER} PATH)
|
||||||
GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR ${CG_COMPILER_DIR} PATH)
|
GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR ${CG_COMPILER_DIR} PATH)
|
||||||
@ -61,6 +72,35 @@ ELSE (APPLE)
|
|||||||
${CG_COMPILER_DIR}
|
${CG_COMPILER_DIR}
|
||||||
DOC "The directory where Cg/cg.h resides"
|
DOC "The directory where Cg/cg.h resides"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF (NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||||
|
FIND_LIBRARY( CG_LIBRARY
|
||||||
|
NAMES Cg
|
||||||
|
PATHS
|
||||||
|
$ENV{CG_LIB64_PATH}
|
||||||
|
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib.x64
|
||||||
|
$ENV{PFx86}/NVIDIA\ Corporation/Cg/lib.x64
|
||||||
|
$ENV{PROGRAMFILES}/Cg
|
||||||
|
$ENV{PFx86}/Cg
|
||||||
|
${PROJECT_SOURCE_DIR}/../Cg
|
||||||
|
${CG_COMPILER_SUPER_DIR}/lib.x64
|
||||||
|
${CG_COMPILER_DIR}
|
||||||
|
DOC "The Cg runtime library (64-bit)"
|
||||||
|
)
|
||||||
|
FIND_LIBRARY( CG_GL_LIBRARY
|
||||||
|
NAMES CgGL
|
||||||
|
PATHS
|
||||||
|
$ENV{CG_LIB64_PATH}
|
||||||
|
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib.x64
|
||||||
|
$ENV{PFx86}/NVIDIA\ Corporation/Cg/lib.x64
|
||||||
|
$ENV{PROGRAMFILES}/Cg
|
||||||
|
$ENV{PFx86}/Cg
|
||||||
|
${PROJECT_SOURCE_DIR}/../Cg
|
||||||
|
${CG_COMPILER_SUPER_DIR}/lib.x64
|
||||||
|
${CG_COMPILER_DIR}
|
||||||
|
DOC "The Cg GL runtime library (64-bit)"
|
||||||
|
)
|
||||||
|
ELSE(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||||
FIND_LIBRARY( CG_LIBRARY
|
FIND_LIBRARY( CG_LIBRARY
|
||||||
NAMES Cg
|
NAMES Cg
|
||||||
PATHS
|
PATHS
|
||||||
@ -75,13 +115,16 @@ ELSE (APPLE)
|
|||||||
FIND_LIBRARY( CG_GL_LIBRARY
|
FIND_LIBRARY( CG_GL_LIBRARY
|
||||||
NAMES CgGL
|
NAMES CgGL
|
||||||
PATHS
|
PATHS
|
||||||
|
$ENV{CG_LIB_PATH}
|
||||||
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib
|
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib
|
||||||
$ENV{PROGRAMFILES}/Cg
|
$ENV{PROGRAMFILES}/Cg
|
||||||
${PROJECT_SOURCE_DIR}/../Cg
|
${PROJECT_SOURCE_DIR}/../Cg
|
||||||
${CG_COMPILER_SUPER_DIR}/lib
|
${CG_COMPILER_SUPER_DIR}/lib
|
||||||
${CG_COMPILER_DIR}
|
${CG_COMPILER_DIR}
|
||||||
DOC "The Cg runtime library"
|
DOC "The Cg GL runtime library"
|
||||||
)
|
)
|
||||||
|
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||||
|
|
||||||
ELSE (WIN32)
|
ELSE (WIN32)
|
||||||
FIND_PROGRAM( CG_COMPILER cgc
|
FIND_PROGRAM( CG_COMPILER cgc
|
||||||
/usr/bin
|
/usr/bin
|
||||||
|
@ -12,13 +12,25 @@ IF (WIN32)
|
|||||||
$ENV{PROGRAMFILES}/GLEW/include
|
$ENV{PROGRAMFILES}/GLEW/include
|
||||||
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
|
||||||
DOC "The directory where GL/glew.h resides")
|
DOC "The directory where GL/glew.h resides")
|
||||||
|
IF (NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||||
|
FIND_LIBRARY( GLEW_LIBRARY
|
||||||
|
NAMES glew64 glew64s
|
||||||
|
PATHS
|
||||||
|
$ENV{PROGRAMFILES}/GLEW/lib
|
||||||
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
|
||||||
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
|
||||||
|
DOC "The GLEW library (64-bit)"
|
||||||
|
)
|
||||||
|
ELSE(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||||
FIND_LIBRARY( GLEW_LIBRARY
|
FIND_LIBRARY( GLEW_LIBRARY
|
||||||
NAMES glew GLEW glew32 glew32s
|
NAMES glew GLEW glew32 glew32s
|
||||||
PATHS
|
PATHS
|
||||||
$ENV{PROGRAMFILES}/GLEW/lib
|
$ENV{PROGRAMFILES}/GLEW/lib
|
||||||
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
|
||||||
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
|
||||||
DOC "The GLEW library")
|
DOC "The GLEW library"
|
||||||
|
)
|
||||||
|
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||||
ELSE (WIN32)
|
ELSE (WIN32)
|
||||||
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
|
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
|
||||||
/usr/include
|
/usr/include
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# - try to find glut library and include files
|
# - try to find glut library and include files
|
||||||
# GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
|
# GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
|
||||||
# GLUT_LIBRARIES, the libraries to link against
|
# GLUT_LIBRARIES, the libraries to link against
|
||||||
|
# GLUT_DEFINITIONS - You should ADD_DEFINITIONS(${GLUT_DEFINITIONS}) before compiling code that includes png library files.
|
||||||
# GLUT_FOUND, If false, do not try to use GLUT.
|
# GLUT_FOUND, If false, do not try to use GLUT.
|
||||||
# Also defined, but not for general use are:
|
# Also defined, but not for general use are:
|
||||||
# GLUT_glut_LIBRARY = the full path to the glut library.
|
# GLUT_glut_LIBRARY = the full path to the glut library.
|
||||||
@ -9,6 +10,10 @@
|
|||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
|
|
||||||
|
# By default the GLUT include tries to autolink using #pragma directives, but those
|
||||||
|
# interfere with the other cmake definitions
|
||||||
|
SET (GLUT_DEFINITIONS -DGLUT_NO_LIB_PRAGMA)
|
||||||
|
|
||||||
IF(CYGWIN)
|
IF(CYGWIN)
|
||||||
|
|
||||||
FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
|
FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
|
||||||
|
@ -36,6 +36,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk")
|
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk")
|
||||||
# ENDIF(DARWIN)
|
# ENDIF(DARWIN)
|
||||||
|
|
||||||
|
IF(CMAKE_BUILD_TYPE STREQUAL "debug")
|
||||||
|
ADD_DEFINITIONS(-D_DEBUG)
|
||||||
|
ENDIF(CMAKE_BUILD_TYPE STREQUAL "debug")
|
||||||
|
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
|
@ -52,6 +52,11 @@ INCLUDE(${NV_CMAKE_DIR}/FindCUDA.cmake)
|
|||||||
IF(CUDA_FOUND)
|
IF(CUDA_FOUND)
|
||||||
SET(HAVE_CUDA ${CUDA_FOUND} CACHE BOOL "Set to TRUE if CUDA is found, FALSE otherwise")
|
SET(HAVE_CUDA ${CUDA_FOUND} CACHE BOOL "Set to TRUE if CUDA is found, FALSE otherwise")
|
||||||
MESSAGE(STATUS "Looking for CUDA - found")
|
MESSAGE(STATUS "Looking for CUDA - found")
|
||||||
|
IF(CUTIL_FOUND)
|
||||||
|
MESSAGE(STATUS "Looking for CUTIL - found")
|
||||||
|
ELSE(CUTIL_FOUND)
|
||||||
|
MESSAGE(STATUS "Looking for CUTIL - not found")
|
||||||
|
ENDIF(CUTIL_FOUND)
|
||||||
ELSE(CUDA_FOUND)
|
ELSE(CUDA_FOUND)
|
||||||
MESSAGE(STATUS "Looking for CUDA - not found")
|
MESSAGE(STATUS "Looking for CUDA - not found")
|
||||||
ENDIF(CUDA_FOUND)
|
ENDIF(CUDA_FOUND)
|
||||||
|
Loading…
Reference in New Issue
Block a user