summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-11-11 18:34:21 (GMT)
committerBrad King <brad.king@kitware.com>2009-11-11 18:34:21 (GMT)
commitd2715cae493a16e9187d8e43f36fab90e3239184 (patch)
tree3bcf711fb6ad7368171e5d33ad75de1fe0ef98a7 /Modules
parent29ebc97c38a291988e1e16edcbb000bfb879825b (diff)
downloadCMake-d2715cae493a16e9187d8e43f36fab90e3239184.zip
CMake-d2715cae493a16e9187d8e43f36fab90e3239184.tar.gz
CMake-d2715cae493a16e9187d8e43f36fab90e3239184.tar.bz2
CMake 2.8.0-rc7
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake21
-rw-r--r--Modules/CPackRPM.cmake13
-rw-r--r--Modules/FindCUDA.cmake50
-rw-r--r--Modules/FindQt4.cmake2
4 files changed, 64 insertions, 22 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index b8a681f..1761d28 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -17,7 +17,7 @@
# code.
function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
- set(implicit_libs "")
+ set(implicit_libs_tmp "")
set(implicit_dirs_tmp)
set(log "")
@@ -53,11 +53,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
elseif("${arg}" MATCHES "^-l[^:]")
# Unix library.
string(REGEX REPLACE "^-l" "" lib "${arg}")
- list(APPEND implicit_libs ${lib})
+ list(APPEND implicit_libs_tmp ${lib})
set(log "${log} arg [${arg}] ==> lib [${lib}]\n")
elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
# Unix library full path.
- list(APPEND implicit_libs ${arg})
+ list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
elseif("${arg}" MATCHES "^-Y(P,)?")
# Sun search path.
@@ -67,11 +67,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
set(log "${log} arg [${arg}] ==> dirs [${dirs}]\n")
elseif("${arg}" MATCHES "^-l:")
# HP named library.
- list(APPEND implicit_libs ${arg})
+ list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
elseif("${arg}" MATCHES "^-z(all|default|weak)extract")
# Link editor option.
- list(APPEND implicit_libs ${arg})
+ list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> opt [${arg}]\n")
else()
set(log "${log} arg [${arg}] ==> ignore\n")
@@ -90,6 +90,17 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
endif()
endforeach()
+ # Cleanup list of libraries and flags.
+ # We remove items that are not language-specific.
+ set(implicit_libs "")
+ foreach(lib IN LISTS implicit_libs_tmp)
+ if("${lib}" MATCHES "^(crt.*\\.o|gcc.*|System.*)$")
+ set(log "${log} remove lib [${lib}]\n")
+ else()
+ list(APPEND implicit_libs "${lib}")
+ endif()
+ endforeach()
+
# Cleanup list of directories.
set(implicit_dirs "")
foreach(d IN LISTS implicit_dirs_tmp)
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index fe30058..5167fa7 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -277,8 +277,13 @@ SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
# neither escaping (as below) nor putting quotes around the path seem to help
#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
-
+# Use files tree to construct files command (spec file)
+EXECUTE_PROCESS(COMMAND find -type f
+ COMMAND sed {s/\\.//}
+ WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
+ OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+
SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec")
IF(CPACK_RPM_USER_BINARY_SPECFILE)
# User may have specified SPECFILE just use it
@@ -326,6 +331,8 @@ ${CPACK_RPM_PACKAGE_DESCRIPTION}
# generated by CMake RPM generator
# we skip the _prepn _build and _install
# steps because CPack does that for us
+# WE MUST NOT DO ANYTHING in those steps because they
+# may fail for non-privileged user
#p prep
#p build
@@ -338,9 +345,11 @@ ${CPACK_RPM_PACKAGE_DESCRIPTION}
%defattr(-,root,root,-)
#p dir %{prefix}
#p {prefix}/*
-/*
+${CPACK_RPM_INSTALL_FILES}
%changelog
+* Sat Oct 03 2009 Kami <cmoidavid@gmail.com>
+ Update to handle more precisely the files section
* Mon Oct 03 2008 Erk <eric.noulard@gmail.com>
Update generator to handle optional dependencies using Requires
Update DEBUG output typos.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 6c51298..7c28498 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -161,10 +161,6 @@
# cuda file to Visual Studio it knows that this file produces an object file
# and will link in the resulting object file automatically.
#
-# This script also looks at optional arguments STATIC, SHARED, or MODULE to
-# override the behavior specified by the value of the CMake variable
-# BUILD_SHARED_LIBS. See BUILD_SHARED_LIBS below for more details.
-#
# This script will also generate a separate cmake script that is used at
# build time to invoke nvcc. This is for serveral reasons.
#
@@ -181,13 +177,13 @@
# make the build rule dependent on the file, the output files will be
# regenerated when the options change.
#
-# In addition, on some systems special flags are added for building objects
-# intended for shared libraries. FindCUDA make use of the CMake variable
-# BUILD_SHARED_LIBS and the usual STATIC, SHARED, and MODULE arguments to
-# determine if these flags should be used. Please set BUILD_SHARED_LIBS or
-# pass in STATIC, SHARED, or MODULE according to how the objects are to be
-# used before calling CUDA_ADD_LIBRARY. A preprocessor macro,
-# <target_name>_EXPORTS is defined when BUILD_SHARED_LIBS is defined.
+# This script also looks at optional arguments STATIC, SHARED, or MODULE to
+# determine when to target the object compilation for a shared library.
+# BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
+# CUDA_ADD_LIBRARY. On some systems special flags are added for building
+# objects intended for shared libraries. A preprocessor macro,
+# <target_name>_EXPORTS is defined when a shared library compilation is
+# detected.
#
# Flags passed into add_definitions with -D or /D are passed along to nvcc.
#
@@ -755,6 +751,27 @@ function(CUDA_ADD_CUDA_INCLUDE_ONCE)
endif()
endfunction()
+function(CUDA_BUILD_SHARED_LIBRARY shared_flag)
+ set(cmake_args ${ARGN})
+ # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then
+ # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS.
+ list(FIND cmake_args SHARED _cuda_found_SHARED)
+ list(FIND cmake_args MODULE _cuda_found_MODULE)
+ list(FIND cmake_args STATIC _cuda_found_STATIC)
+ if( _cuda_found_SHARED GREATER -1 OR
+ _cuda_found_MODULE GREATER -1 OR
+ _cuda_found_STATIC GREATER -1)
+ set(_cuda_build_shared_libs)
+ else()
+ if (BUILD_SHARED_LIBS)
+ set(_cuda_build_shared_libs SHARED)
+ else()
+ set(_cuda_build_shared_libs STATIC)
+ endif()
+ endif()
+ set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE)
+endfunction()
+
##############################################################################
# This helper macro populates the following variables and setups up custom
# commands and targets to invoke the nvcc compiler to generate C or PTX source
@@ -847,8 +864,9 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${ARGN})
CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options})
- # Figure out if we are building a shared library. Default the value of BUILD_SHARED_LIBS.
- set(_cuda_build_shared_libs ${BUILD_SHARED_LIBS})
+ # Figure out if we are building a shared library. BUILD_SHARED_LIBS is
+ # respected in CUDA_ADD_LIBRARY.
+ set(_cuda_build_shared_libs FALSE)
# SHARED, MODULE
list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED)
list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE)
@@ -866,6 +884,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# If we are setting up code for a shared library, then we need to add extra flags for
# compiling objects for shared libraries.
set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS})
+ else()
+ set(CUDA_HOST_SHARED_FLAGS)
endif()
# Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We
# always need to set the SHARED_FLAGS, though.
@@ -1083,8 +1103,10 @@ macro(CUDA_ADD_LIBRARY cuda_target)
# Separate the sources from the options
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
+ CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN})
# Create custom commands and targets for each file.
- CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} ${_cmake_options}
+ CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources}
+ ${_cmake_options} ${_cuda_shared_flag}
OPTIONS ${_options} )
# Add the library.
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 93d2d11..411e390 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -643,7 +643,7 @@ IF (QT4_QMAKE_FOUND)
)
# Set QT_QTASSISTANT_INCLUDE_DIR
- FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QAssistantClient
+ FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
PATHS
${QT_HEADERS_DIR}/QtAssistant
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers