mirror of
https://github.com/ModOrganizer2/cmake_common.git
synced 2026-07-27 14:06:46 -07:00
Cache required variables
This commit is contained in:
+21
-13
@@ -1,9 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
function(required_variable name)
|
||||
function(required_variable name type)
|
||||
if(ARGN)
|
||||
list(GET ${ARGN} 0 description)
|
||||
else()
|
||||
set(description "${name}")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED ${name})
|
||||
message(FATAL_ERROR "${name} is not defined")
|
||||
endif()
|
||||
|
||||
set(${name} ${${name}} CACHE ${type} "${description}")
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -48,18 +56,18 @@ if(NOT ${enable_permissive})
|
||||
set(COMPILE_FLAGS "${COMPILE_FLAGS} /permissive-")
|
||||
endif()
|
||||
|
||||
required_variable(BOOST_ROOT)
|
||||
required_variable(BOOST_LIBRARYDIR)
|
||||
required_variable(QT_ROOT)
|
||||
required_variable(FMT_ROOT)
|
||||
required_variable(SPDLOG_ROOT)
|
||||
required_variable(LOOT_PATH)
|
||||
required_variable(LZ4_ROOT)
|
||||
required_variable(ZLIB_ROOT)
|
||||
required_variable(PYTHON_ROOT)
|
||||
required_variable(SEVENZ_ROOT)
|
||||
required_variable(LIBBSARCH_ROOT)
|
||||
required_variable(CMAKE_INSTALL_PREFIX)
|
||||
required_variable(BOOST_ROOT PATH)
|
||||
required_variable(BOOST_LIBRARYDIR PATH)
|
||||
required_variable(QT_ROOT PATH)
|
||||
required_variable(FMT_ROOT PATH)
|
||||
required_variable(SPDLOG_ROOT PATH)
|
||||
required_variable(LOOT_PATH PATH)
|
||||
required_variable(LZ4_ROOT PATH)
|
||||
required_variable(ZLIB_ROOT PATH)
|
||||
required_variable(PYTHON_ROOT PATH)
|
||||
required_variable(SEVENZ_ROOT PATH)
|
||||
required_variable(LIBBSARCH_ROOT PATH)
|
||||
required_variable(CMAKE_INSTALL_PREFIX PATH)
|
||||
|
||||
get_real_path(modorganizer_build_path "${CMAKE_CURRENT_LIST_DIR}/../..")
|
||||
get_real_path(modorganizer_super_path "${modorganizer_build_path}/modorganizer_super")
|
||||
|
||||
Reference in New Issue
Block a user