diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCCompilerId.c.in | 2 | ||||
-rw-r--r-- | Modules/CMakeCXXCompilerId.cpp.in | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineASMCompiler.cmake | 6 | ||||
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 34 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 37 | ||||
-rw-r--r-- | Modules/CMakeDetermineFortranCompiler.cmake | 28 | ||||
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 4 | ||||
-rw-r--r-- | Modules/Compiler/TI-ASM.cmake (renamed from Modules/Compiler/TI_DSP-ASM.cmake) | 0 | ||||
-rw-r--r-- | Modules/Compiler/TI-C.cmake (renamed from Modules/Compiler/TI_DSP-C.cmake) | 0 | ||||
-rw-r--r-- | Modules/Compiler/TI-CXX.cmake (renamed from Modules/Compiler/TI_DSP-CXX.cmake) | 0 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 41 | ||||
-rw-r--r-- | Modules/FindQt4.cmake | 8 |
12 files changed, 100 insertions, 62 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 2d76c7a..c25df0c 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -109,7 +109,7 @@ # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) #elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI_DSP" +# define COMPILER_ID "TI" /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 5e70a41..e2119c2 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -114,7 +114,7 @@ # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) #elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI_DSP" +# define COMPILER_ID "TI" /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 9f0b30a..9999f62 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -99,9 +99,9 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft") - list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP ) - set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h") - set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments") + list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI ) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI "-h") + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI "Texas Instruments") include(CMakeDetermineCompilerId) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT}) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 275fc47..d2220e0 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -145,19 +145,27 @@ endif () # NAME_WE cannot be used since then this test will fail for names lile # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" -if (CMAKE_CROSSCOMPILING - AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" - AND NOT _CMAKE_TOOLCHAIN_PREFIX) - get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) - if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") - set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif () - - # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils - # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) - if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") - set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif () +if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) + + if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") + get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) + if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif () + + # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils + # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) + if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif () + elseif("${CMAKE_C_COMPILER_ID}" MATCHES "TI") + # TI compilers are named e.g. cl6x, cl470 or armcl.exe + get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) + if (COMPILER_BASENAME MATCHES "^(.+)?cl([^.]+)?(\\.exe)?$") + set(_CMAKE_TOOLCHAIN_PREFIX "${CMAKE_MATCH_1}") + set(_CMAKE_TOOLCHAIN_SUFFIX "${CMAKE_MATCH_2}") + endif () + endif() endif () diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 59da3e6..6f7e8f6 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -141,19 +141,30 @@ endif () # NAME_WE cannot be used since then this test will fail for names lile # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" -if (CMAKE_CROSSCOMPILING - AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" - AND NOT _CMAKE_TOOLCHAIN_PREFIX) - get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) - if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") - set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif () - - # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils - # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) - if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") - set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif () + + +if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) + + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) + if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif () + + # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils + # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) + if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif () + elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "TI") + # TI compilers are named e.g. cl6x, cl470 or armcl.exe + get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) + if (COMPILER_BASENAME MATCHES "^(.+)?cl([^.]+)?(\\.exe)?$") + set(_CMAKE_TOOLCHAIN_PREFIX "${CMAKE_MATCH_1}") + set(_CMAKE_TOOLCHAIN_SUFFIX "${CMAKE_MATCH_2}") + endif () + + endif() endif () diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index f861e39..4d3fb90 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -200,19 +200,21 @@ endif () # NAME_WE cannot be used since then this test will fail for names lile # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" -if (CMAKE_CROSSCOMPILING - AND "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" - AND NOT _CMAKE_TOOLCHAIN_PREFIX) - get_filename_component(COMPILER_BASENAME "${CMAKE_Fortran_COMPILER}" NAME) - if (COMPILER_BASENAME MATCHES "^(.+-)g?fortran(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") - set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif () - - # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils - # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) - if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") - set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif () +if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) + + if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + get_filename_component(COMPILER_BASENAME "${CMAKE_Fortran_COMPILER}" NAME) + if (COMPILER_BASENAME MATCHES "^(.+-)g?fortran(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif () + + # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils + # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) + if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif () + endif() + endif () include(CMakeFindBinUtils) diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index e08c1c6..e70c013 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -41,14 +41,14 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" # in all other cases search for ar, ranlib, etc. else() - find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) if(NOT CMAKE_RANLIB) set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") endif() - find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) diff --git a/Modules/Compiler/TI_DSP-ASM.cmake b/Modules/Compiler/TI-ASM.cmake index e097626..e097626 100644 --- a/Modules/Compiler/TI_DSP-ASM.cmake +++ b/Modules/Compiler/TI-ASM.cmake diff --git a/Modules/Compiler/TI_DSP-C.cmake b/Modules/Compiler/TI-C.cmake index b580994..b580994 100644 --- a/Modules/Compiler/TI_DSP-C.cmake +++ b/Modules/Compiler/TI-C.cmake diff --git a/Modules/Compiler/TI_DSP-CXX.cmake b/Modules/Compiler/TI-CXX.cmake index 8cf5ac3..8cf5ac3 100644 --- a/Modules/Compiler/TI_DSP-CXX.cmake +++ b/Modules/Compiler/TI-CXX.cmake diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 61d6ea7..423ad3d 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1341,13 +1341,6 @@ endfunction() function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) if (object_files) - if(NOT EXISTS "${output_file}") - # Some generators (e.g. makefiles) can't proceed to the link phase if all - # input files aren't available. This guarantees the file exists, so that - # linking can begin. - execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${output_file}") - endif() - set_source_files_properties("${output_file}" PROPERTIES EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only @@ -1379,12 +1372,34 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options endforeach() endforeach() file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") - add_custom_command( - TARGET ${cuda_target} - PRE_LINK - COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" - ) + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599) + # VS 2010 and 2012 have this problem. If future versions fix this issue, + # it should still work, it just won't be as nice as the other method. + set(do_obj_build_rule FALSE) + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + ) + else() + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + ) + endif() endif() endfunction() diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 4317ce2..6fdc20a 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -187,7 +187,8 @@ # # Below is a detailed list of variables that FindQt4.cmake sets. # QT_FOUND If false, don't try to use Qt. -# QT4_FOUND If false, don't try to use Qt 4. +# Qt4_FOUND If false, don't try to use Qt 4. +# QT4_FOUND If false, don't try to use Qt 4. This variable is for compatibility only. # # QT_VERSION_MAJOR The major version of Qt found. # QT_VERSION_MINOR The minor version of Qt found. @@ -1364,7 +1365,7 @@ if (NOT QT_VERSION_MAJOR EQUAL 4) endif() endif() else() - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 FOUND_VAR Qt4_FOUND REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} VERSION_VAR QTVERSION ) @@ -1379,5 +1380,6 @@ endif() set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} ) set (QT_UIC_EXE ${QT_UIC_EXECUTABLE} ) set( QT_QT_LIBRARY "") -set(QT_FOUND ${QT4_FOUND}) +set(QT4_FOUND ${Qt4_FOUND}) +set(QT_FOUND ${Qt4_FOUND}) |