summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-22 14:50:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-22 14:50:49 (GMT)
commit15c573df4115ab1be01da118c91b4d942e9007d6 (patch)
tree1b053b88a918326e5f6ebf2c91e132474b0fd772 /Modules
parent39695f6fb316de2289636de483f52d53096ac41d (diff)
parent3ec82b713e51711df0c70f539aea62fc16dd3060 (diff)
downloadCMake-15c573df4115ab1be01da118c91b4d942e9007d6.zip
CMake-15c573df4115ab1be01da118c91b4d942e9007d6.tar.gz
CMake-15c573df4115ab1be01da118c91b4d942e9007d6.tar.bz2
Merge topic 'mark_as_advanced-without-cache'
3ec82b713e cmMarkAsAdvancedCommand: ignore variables which don't exist in the cache 701a5c60e0 cmake: avoid marking local or unused variables as advanced af158149e7 FindOpenSSL: do not mark a local variable as advanced 74f659f1f2 FindCurses: only mark CURSES_EXTRA_LIBRARY when it is used 7e2ae4e96d FindOpenGL: only mark declared cache variables as advanced 7cc02a0c29 FindLua: only mark LUA_MATH_LIBRARY as advanced if required 85cd26b8a6 FindBoost: only mark Boost_DIR as advanced if defined 338c7916ba CTest: avoid marking undeclared cache variables as advanced ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4150
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPack.cmake71
-rw-r--r--Modules/CTest.cmake4
-rw-r--r--Modules/FindBoost.cmake5
-rw-r--r--Modules/FindCurses.cmake5
-rw-r--r--Modules/FindLua.cmake3
-rw-r--r--Modules/FindOpenGL.cmake43
-rw-r--r--Modules/FindOpenSSL.cmake2
7 files changed, 82 insertions, 51 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index e4f75d5..3b46ca5 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -565,8 +565,16 @@ if(NOT CPACK_GENERATOR)
option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" OFF)
option(CPACK_BINARY_PRODUCTBUILD "Enable to build productbuild packages" OFF)
+ mark_as_advanced(
+ CPACK_BINARY_BUNDLE
+ CPACK_BINARY_DRAGNDROP
+ CPACK_BINARY_OSXX11
+ CPACK_BINARY_PACKAGEMAKER
+ CPACK_BINARY_PRODUCTBUILD
+ )
else()
option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
+ mark_as_advanced(CPACK_BINARY_TZ)
endif()
option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
option(CPACK_BINARY_FREEBSD "Enable to build FreeBSD packages" OFF)
@@ -576,6 +584,16 @@ if(NOT CPACK_GENERATOR)
option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
option(CPACK_BINARY_TXZ "Enable to build TXZ packages" OFF)
+ mark_as_advanced(
+ CPACK_BINARY_DEB
+ CPACK_BINARY_FREEBSD
+ CPACK_BINARY_NSIS
+ CPACK_BINARY_RPM
+ CPACK_BINARY_STGZ
+ CPACK_BINARY_TBZ2
+ CPACK_BINARY_TGZ
+ CPACK_BINARY_TXZ
+ )
endif()
else()
option(CPACK_BINARY_7Z "Enable to build 7-Zip packages" OFF)
@@ -583,8 +601,16 @@ if(NOT CPACK_GENERATOR)
option(CPACK_BINARY_NUGET "Enable to build NuGet packages" OFF)
option(CPACK_BINARY_WIX "Enable to build WiX packages" OFF)
option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
+ mark_as_advanced(
+ CPACK_BINARY_7Z
+ CPACK_BINARY_NSIS
+ CPACK_BINARY_NUGET
+ CPACK_BINARY_WIX
+ CPACK_BINARY_ZIP
+ )
endif()
option(CPACK_BINARY_IFW "Enable to build IFW packages" OFF)
+ mark_as_advanced(CPACK_BINARY_IFW)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_7Z 7Z)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
@@ -614,6 +640,7 @@ if(NOT CPACK_SOURCE_GENERATOR)
if(UNIX)
if(CYGWIN)
option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
+ mark_as_advanced(CPACK_SOURCE_CYGWIN)
else()
option(CPACK_SOURCE_RPM "Enable to build RPM source packages" OFF)
option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
@@ -621,10 +648,22 @@ if(NOT CPACK_SOURCE_GENERATOR)
option(CPACK_SOURCE_TXZ "Enable to build TXZ source packages" ON)
option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON)
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
+ mark_as_advanced(
+ CPACK_SOURCE_RPM
+ CPACK_SOURCE_TBZ2
+ CPACK_SOURCE_TGZ
+ CPACK_SOURCE_TXZ
+ CPACK_SOURCE_TZ
+ CPACK_SOURCE_ZIP
+ )
endif()
else()
option(CPACK_SOURCE_7Z "Enable to build 7-Zip source packages" ON)
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
+ mark_as_advanced(
+ CPACK_SOURCE_7Z
+ CPACK_SOURCE_ZIP
+ )
endif()
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_7Z 7Z)
@@ -637,38 +676,6 @@ if(NOT CPACK_SOURCE_GENERATOR)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP)
endif()
-# mark the above options as advanced
-mark_as_advanced(
- CPACK_BINARY_7Z
- CPACK_BINARY_BUNDLE
- CPACK_BINARY_CYGWIN
- CPACK_BINARY_DEB
- CPACK_BINARY_DRAGNDROP
- CPACK_BINARY_FREEBSD
- CPACK_BINARY_IFW
- CPACK_BINARY_NSIS
- CPACK_BINARY_NUGET
- CPACK_BINARY_OSXX11
- CPACK_BINARY_PACKAGEMAKER
- CPACK_BINARY_PRODUCTBUILD
- CPACK_BINARY_RPM
- CPACK_BINARY_STGZ
- CPACK_BINARY_TBZ2
- CPACK_BINARY_TGZ
- CPACK_BINARY_TXZ
- CPACK_BINARY_TZ
- CPACK_BINARY_WIX
- CPACK_BINARY_ZIP
- CPACK_SOURCE_7Z
- CPACK_SOURCE_CYGWIN
- CPACK_SOURCE_RPM
- CPACK_SOURCE_TBZ2
- CPACK_SOURCE_TGZ
- CPACK_SOURCE_TXZ
- CPACK_SOURCE_TZ
- CPACK_SOURCE_ZIP
- )
-
# Set some other variables
_cpack_set_default(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 1a51bc8..8109108 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -243,7 +243,6 @@ if(BUILD_TESTING)
mark_as_advanced(
BZRCOMMAND
- BZR_UPDATE_OPTIONS
COVERAGE_COMMAND
COVERAGE_EXTRA_FLAGS
CTEST_SUBMIT_RETRY_DELAY
@@ -257,13 +256,10 @@ if(BUILD_TESTING)
MAKECOMMAND
MEMORYCHECK_COMMAND
MEMORYCHECK_SUPPRESSIONS_FILE
- PURIFYCOMMAND
- SCPCOMMAND
SLURM_SBATCH_COMMAND
SLURM_SRUN_COMMAND
SITE
SVNCOMMAND
- SVN_UPDATE_OPTIONS
)
if(NOT RUN_FROM_DART)
set(RUN_FROM_CTEST_OR_DART 1)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 0e84fab..deac9ef 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -248,6 +248,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# Save project's policies
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var)
function(_boost_get_existing_target component target_var)
set(names "${component}")
@@ -441,7 +442,9 @@ if (NOT Boost_NO_BOOST_CMAKE)
# Note that args are passed in the Boost_FIND_xxxxx variables, so there is no
# need to delegate them to this find_package call.
find_package(Boost QUIET NO_MODULE)
- mark_as_advanced(Boost_DIR)
+ if (DEFINED Boost_DIR)
+ mark_as_advanced(Boost_DIR)
+ endif ()
# If we found a boost cmake package, then we're done. Print out what we found.
# Otherwise let the rest of the module try to find it.
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index e3e7273..ba56078 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -159,6 +159,10 @@ if(CURSES_USE_NCURSES)
if(NOT CURSES_NCURSES_HAS_CBREAK)
find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" HINTS "${_cursesLibDir}")
find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" )
+
+ mark_as_advanced(
+ CURSES_EXTRA_LIBRARY
+ )
endif()
else()
get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
@@ -262,6 +266,5 @@ mark_as_advanced(
CURSES_INCLUDE_PATH
CURSES_CURSES_LIBRARY
CURSES_NCURSES_LIBRARY
- CURSES_EXTRA_LIBRARY
CURSES_FORM_LIBRARY
)
diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index caf9d69..0b0c970 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -211,6 +211,7 @@ if (LUA_LIBRARY)
# include the math library for Unix
if (UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
+ mark_as_advanced(LUA_MATH_LIBRARY)
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
# include dl library for statically-linked Lua library
@@ -232,6 +233,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
-mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)
+mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY)
cmake_policy(POP)
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 23bb001d..74392da 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -130,6 +130,8 @@ foreach(component ${OpenGL_FIND_COMPONENTS})
set(OPENGL_USE_${_COMPONENT} 1)
endforeach()
+set(_OpenGL_CACHE_VARS)
+
if (CYGWIN)
find_path(OPENGL_INCLUDE_DIR GL/gl.h )
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
@@ -137,6 +139,11 @@ if (CYGWIN)
find_library(OPENGL_gl_LIBRARY opengl32 )
find_library(OPENGL_glu_LIBRARY glu32 )
+ list(APPEND _OpenGL_CACHE_VARS
+ OPENGL_INCLUDE_DIR
+ OPENGL_gl_LIBRARY
+ OPENGL_glu_LIBRARY
+ )
elseif (WIN32)
if(BORLAND)
@@ -147,6 +154,10 @@ elseif (WIN32)
set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
endif()
+ list(APPEND _OpenGL_CACHE_VARS
+ OPENGL_gl_LIBRARY
+ OPENGL_glu_LIBRARY
+ )
elseif (APPLE)
# The OpenGL.framework provides both gl and glu
find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
@@ -155,6 +166,11 @@ elseif (APPLE)
find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
+ list(APPEND _OpenGL_CACHE_VARS
+ OPENGL_INCLUDE_DIR
+ OPENGL_gl_LIBRARY
+ OPENGL_glu_LIBRARY
+ )
else()
if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
# Handle HP-UX cases where we only want to find OpenGL in either hpux64
@@ -194,6 +210,12 @@ else()
/usr/openwin/share/include
/opt/graphics/OpenGL/include
)
+ list(APPEND _OpenGL_CACHE_VARS
+ OPENGL_INCLUDE_DIR
+ OPENGL_GLX_INCLUDE_DIR
+ OPENGL_EGL_INCLUDE_DIR
+ OPENGL_xmesa_INCLUDE_DIR
+ )
# Search for the GLVND libraries. We do this regardless of COMPONENTS; we'll
# take into account the COMPONENTS logic later.
@@ -222,6 +244,13 @@ else()
/usr/shlib
)
+ list(APPEND _OpenGL_CACHE_VARS
+ OPENGL_opengl_LIBRARY
+ OPENGL_glx_LIBRARY
+ OPENGL_egl_LIBRARY
+ OPENGL_glu_LIBRARY
+ )
+
set(_OpenGL_GL_POLICY_WARN 0)
if(NOT DEFINED OpenGL_GL_PREFERENCE)
set(OpenGL_GL_PREFERENCE "")
@@ -268,6 +297,7 @@ else()
${_OPENGL_LIB_PATH}
PATH_SUFFIXES libglvnd
)
+ list(APPEND _OpenGL_CACHE_VARS OPENGL_gl_LIBRARY)
endif()
if(_OpenGL_GL_POLICY_WARN AND OPENGL_gl_LIBRARY AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
@@ -532,14 +562,5 @@ set(OPENGL_LIBRARY ${OPENGL_LIBRARIES})
# This deprecated setting is for backward compatibility with CMake1.4
set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
-mark_as_advanced(
- OPENGL_INCLUDE_DIR
- OPENGL_xmesa_INCLUDE_DIR
- OPENGL_egl_LIBRARY
- OPENGL_glu_LIBRARY
- OPENGL_glx_LIBRARY
- OPENGL_gl_LIBRARY
- OPENGL_opengl_LIBRARY
- OPENGL_EGL_INCLUDE_DIR
- OPENGL_GLX_INCLUDE_DIR
-)
+mark_as_advanced(${_OpenGL_CACHE_VARS})
+unset(_OpenGL_CACHE_VARS)
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 043fc6c..af713d6 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -458,7 +458,7 @@ find_package_handle_standard_args(OpenSSL
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
)
-mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
+mark_as_advanced(OPENSSL_INCLUDE_DIR)
if(OPENSSL_FOUND)
if(NOT TARGET OpenSSL::Crypto AND