diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDA.cmake | 48 | ||||
-rw-r--r-- | Modules/Platform/Darwin-icc.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/Darwin.cmake | 5 | ||||
-rw-r--r-- | Modules/Platform/Linux-Intel-Fortran.cmake | 4 | ||||
-rw-r--r-- | Modules/UseQt4.cmake | 2 |
5 files changed, 43 insertions, 22 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 5dca820..05f38eb 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -649,19 +649,15 @@ endforeach() ############################################################################### ############################################################################### -# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, -# if they have then clear the cache variables, so that will be detected again. -if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") - unset(CUDA_NVCC_EXECUTABLE CACHE) +macro(cuda_unset_include_and_libraries) unset(CUDA_TOOLKIT_INCLUDE CACHE) unset(CUDA_CUDART_LIBRARY CACHE) + unset(CUDA_CUDA_LIBRARY CACHE) # Make sure you run this before you unset CUDA_VERSION. if(CUDA_VERSION VERSION_EQUAL "3.0") # This only existed in the 3.0 version of the CUDA toolkit unset(CUDA_CUDARTEMU_LIBRARY CACHE) endif() - unset(CUDA_VERSION CACHE) - unset(CUDA_CUDA_LIBRARY CACHE) unset(CUDA_cupti_LIBRARY CACHE) unset(CUDA_cublas_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE) @@ -675,6 +671,19 @@ if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") unset(CUDA_npps_LIBRARY CACHE) unset(CUDA_nvcuvenc_LIBRARY CACHE) unset(CUDA_nvcuvid_LIBRARY CACHE) +endmacro() + +# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, +# if they have then clear the cache variables, so that will be detected again. +if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") + unset(CUDA_TOOLKIT_TARGET_DIR CACHE) + unset(CUDA_NVCC_EXECUTABLE CACHE) + unset(CUDA_VERSION CACHE) + cuda_unset_include_and_libraries() +endif() + +if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") + cuda_unset_include_and_libraries() endif() if(NOT "${CUDA_SDK_ROOT_DIR}" STREQUAL "${CUDA_SDK_ROOT_DIR_INTERNAL}") @@ -749,10 +758,27 @@ endif() # Always set this convenience variable set(CUDA_VERSION_STRING "${CUDA_VERSION}") +# Support for arm cross compilation with CUDA 5.5 +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.") +else() + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.") +endif() +mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) + +# Target CPU architecture +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") + set(_cuda_target_cpu_arch_initial "ARM") +else() + set(_cuda_target_cpu_arch_initial "") +endif() +set(CUDA_TARGET_CPU_ARCH ${_cuda_target_cpu_arch_initial} CACHE STRING "Specify the name of the class of CPU architecture for which the input files must be compiled.") +mark_as_advanced(CUDA_TARGET_CPU_ARCH) + # CUDA_TOOLKIT_INCLUDE find_path(CUDA_TOOLKIT_INCLUDE device_functions.h # Header included in toolkit - PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}" ENV CUDA_PATH ENV CUDA_INC_PATH PATH_SUFFIXES include @@ -776,7 +802,7 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) # (lib/Win32) and the old path (lib). find_library(${_var} NAMES ${_names} - PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}" ENV CUDA_PATH ENV CUDA_LIB_PATH PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" @@ -967,6 +993,8 @@ set(CUDA_FOUND TRUE) set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) +set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) @@ -1191,6 +1219,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) set(nvcc_flags ${nvcc_flags} -m32) endif() + if(CUDA_TARGET_CPU_ARCH) + set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") + endif() + # This needs to be passed in at this stage, because VS needs to fill out the # value of VCInstallDir from within VS. Note that CCBIN is only used if # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake index 6a46f8e..0fab9a1 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -60,12 +60,6 @@ if(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) CACHE STRING "Build architectures for OSX") endif() - -if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") - set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS - "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress") -endif() - if(NOT XCODE) # Enable shared library versioning. This flag is not actually referenced # but the fact that the setting exists will cause the generators to support diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 8ab3e2c..f3ec441 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -223,11 +223,6 @@ if(CMAKE_OSX_DEPLOYMENT_TARGET) endif() endif() -if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") - set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS - "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress") -endif() - # Enable shared library versioning. set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") diff --git a/Modules/Platform/Linux-Intel-Fortran.cmake b/Modules/Platform/Linux-Intel-Fortran.cmake index bb671ee..0c9523c 100644 --- a/Modules/Platform/Linux-Intel-Fortran.cmake +++ b/Modules/Platform/Linux-Intel-Fortran.cmake @@ -1,4 +1,4 @@ include(Platform/Linux-Intel) __linux_compiler_intel(Fortran) -set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -i_dynamic -nofor_main") -set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic") +set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -nofor_main") +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake index 35090fc..aa036b7 100644 --- a/Modules/UseQt4.cmake +++ b/Modules/UseQt4.cmake @@ -63,7 +63,7 @@ endif () # list dependent modules, so dependent libraries are added set(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE) -set(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE) +set(QT_QTSVG_MODULE_DEPENDS QTGUI QTCORE) set(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE) set(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE) if(QT_QTDBUS_FOUND) |