diff options
author | David Cole <david.cole@kitware.com> | 2011-01-13 21:43:56 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-01-13 21:52:51 (GMT) |
commit | fa4a3b04d0904a2e93242c0c3dd02a357d337f77 (patch) | |
tree | aba1fff8354a3edad44a1991524f46c1836ce9c1 /Modules/InstallRequiredSystemLibraries.cmake | |
parent | fc144924a0782b37c320378ac76482f0534c7530 (diff) | |
download | CMake-fa4a3b04d0904a2e93242c0c3dd02a357d337f77.zip CMake-fa4a3b04d0904a2e93242c0c3dd02a357d337f77.tar.gz CMake-fa4a3b04d0904a2e93242c0c3dd02a357d337f77.tar.bz2 |
Add CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS variable
The parent commit added a warning message whenever a required file
does not exist.
As it turns out, the "required" files never exist when built with
Visual Studio Express editions. Add a variable to suppress these
warning messages because only packagers or naive includers of
this file will care to see such warning messages.
We want to warn about this condition by default so that people who
are using InstallRequiredSystemLibraries without understanding it
fully will have a chance of understanding why it's not working in
the event of missing required files.
But we also want to give projects the ability to suppress this warning
(by "project's choice default") so that they can encourage users who
are restricted to using an Express edition to build their project.
Packagers should explicitly use...
-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=OFF
...when building releases. That way, their release build process will warn
them about any missing files, but only if their project CMakeLists files
use a construct similar to CMake's:
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
ENDIF()
Diffstat (limited to 'Modules/InstallRequiredSystemLibraries.cmake')
-rw-r--r-- | Modules/InstallRequiredSystemLibraries.cmake | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 63b3d5e..2dfe8b1 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -16,6 +16,12 @@ # libraries are installed as well as the CRT run time libraries. # If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are # installed to that directory rather than the default. +# If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is NOT set, then this file +# warns about required files that do not exist. You can set this variable to +# ON before including this file to avoid the warning. For example, the Visual +# Studio Express editions do not include the redistributable files, so if you +# include this file on a machine with only VS Express installed, you'll get +# the warning. #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -304,9 +310,14 @@ IF(MSVC) SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) ELSE(EXISTS ${lib}) - MESSAGE(WARNING "system runtime library file does not exist: '${lib}'") - # This warning indicates an incomplete Visual Studio installation - # or a bug somewhere above here in this file + IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + MESSAGE(WARNING "system runtime library file does not exist: '${lib}'") + # This warning indicates an incomplete Visual Studio installation + # or a bug somewhere above here in this file. + # If you would like to avoid this warning, fix the real problem, or + # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including + # this file. + ENDIF() ENDIF(EXISTS ${lib}) ENDFOREACH(lib) ENDIF(MSVC) |