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)
|
||||
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(UNIX)
|
||||
|
||||
|
@ -34,9 +34,13 @@ ENDIF (CUDA_COMPILER)
|
||||
FIND_PATH (CUDA_INCLUDE_PATH cuda_runtime.h
|
||||
$ENV{CUDA_INC_PATH}
|
||||
${CUDA_COMPILER_SUPER_DIR}/include
|
||||
${CUDA_COMPILER_DIR}
|
||||
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
|
||||
NAMES cudart
|
||||
PATHS
|
||||
@ -45,6 +49,13 @@ FIND_LIBRARY (CUDA_RUNTIME_LIBRARY
|
||||
${CUDA_COMPILER_DIR}
|
||||
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)
|
||||
SET (CUDA_FOUND TRUE)
|
||||
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)
|
||||
|
||||
|
||||
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 "--host-compilation=C++")
|
||||
|
||||
@ -84,7 +106,7 @@ MACRO(GET_CUDA_INC_DIRS _cuda_INC_DIRS)
|
||||
|
||||
ENDMACRO(GET_CUDA_INC_DIRS)
|
||||
|
||||
|
||||
|
||||
# Get file dependencies.
|
||||
MACRO (GET_CUFILE_DEPENDENCIES dependencies file)
|
||||
GET_FILENAME_COMPONENT(filepath ${file} PATH)
|
||||
|
@ -10,7 +10,6 @@
|
||||
#
|
||||
|
||||
# On OSX default to using the framework version of Cg.
|
||||
|
||||
IF (APPLE)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
|
||||
SET(CG_FRAMEWORK_INCLUDES)
|
||||
@ -38,13 +37,25 @@ IF (APPLE)
|
||||
)
|
||||
ELSE (APPLE)
|
||||
IF (WIN32)
|
||||
FIND_PROGRAM( CG_COMPILER cgc
|
||||
$ENV{CG_BIN_PATH}
|
||||
|
||||
# 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
|
||||
$ENV{CG_BIN64_PATH}
|
||||
$ENV{CG_BIN_PATH}
|
||||
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/bin
|
||||
$ENV{PFx86}/NVIDIA\ Corporation/Cg/bin
|
||||
$ENV{PROGRAMFILES}/Cg
|
||||
${PROJECT_SOURCE_DIR}/../Cg
|
||||
DOC "The Cg Compiler"
|
||||
)
|
||||
)
|
||||
|
||||
IF (CG_COMPILER)
|
||||
GET_FILENAME_COMPONENT(CG_COMPILER_DIR ${CG_COMPILER} PATH)
|
||||
GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR ${CG_COMPILER_DIR} PATH)
|
||||
@ -61,27 +72,59 @@ ELSE (APPLE)
|
||||
${CG_COMPILER_DIR}
|
||||
DOC "The directory where Cg/cg.h resides"
|
||||
)
|
||||
FIND_LIBRARY( CG_LIBRARY
|
||||
NAMES Cg
|
||||
PATHS
|
||||
$ENV{CG_LIB_PATH}
|
||||
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib
|
||||
$ENV{PROGRAMFILES}/Cg
|
||||
${PROJECT_SOURCE_DIR}/../Cg
|
||||
${CG_COMPILER_SUPER_DIR}/lib
|
||||
${CG_COMPILER_DIR}
|
||||
DOC "The Cg runtime library"
|
||||
)
|
||||
FIND_LIBRARY( CG_GL_LIBRARY
|
||||
NAMES CgGL
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib
|
||||
$ENV{PROGRAMFILES}/Cg
|
||||
${PROJECT_SOURCE_DIR}/../Cg
|
||||
${CG_COMPILER_SUPER_DIR}/lib
|
||||
${CG_COMPILER_DIR}
|
||||
DOC "The Cg runtime library"
|
||||
)
|
||||
|
||||
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
|
||||
NAMES Cg
|
||||
PATHS
|
||||
$ENV{CG_LIB_PATH}
|
||||
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib
|
||||
$ENV{PROGRAMFILES}/Cg
|
||||
${PROJECT_SOURCE_DIR}/../Cg
|
||||
${CG_COMPILER_SUPER_DIR}/lib
|
||||
${CG_COMPILER_DIR}
|
||||
DOC "The Cg runtime library"
|
||||
)
|
||||
FIND_LIBRARY( CG_GL_LIBRARY
|
||||
NAMES CgGL
|
||||
PATHS
|
||||
$ENV{CG_LIB_PATH}
|
||||
$ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/lib
|
||||
$ENV{PROGRAMFILES}/Cg
|
||||
${PROJECT_SOURCE_DIR}/../Cg
|
||||
${CG_COMPILER_SUPER_DIR}/lib
|
||||
${CG_COMPILER_DIR}
|
||||
DOC "The Cg GL runtime library"
|
||||
)
|
||||
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||
|
||||
ELSE (WIN32)
|
||||
FIND_PROGRAM( CG_COMPILER cgc
|
||||
/usr/bin
|
||||
|
@ -12,13 +12,25 @@ IF (WIN32)
|
||||
$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")
|
||||
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
|
||||
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"
|
||||
)
|
||||
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||
ELSE (WIN32)
|
||||
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
|
||||
/usr/include
|
||||
|
@ -1,6 +1,7 @@
|
||||
# - try to find glut library and include files
|
||||
# GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
|
||||
# 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.
|
||||
# Also defined, but not for general use are:
|
||||
# GLUT_glut_LIBRARY = the full path to the glut library.
|
||||
@ -9,6 +10,10 @@
|
||||
|
||||
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)
|
||||
|
||||
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")
|
||||
# ENDIF(DARWIN)
|
||||
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL "debug")
|
||||
ADD_DEFINITIONS(-D_DEBUG)
|
||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "debug")
|
||||
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
IF(MSVC)
|
||||
|
@ -52,6 +52,11 @@ INCLUDE(${NV_CMAKE_DIR}/FindCUDA.cmake)
|
||||
IF(CUDA_FOUND)
|
||||
SET(HAVE_CUDA ${CUDA_FOUND} CACHE BOOL "Set to TRUE if CUDA is found, FALSE otherwise")
|
||||
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)
|
||||
MESSAGE(STATUS "Looking for CUDA - not found")
|
||||
ENDIF(CUDA_FOUND)
|
||||
|
Loading…
Reference in New Issue
Block a user