[Cmake-commits] [cmake-commits] hoffman committed CMakeLists.txt 1.17 1.17.2.1 ModuleNoticesTest.cmake.in NONE 1.2.2.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Oct 1 17:21:25 EDT 2009
Update of /cvsroot/CMake/CMake/Tests/CMakeTests
In directory public:/mounts/ram/cvs-serv11203/Tests/CMakeTests
Modified Files:
Tag: CMake-2-8
CMakeLists.txt
Added Files:
Tag: CMake-2-8
ModuleNoticesTest.cmake.in
Log Message:
Merge in changes to CMake-2-8 RC 2
--- NEW FILE: ModuleNoticesTest.cmake.in ---
# Regex to match copyright/license notices.
# We require the Kitware copyright on the first line, but this can
# match any additional copyright holder notices.
set(notice_regex "
#=============================================================================
# Copyright (20[0-9][0-9]-)?20[0-9][0-9] Kitware[^\n]+(
# Copyright (20[0-9][0-9]-)?20[0-9][0-9] [^\n]+)*
#
# Distributed under the OSI-approved BSD License \\(the \"License\"\\);
# see accompanying file Copyright\\.txt for details\\.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\\.
# See the License for more information\\.
#=============================================================================
# \\(To distributed this file outside of CMake, substitute the full
# License text for the above reference.\\)
")
string(REPLACE "\n" "\r?\n" notice_regex "${notice_regex}")
string(REPLACE "\r\r" "\r" notice_regex "${notice_regex}")
# Modules that do not require our notice.
set(notice_exceptions
FindCUDA.cmake # MIT License, distributed here from upstream project
)
# Load the list of modules to check.
set(dir "@CMake_SOURCE_DIR@/Modules")
file(GLOB all_modules RELATIVE "${dir}" "${dir}/*.cmake")
list(REMOVE_ITEM all_modules ${notice_exceptions})
# Check each module.
set(notice_missing)
foreach(module ${all_modules})
message(STATUS "module: ${module}")
file(READ "${dir}/${module}" module_content)
if(NOT "${module_content}" MATCHES "${notice_regex}")
set(notice_missing "${notice_missing} ${module}\n")
endif()
endforeach()
# Report the list of bad modules.
if(notice_missing)
message(FATAL_ERROR
"Some modules do not have a valid copyright notice:\n${notice_missing}")
endif()
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CMakeTests/CMakeLists.txt,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C 2 -d -r1.17 -r1.17.2.1
*** CMakeLists.txt 16 Sep 2009 19:09:58 -0000 1.17
--- CMakeLists.txt 1 Oct 2009 21:21:22 -0000 1.17.2.1
***************
*** 22,25 ****
--- 22,26 ----
AddCMakeTest(SeparateArguments "")
AddCMakeTest(ImplicitLinkInfo "")
+ AddCMakeTest(ModuleNotices "")
SET(GetPrerequisites_PreArgs
More information about the Cmake-commits
mailing list