diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeVS8FindMake.cmake | 3 | ||||
-rw-r--r-- | Modules/CMakeVS9FindMake.cmake | 4 | ||||
-rw-r--r-- | Modules/DartConfiguration.tcl.in | 1 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 24 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 29 | ||||
-rw-r--r-- | Modules/FindQt4.cmake | 28 | ||||
-rw-r--r-- | Modules/FindThreads.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/OSF1.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Windows-GNU-Fortran.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Windows-GNU.cmake | 2 | ||||
-rw-r--r-- | Modules/Qt4ConfigDependentSettings.cmake | 7 |
11 files changed, 59 insertions, 47 deletions
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake index 6f45ed5..2f03e60 100644 --- a/Modules/CMakeVS8FindMake.cmake +++ b/Modules/CMakeVS8FindMake.cmake @@ -28,9 +28,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE" "/Program Files/Microsoft Visual Studio 8/Common7/IDE/" - PATHS - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC80 1) diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake index 2741f77..4704bcc 100644 --- a/Modules/CMakeVS9FindMake.cmake +++ b/Modules/CMakeVS9FindMake.cmake @@ -33,10 +33,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/Common7/IDE" "/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/" "/Program Files/Microsoft Visual Studio 9/Common7/IDE/" - PATHS - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" - ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC90 1) diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in index 85b4138..51f514f 100644 --- a/Modules/DartConfiguration.tcl.in +++ b/Modules/DartConfiguration.tcl.in @@ -49,6 +49,7 @@ SVNUpdateOptions: @SVN_UPDATE_OPTIONS@ # Git options GITCommand: @GITCOMMAND@ GITUpdateOptions: @GIT_UPDATE_OPTIONS@ +GITUpdateCustom: @CTEST_GIT_UPDATE_CUSTOM@ # Generic update command UpdateCommand: @UPDATE_COMMAND@ diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 15749f2..8c249dc 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -358,7 +358,7 @@ endif() endfunction(_ep_write_verifyfile_script) -function(_ep_write_extractfile_script script_filename filename directory) +function(_ep_write_extractfile_script script_filename name filename directory) set(args "") if(filename MATCHES "(\\.bz2|\\.tar\\.gz|\\.tgz|\\.zip)$") @@ -391,10 +391,10 @@ endif() # Prepare a space for extracting: # set(i 1234) -while(EXISTS \"\${directory}/../ex\${i}\") +while(EXISTS \"\${directory}/../ex-${name}\${i}\") math(EXPR i \"\${i} + 1\") endwhile() -set(ut_dir \"\${directory}/../ex\${i}\") +set(ut_dir \"\${directory}/../ex-${name}\${i}\") file(MAKE_DIRECTORY \"\${ut_dir}\") # Extract it: @@ -738,6 +738,16 @@ function(_ep_get_git_version git_EXECUTABLE git_version_var) endfunction() +function(_ep_is_dir_empty dir empty_var) + file(GLOB gr "${dir}/*") + if("${gr}" STREQUAL "") + set(${empty_var} 1 PARENT_SCOPE) + else() + set(${empty_var} 0 PARENT_SCOPE) + endif() +endfunction() + + function(_ep_add_download_command name) ExternalProject_Get_Property(${name} source_dir stamp_dir download_dir tmp_dir) @@ -885,12 +895,14 @@ function(_ep_add_download_command name) endif() _ep_write_verifyfile_script("${stamp_dir}/verify-${name}.cmake" "${file}" "${md5}") list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake) - # TODO: Support other archive formats. - _ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${file}" "${source_dir}") + _ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${name}" "${file}" "${source_dir}") list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/extract-${name}.cmake) endif() else() - message(SEND_ERROR "error: no download info for '${name}' -- please specify existing SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY or DOWNLOAD_COMMAND") + _ep_is_dir_empty("${source_dir}" empty) + if(${empty}) + message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY or DOWNLOAD_COMMAND") + endif() endif() ExternalProject_Add_Step(${name} download diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 6539057..7099609 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -418,6 +418,10 @@ if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") unset(CUDA_VERSION CACHE) unset(CUDA_TOOLKIT_INCLUDE CACHE) unset(CUDA_CUDART_LIBRARY CACHE) + 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_CUDA_LIBRARY CACHE) unset(CUDA_cublas_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE) @@ -484,6 +488,10 @@ if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") mark_as_advanced(CUDA_VERSION) +else() + # Need to set these based off of the cached value + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") endif() # Always set this convenience variable @@ -545,11 +553,28 @@ endmacro() # CUDA_LIBRARIES find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") -set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +if(CUDA_VERSION VERSION_EQUAL "3.0") + # The cudartemu library only existed for the 3.0 version of CUDA. + find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") + mark_as_advanced( + CUDA_CUDARTEMU_LIBRARY + ) +endif() +# If we are using emulation mode and we found the cudartemu library then use +# that one instead of cudart. +if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +else() + set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +endif() if(APPLE) # We need to add the path to cudart to the linker using rpath, since the # library name for the cuda libraries is prepended with @rpath. - get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH) + if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH) + else() + get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH) + endif() if(_cuda_path_to_cudart) list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}") endif() diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index f2de4c9..654879e 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -360,34 +360,6 @@ SET( QT_DEFINITIONS "") SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE) -# macro for asking qmake to process pro files -MACRO(QT_QUERY_QMAKE outvar invar) - IF(QT_QMAKE_EXECUTABLE) - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro - "message(CMAKE_MESSAGE<$$${invar}>)") - - # Invoke qmake with the tmp.pro program to get the desired - # information. Use the same variable for both stdout and stderr - # to make sure we get the output on all platforms. - EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE} - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake - OUTPUT_VARIABLE _qmake_query_output - RESULT_VARIABLE _qmake_result - ERROR_VARIABLE _qmake_query_output ) - - FILE(REMOVE_RECURSE - "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake") - - IF(_qmake_result) - MESSAGE(WARNING " querying qmake for ${invar}. qmake reported:\n${_qmake_query_output}") - ELSE(_qmake_result) - STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}") - ENDIF(_qmake_result) - - ENDIF(QT_QMAKE_EXECUTABLE) -ENDMACRO(QT_QUERY_QMAKE) - GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME) # check for qmake # Debian uses qmake-qt4 diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 459129b..2a74304 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -5,6 +5,8 @@ # CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads? # CMAKE_USE_PTHREADS_INIT - are we using pthreads # CMAKE_HP_PTHREADS_INIT - are we using hp pthreads +# For systems with multiple thread libraries, caller can set +# CMAKE_THREAD_PREFER_PTHREADS #============================================================================= # Copyright 2002-2009 Kitware, Inc. @@ -24,11 +26,11 @@ INCLUDE (CheckLibraryExists) SET(Threads_FOUND FALSE) # Do we have sproc? -IF(CMAKE_SYSTEM MATCHES IRIX) +IF(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD) CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H) ENDIF() -IF(CMAKE_HAVE_SPROC_H) +IF(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD) # We have sproc SET(CMAKE_USE_SPROC_INIT 1) ELSE() diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake index 652bed4..076410a 100644 --- a/Modules/Platform/OSF1.cmake +++ b/Modules/Platform/OSF1.cmake @@ -25,6 +25,7 @@ IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") +SET(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/... IF(CMAKE_COMPILER_IS_GNUCXX) # include the gcc flags diff --git a/Modules/Platform/Windows-GNU-Fortran.cmake b/Modules/Platform/Windows-GNU-Fortran.cmake index c66feed..8273a19 100644 --- a/Modules/Platform/Windows-GNU-Fortran.cmake +++ b/Modules/Platform/Windows-GNU-Fortran.cmake @@ -1,2 +1,3 @@ include(Platform/Windows-GNU) __windows_compiler_gnu(Fortran) +set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0) diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 6d84940..af03841 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -68,6 +68,8 @@ macro(__windows_compiler_gnu lang) endif() set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) + set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@") # Binary link rules. set(CMAKE_${lang}_CREATE_SHARED_MODULE diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake index ccbc828..1d77c7a 100644 --- a/Modules/Qt4ConfigDependentSettings.cmake +++ b/Modules/Qt4ConfigDependentSettings.cmake @@ -301,8 +301,11 @@ IF(Q_WS_X11) # X11 libraries Qt always depends on SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB}) - QT_QUERY_QMAKE(QT_LIBS_THREAD "QMAKE_LIBS_THREAD") - SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_LIBS_THREAD}) + set(CMAKE_THREAD_PREFER_PTHREADS 1) + find_package(Threads) + if(CMAKE_USE_PTHREADS_INIT) + SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT}) + endif(CMAKE_USE_PTHREADS_INIT) SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS}) |