aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSilvio Traversaro <silvio@traversaro.it>2020-11-26 11:16:05 +0100
committerGitHub <noreply@github.com>2020-11-26 11:16:05 +0100
commit008df693cf5a71b8f1db87731a7b5af87400e5dd (patch)
tree301d3be6c3cd828b172bdc1c4294fa6f0edc2e04 /cmake
parent0b89999623df30fa96bf2da9a4b16c3e77eb0b57 (diff)
parent49c3a3379a88922364dafaad9062960a9ef4caee (diff)
downloaddlfcn-win32-008df693cf5a71b8f1db87731a7b5af87400e5dd.tar.gz
dlfcn-win32-008df693cf5a71b8f1db87731a7b5af87400e5dd.tar.bz2
dlfcn-win32-008df693cf5a71b8f1db87731a7b5af87400e5dd.zip
Merge pull request #85 from rhabacker/cmake-wine-support
Add support to use wine to run cross compiled tests for cmake
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/Macros.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake
new file mode 100644
index 0000000..fa0f1fc
--- /dev/null
+++ b/cmake/modules/Macros.cmake
@@ -0,0 +1,32 @@
1#
2# provide option with three states AUTO, ON, OFF
3#
4macro(add_auto_option _name _text _default)
5 if(NOT DEFINED ${_name})
6 set(${_name} ${_default} CACHE STRING "${_text}" FORCE)
7 else()
8 set(${_name} ${_default} CACHE STRING "${_text}")
9 endif()
10 set_property(CACHE ${_name} PROPERTY STRINGS AUTO ON OFF)
11endmacro()
12
13#
14# Ensure that if a tristate ON/OFF/AUTO feature is set to ON,
15# its requirements have been met. Fail with a fatal error if not.
16#
17# _name: name of a variable ENABLE_FOO representing a tristate ON/OFF/AUTO feature
18# _text: human-readable description of the feature enabled by _name, for the
19# error message
20# _var: name of a variable representing a system property we checked for,
21# such as an executable that must exist for the feature enabled by _name to work
22# _vartext: what we checked for, for the error message
23#
24macro(check_auto_option _name _text _var _vartext)
25 set(_nameval ${${_name}})
26 set(_varval ${${_var}})
27 #message("debug: _name ${_name} ${_nameval} _var ${_var} ${_varval}")
28 if(_nameval AND NOT _nameval STREQUAL "AUTO" AND NOT _varval)
29 message(FATAL_ERROR "${_text} requested but ${_vartext} not found")
30 endif()
31endmacro()
32