preinstall cmake cache checks project instead of cloning it to include all cache variables

This commit is contained in:
ohyzha
2024-10-24 09:57:03 +03:00
parent 2965321483
commit b6211be09a
19 changed files with 554 additions and 16 deletions

View File

@@ -32,7 +32,6 @@ add_subdirectory(boost)
add_subdirectory(units) add_subdirectory(units)
add_subdirectory(libjpeg-turbo) add_subdirectory(libjpeg-turbo)
add_subdirectory(msdf) add_subdirectory(msdf)
add_subdirectory(cmake-checks-cache)
if (NOT IOS AND ENABLE_CURL) if (NOT IOS AND ENABLE_CURL)
add_subdirectory(curl) add_subdirectory(curl)
endif() endif()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckCCompilerFlag.cmake)
macro(check_c_compiler_flag flag variable)
_check_c_compiler_flag("${flag}" ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Test ${variable}\")\n")
endmacro()

View File

@@ -0,0 +1,37 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckCSourceCompiles.cmake)
macro(check_c_source_compiles source variable)
if(NOT DEFINED "${variable}")
_check_c_source_compiles("${source}" ${variable})
else()
_check_c_source_compiles("${source}" ${variable} "${ARGN}")
endif()
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Test ${variable}\")\n")
endmacro()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckCXXCompilerFlag.cmake)
macro(check_cxx_compiler_flag flag variable)
_check_cxx_compiler_flag("${flag}" ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Test ${variable}\")\n")
endmacro()

View File

@@ -0,0 +1,37 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake)
macro(check_cxx_source_compiles source variable)
if(NOT DEFINED "${variable}")
_check_cxx_source_compiles("${source}" ${variable})
else()
_check_cxx_source_compiles("${source}" ${variable} "${ARGN}")
endif()
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Test ${variable}\")\n")
endmacro()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckCXXSymbolExists.cmake)
macro(check_cxx_symbol_exists symbol header variable)
_check_cxx_symbol_exists(${symbol} "${header}" ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Have C++ symbol ${symbol}\")\n")
endmacro()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
macro(check_function_exists function variable)
_check_function_exists(${function} ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Have function ${function}\")\n")
endmacro()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
macro(check_include_file header variable)
_check_include_file(${header} ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Have include ${header}\")\n")
endmacro()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
macro(check_include_file_cxx header variable)
_check_include_file_cxx(${header} ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Have include ${header}\")\n")
endmacro()

View File

@@ -0,0 +1,37 @@
# MIT License
# Copyright (c) 2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
macro(check_include_files headers variable)
if(NOT DEFINED "${variable}")
_check_include_files("${headers}" ${variable})
else()
_check_include_files("${headers}" ${variable} "${ARGN}")
endif()
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Have include ${headers}\")\n")
endmacro()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
macro(check_library_exists library function location variable)
_check_library_exists("${library}" ${function} "${location}" ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Have library ${library}\")\n")
endmacro()

View File

@@ -0,0 +1,34 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckStructHasMember.cmake)
macro(check_struct_has_member struct member header variable)
_check_struct_has_member("${struct}" ${member} "${header}" ${variable} ${ARGN})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"${struct} hash ${member} member\")\n")
endmacro()

View File

@@ -0,0 +1,33 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
macro(check_symbol_exists symbol header variable)
_check_symbol_exists(${symbol} "${header}" ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"Have symbol ${symbol}\")\n")
endmacro()

View File

@@ -0,0 +1,38 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
macro(check_type_size type variable)
_check_type_size(${type} ${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(HAVE_${variable} \"${HAVE_${variable}}\" CACHE INTERNAL \"Result of TRY_COMPILE\")\n")
if(HAVE_${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"${${variable}}\" CACHE INTERNAL \"CHECK_TYPE_SIZE: sizeof(${type})\")\n")
else()
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${variable} \"\" CACHE INTERNAL \"CHECK_TYPE_SIZE: ${type} unknown\")\n")
endif()
endmacro()

View File

@@ -0,0 +1,48 @@
# MIT License
# Copyright (c) 2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
set(CMAKE_CHECKS_CACHE_FILE "${CMAKE_BINARY_DIR}/cmake_checks_cache.txt" CACHE FILEPATH "CMake checks cache file")
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "###############################################################\n")
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "# Dump of all cache variables that started with CMAKE_*\n")
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "###############################################################\n")
get_cmake_property(_cachedVariableNames CACHE_VARIABLES)
list(FILTER _cachedVariableNames INCLUDE REGEX "^CMAKE_.*$")
foreach (_cacheVariable ${_cachedVariableNames})
get_property(_type CACHE "${_cacheVariable}" PROPERTY TYPE)
get_property(_advanced CACHE "${_cacheVariable}" PROPERTY ADVANCED)
get_property(_help_string CACHE "${_cacheVariable}" PROPERTY HELPSTRING)
string(REPLACE "\"" "\\\"" ${_cacheVariable} "${${_cacheVariable}}")
if (NOT "${_type}" STREQUAL "UNINITIALIZED" AND NOT "${_type}" STREQUAL "STATIC")
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${_cacheVariable} \"${${_cacheVariable}}\" CACHE ${_type} \"${_help_string}\")\n")
if (${_advanced})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "mark_as_advanced(${_cacheVariable})\n")
endif()
endif()
endforeach()
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "###############################################################\n")

View File

@@ -0,0 +1,35 @@
# MIT License
# Copyright (c) 2017-2018 Cristian Adam
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.11)
include(DumpCMakeVariables)
include(${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
#macro(TEST_BIG_ENDIAN VARIABLE)
macro(test_big_endian variable)
_test_big_endian(${variable})
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(HAVE_${variable} \"${${variable}}\" CACHE INTERNAL \"Test Big Endian ${variable}\")\n")
endmacro()

View File

@@ -1,14 +0,0 @@
include (FetchContent)
if(NOT DEFINED CMAKE_CHECKS_REPO)
set(CMAKE_CHECKS_REPO https://github.com/cristianadam/cmake-checks-cache.git)
endif ()
FetchContent_Declare(
cmake-checks-cache
GIT_REPOSITORY ${CMAKE_CHECKS_REPO}
GIT_TAG master
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(cmake-checks-cache)

23
3rdParty/cmake-checks-cache/LICENSE.md vendored Normal file
View File

@@ -0,0 +1,23 @@
```
MIT License
Copyright (c) 2017-2018 Cristian Adam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

View File

@@ -15,7 +15,7 @@ if(LINUX)
find_package(ECM REQUIRED NO_MODULE) find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
endif() endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/_deps/cmake-checks-cache-src/CMakeChecksCache" set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cmake-checks-cache/CMakeChecksCache"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/functions") "${CMAKE_CURRENT_SOURCE_DIR}/cmake/functions")