summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/FIND_XXX.txt9
-rw-r--r--Help/release/dev/required_find_commands.rst6
-rw-r--r--Modules/Compiler/TI-C.cmake8
-rw-r--r--Modules/FindArmadillo.cmake83
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/Checks/cm_cxx_features.cmake2
-rw-r--r--Source/cmAlgorithms.h4
-rw-r--r--Source/cmFindBase.cxx8
-rw-r--r--Source/cmFindBase.h10
-rw-r--r--Source/cmFindLibraryCommand.cxx8
-rw-r--r--Source/cmFindPathCommand.cxx8
-rw-r--r--Source/cmFindProgramCommand.cxx8
-rw-r--r--Tests/RunCMake/find_file/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_file/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_file/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_file/Required.cmake12
-rw-r--r--Tests/RunCMake/find_file/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_library/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_library/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_library/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_library/Required.cmake14
-rw-r--r--Tests/RunCMake/find_library/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_path/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_path/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_path/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_path/Required.cmake12
-rw-r--r--Tests/RunCMake/find_path/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_program/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_program/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_program/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/Required.cmake12
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake1
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt19
33 files changed, 217 insertions, 36 deletions
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index 42bf52b..cebe051 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -15,6 +15,7 @@ The general signature is:
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
+ [REQUIRED]
[NO_DEFAULT_PATH]
[NO_PACKAGE_ROOT_PATH]
[NO_CMAKE_PATH]
@@ -31,8 +32,9 @@ A cache entry named by ``<VAR>`` is created to store the result
of this command.
If the |SEARCH_XXX| is found the result is stored in the variable
and the search will not be repeated unless the variable is cleared.
-If nothing is found, the result will be
-``<VAR>-NOTFOUND``, and the search will be attempted again the
+If nothing is found, the result will be ``<VAR>-NOTFOUND``.
+The ``REQUIRED`` option stops processing with an error message if nothing
+is found, otherwise the search will be attempted again the
next time |FIND_XXX| is invoked with the same variable.
Options include:
@@ -57,6 +59,9 @@ Options include:
``DOC``
Specify the documentation string for the ``<VAR>`` cache entry.
+``REQUIRED``
+ Stop processing with an error message if nothing is found.
+
If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
added to the search.
If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
diff --git a/Help/release/dev/required_find_commands.rst b/Help/release/dev/required_find_commands.rst
new file mode 100644
index 0000000..cc2bf02
--- /dev/null
+++ b/Help/release/dev/required_find_commands.rst
@@ -0,0 +1,6 @@
+required_find_commands
+----------------------
+
+* The :command:`find_program`, :command:`find_library`, :command:`find_path`
+ and :command:`find_file` commands gained a new ``REQUIRED`` option that will
+ stop processing with an error message if nothing is found.
diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake
index 1c0f4bc..b060ee9 100644
--- a/Modules/Compiler/TI-C.cmake
+++ b/Modules/Compiler/TI-C.cmake
@@ -14,5 +14,9 @@ set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> --compile_only --skip_ass
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> --preproc_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> --compile_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
-set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -r <TARGET> <OBJECTS>")
-set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
+set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
+set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+set(CMAKE_ASM_RESPONSE_FILE_FLAG "--cmd_file=")
+set(CMAKE_C_RESPONSE_FILE_FLAG "--cmd_file=")
+set(CMAKE_C_RESPONSE_FILE_LINK_FLAG " ")
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index c4e55ce..243b9e0 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -6,7 +6,7 @@ FindArmadillo
-------------
Find the Armadillo C++ library.
-Armadillo is library for linear algebra & scientific computing.
+Armadillo is a library for linear algebra & scientific computing.
Using Armadillo:
@@ -31,19 +31,13 @@ This module sets the following variables:
ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
#]=======================================================================]
-# UNIX paths are standard, no need to write.
-find_library(ARMADILLO_LIBRARY
- NAMES armadillo
- PATHS "$ENV{ProgramFiles}/Armadillo/lib" "$ENV{ProgramFiles}/Armadillo/lib64" "$ENV{ProgramFiles}/Armadillo"
- )
find_path(ARMADILLO_INCLUDE_DIR
NAMES armadillo
PATHS "$ENV{ProgramFiles}/Armadillo/include"
)
-
+mark_as_advanced(ARMADILLO_INCLUDE_DIR)
if(ARMADILLO_INCLUDE_DIR)
-
# ------------------------------------------------------------------------
# Extract version information from <armadillo>
# ------------------------------------------------------------------------
@@ -59,32 +53,79 @@ if(ARMADILLO_INCLUDE_DIR)
if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
# Read and parse armdillo version header file for version number
- file(STRINGS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS REGEX "#define ARMA_VERSION_[A-Z]+ ")
- string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
- string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
- string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
+ file(STRINGS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _ARMA_HEADER_CONTENTS REGEX "#define ARMA_VERSION_[A-Z]+ ")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_ARMA_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_ARMA_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_ARMA_HEADER_CONTENTS}")
# WARNING: The number of spaces before the version name is not one.
- string(REGEX REPLACE ".*#define ARMA_VERSION_NAME +\"([0-9a-zA-Z _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_ARMA_HEADER_CONTENTS}")
- unset(_armadillo_HEADER_CONTENTS)
endif()
set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
endif ()
+if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp")
+ file(STRINGS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp" _ARMA_CONFIG_CONTENTS REGEX "^#define ARMA_USE_[A-Z]+")
+ string(REGEX MATCH "ARMA_USE_WRAPPER" _ARMA_USE_WRAPPER "${_ARMA_CONFIG_CONTENTS}")
+ string(REGEX MATCH "ARMA_USE_LAPACK" _ARMA_USE_LAPACK "${_ARMA_CONFIG_CONTENTS}")
+ string(REGEX MATCH "ARMA_USE_BLAS" _ARMA_USE_BLAS "${_ARMA_CONFIG_CONTENTS}")
+ string(REGEX MATCH "ARMA_USE_ARPACK" _ARMA_USE_ARPACK "${_ARMA_CONFIG_CONTENTS}")
+ string(REGEX MATCH "ARMA_USE_HDF5" _ARMA_USE_HDF5 "${_ARMA_CONFIG_CONTENTS}")
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+# If _ARMA_USE_WRAPPER is set, then we just link to armadillo, but if it's not then we need support libraries instead
+set(_ARMA_SUPPORT_LIBRARIES)
+
+if(_ARMA_USE_WRAPPER)
+ # Link to the armadillo wrapper library.
+ find_library(ARMADILLO_LIBRARY
+ NAMES armadillo
+ PATHS
+ "$ENV{ProgramFiles}/Armadillo/lib"
+ "$ENV{ProgramFiles}/Armadillo/lib64"
+ "$ENV{ProgramFiles}/Armadillo"
+ )
+ mark_as_advanced(ARMADILLO_LIBRARY)
+ set(_ARMA_REQUIRED_VARS ARMADILLO_LIBRARY)
+else()
+ # Link directly to individual components.
+ set(ARMADILLO_LIBRARY "")
+ foreach(pkg
+ LAPACK
+ BLAS
+ ARPACK
+ HDF5
+ )
+ if(_ARMA_USE_${pkg})
+ find_package(${pkg} QUIET)
+ list(APPEND _ARMA_REQUIRED_VARS "${pkg}_FOUND")
+ if(${pkg}_FOUND)
+ list(APPEND _ARMA_SUPPORT_LIBRARIES ${${pkg}_LIBRARIES})
+ endif()
+ endif()
+ endforeach()
+endif()
+
find_package_handle_standard_args(Armadillo
- REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR
+ REQUIRED_VARS ARMADILLO_INCLUDE_DIR ${_ARMA_REQUIRED_VARS}
VERSION_VAR ARMADILLO_VERSION_STRING)
-# version_var fails with cmake < 2.8.4.
if (ARMADILLO_FOUND)
set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
- set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY})
+ set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY} ${_ARMA_SUPPORT_LIBRARIES})
endif ()
-# Hide internal variables
-mark_as_advanced(
- ARMADILLO_INCLUDE_DIR
- ARMADILLO_LIBRARY)
+# Clean up internal variables
+unset(_ARMA_REQUIRED_VARS)
+unset(_ARMA_SUPPORT_LIBRARIES)
+unset(_ARMA_USE_WRAPPER)
+unset(_ARMA_USE_LAPACK)
+unset(_ARMA_USE_BLAS)
+unset(_ARMA_USE_ARPACK)
+unset(_ARMA_USE_HDF5)
+unset(_ARMA_CONFIG_CONTENTS)
+unset(_ARMA_HEADER_CONTENTS)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 7ef61f9..3fce9e5 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 17)
-set(CMake_VERSION_PATCH 20200308)
+set(CMake_VERSION_PATCH 20200310)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 3b00dfb..c16286c 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -32,6 +32,8 @@ function(cm_check_cxx_feature name)
string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}")
# Filter out ld warnings.
string(REGEX REPLACE "[^\n]*ld: warning: [^\n]*" "" check_output "${check_output}")
+ # Filter out CUDA installation warnings.
+ string(REGEX REPLACE "[^\n]*clang: warning: Unknown CUDA version[^\n]*" "" check_output "${check_output}")
# If using the feature causes warnings, treat it as broken/unavailable.
if(check_output MATCHES "(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 19da2a0..c0ac551 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -139,7 +139,7 @@ template <typename ForwardIterator>
ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last)
{
using Value = typename std::iterator_traits<ForwardIterator>::value_type;
- using Hash = struct
+ struct Hash
{
std::size_t operator()(ForwardIterator it) const
{
@@ -147,7 +147,7 @@ ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last)
}
};
- using Equal = struct
+ struct Equal
{
bool operator()(ForwardIterator it1, ForwardIterator it2) const
{
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index bec99bb..fb09b33 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -22,10 +22,6 @@ class cmExecutionStatus;
cmFindBase::cmFindBase(cmExecutionStatus& status)
: cmFindCommon(status)
{
- this->AlreadyInCache = false;
- this->AlreadyInCacheWithoutMetaInfo = false;
- this->NamesPerDir = false;
- this->NamesPerDirAllowed = false;
}
bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
@@ -115,6 +111,10 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
} else if (args[j] == "NO_SYSTEM_PATH") {
doing = DoingNone;
this->NoDefaultPath = true;
+ } else if (args[j] == "REQUIRED") {
+ doing = DoingNone;
+ this->Required = true;
+ newStyle = true;
} else if (this->CheckCommonArgument(args[j])) {
doing = DoingNone;
} else {
diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h
index fce0b11..4cbf09e 100644
--- a/Source/cmFindBase.h
+++ b/Source/cmFindBase.h
@@ -44,14 +44,16 @@ protected:
std::string VariableDocumentation;
std::string VariableName;
std::vector<std::string> Names;
- bool NamesPerDir;
- bool NamesPerDirAllowed;
+ bool NamesPerDir = false;
+ bool NamesPerDirAllowed = false;
// CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
std::string EnvironmentPath; // LIB,INCLUDE
- bool AlreadyInCache;
- bool AlreadyInCacheWithoutMetaInfo;
+ bool AlreadyInCache = false;
+ bool AlreadyInCacheWithoutMetaInfo = false;
+
+ bool Required = false;
private:
// Add pieces of the search.
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index d5a4bde..6f9f7a2 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -12,6 +12,7 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
@@ -84,6 +85,13 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
this->Makefile->AddCacheDefinition(this->VariableName, notfound.c_str(),
this->VariableDocumentation.c_str(),
cmStateEnums::FILEPATH);
+ if (this->Required) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "Could not find " + this->VariableName +
+ " using the following names: " + cmJoin(this->Names, ", "));
+ cmSystemTools::SetFatalErrorOccured();
+ }
return true;
}
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index 908f0c1..f5b52c2 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -5,6 +5,7 @@
#include "cmsys/Glob.hxx"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -51,6 +52,13 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
this->VariableName, (this->VariableName + "-NOTFOUND").c_str(),
this->VariableDocumentation.c_str(),
(this->IncludeFileInPath) ? cmStateEnums::FILEPATH : cmStateEnums::PATH);
+ if (this->Required) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "Could not find " + this->VariableName +
+ " using the following files: " + cmJoin(this->Names, ", "));
+ cmSystemTools::SetFatalErrorOccured();
+ }
return true;
}
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 3e49172..cbc3c78 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -3,6 +3,7 @@
#include "cmFindProgramCommand.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -136,6 +137,13 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
this->Makefile->AddCacheDefinition(
this->VariableName, (this->VariableName + "-NOTFOUND").c_str(),
this->VariableDocumentation.c_str(), cmStateEnums::FILEPATH);
+ if (this->Required) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "Could not find " + this->VariableName +
+ " using the following names: " + cmJoin(this->Names, ", "));
+ cmSystemTools::SetFatalErrorOccured();
+ }
return true;
}
diff --git a/Tests/RunCMake/find_file/Required-result.txt b/Tests/RunCMake/find_file/Required-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_file/Required-stderr.txt b/Tests/RunCMake/find_file/Required-stderr.txt
new file mode 100644
index 0000000..f9c337c
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:9 \(find_file\):
+ Could not find FILE_doNotExists using the following files: doNotExists.h
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_file/Required-stdout.txt b/Tests/RunCMake/find_file/Required-stdout.txt
new file mode 100644
index 0000000..87a8e86
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required-stdout.txt
@@ -0,0 +1 @@
+-- FILE_exists='[^']*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
diff --git a/Tests/RunCMake/find_file/Required.cmake b/Tests/RunCMake/find_file/Required.cmake
new file mode 100644
index 0000000..9cf0927
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required.cmake
@@ -0,0 +1,12 @@
+find_file(FILE_exists
+ NAMES PrefixInPATH.h
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/include
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "FILE_exists='${FILE_exists}'")
+
+find_file(FILE_doNotExists
+ NAMES doNotExists.h
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake
index 9f56a57..93dfb78 100644
--- a/Tests/RunCMake/find_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake
@@ -3,3 +3,4 @@ include(RunCMake)
run_cmake(FromPATHEnv)
run_cmake(FromPrefixPath)
run_cmake(PrefixInPATH)
+run_cmake(Required)
diff --git a/Tests/RunCMake/find_library/Required-result.txt b/Tests/RunCMake/find_library/Required-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_library/Required-stderr.txt b/Tests/RunCMake/find_library/Required-stderr.txt
new file mode 100644
index 0000000..545d164
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:11 \(find_library\):
+ Could not find LIB_doNotExists using the following names: doNotExists
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_library/Required-stdout.txt b/Tests/RunCMake/find_library/Required-stdout.txt
new file mode 100644
index 0000000..b88ab79
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required-stdout.txt
@@ -0,0 +1 @@
+-- LIB_exists='[^']*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
diff --git a/Tests/RunCMake/find_library/Required.cmake b/Tests/RunCMake/find_library/Required.cmake
new file mode 100644
index 0000000..78c9f87
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required.cmake
@@ -0,0 +1,14 @@
+list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
+list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
+find_library(LIB_exists
+ NAMES PrefixInPATH
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/lib
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "LIB_exists='${LIB_exists}'")
+
+find_library(LIB_doNotExists
+ NAMES doNotExists
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake
index 643a5b9..b6aadce 100644
--- a/Tests/RunCMake/find_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake
@@ -7,3 +7,4 @@ if(CMAKE_HOST_UNIX)
run_cmake(LibArchLink)
endif()
run_cmake(PrefixInPATH)
+run_cmake(Required)
diff --git a/Tests/RunCMake/find_path/Required-result.txt b/Tests/RunCMake/find_path/Required-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_path/Required-stderr.txt b/Tests/RunCMake/find_path/Required-stderr.txt
new file mode 100644
index 0000000..db65c2f
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:9 \(find_path\):
+ Could not find PATH_doNotExists using the following files: doNotExists.h
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_path/Required-stdout.txt b/Tests/RunCMake/find_path/Required-stdout.txt
new file mode 100644
index 0000000..225fcab
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required-stdout.txt
@@ -0,0 +1 @@
+-- PATH_exists='[^']*/Tests/RunCMake/find_path/include'
diff --git a/Tests/RunCMake/find_path/Required.cmake b/Tests/RunCMake/find_path/Required.cmake
new file mode 100644
index 0000000..172dc11
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required.cmake
@@ -0,0 +1,12 @@
+find_path(PATH_exists
+ NAMES PrefixInPATH.h
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/include
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "PATH_exists='${PATH_exists}'")
+
+find_path(PATH_doNotExists
+ NAMES doNotExists.h
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index ed55f51..5c919bb 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -3,6 +3,7 @@ include(RunCMake)
run_cmake(EmptyOldStyle)
run_cmake(FromPATHEnv)
run_cmake(PrefixInPATH)
+run_cmake(Required)
if(APPLE)
run_cmake(FrameworksWithSubdirs)
diff --git a/Tests/RunCMake/find_program/Required-result.txt b/Tests/RunCMake/find_program/Required-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_program/Required-stderr.txt b/Tests/RunCMake/find_program/Required-stderr.txt
new file mode 100644
index 0000000..214a8d4
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:9 \(find_program\):
+ Could not find PROG_AandB using the following names: testAandB
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_program/Required-stdout.txt b/Tests/RunCMake/find_program/Required-stdout.txt
new file mode 100644
index 0000000..3c8f1b5
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required-stdout.txt
@@ -0,0 +1 @@
+-- PROG_A='[^']*/Tests/RunCMake/find_program/A/testA'
diff --git a/Tests/RunCMake/find_program/Required.cmake b/Tests/RunCMake/find_program/Required.cmake
new file mode 100644
index 0000000..a75aa53
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required.cmake
@@ -0,0 +1,12 @@
+find_program(PROG_A
+ NAMES testA
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "PROG_A='${PROG_A}'")
+
+find_program(PROG_AandB
+ NAMES testAandB
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index 6903f05..0ff9a97 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -4,6 +4,7 @@ run_cmake(EnvAndHints)
run_cmake(DirsPerName)
run_cmake(NamesPerDir)
run_cmake(RelAndAbsPath)
+run_cmake(Required)
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
run_cmake(WindowsCom)
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index fe2ef75..7625cf6 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -137,6 +137,25 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
+ list(APPEND uv_headers
+ include/uv/posix.h
+ )
+ list(APPEND uv_defines
+ _ALL_SOURCE
+ _XOPEN_SOURCE=500
+ _LINUX_SOURCE_COMPAT
+ _THREAD_SAFE
+ )
+ list(APPEND uv_sources
+ src/unix/aix-common.c
+ src/unix/ibmi.c
+ src/unix/posix-poll.c
+ src/unix/no-fsevents.c
+ src/unix/no-proctitle.c
+ )
+endif()
+
if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
list(APPEND uv_libraries
)