obs-StreamFX/cmake/util.cmake
Michael Fabian 'Xaymar' Dirks dc0104850a cmake: Massive update ported from obs-amd-encoder
This includes support for included, referenced, packaged and downloaded obs-studio libraries, cppcheck, packaging using cpack, 7z, zip or InnoSetup and more.
2018-09-26 01:17:08 +02:00

19 lines
No EOL
676 B
CMake

Function(CacheSet Name Value)
GET_PROPERTY(V_ADVANCED CACHE "${Name}" PROPERTY ADVANCED)
GET_PROPERTY(V_TYPE CACHE "${Name}" PROPERTY TYPE)
GET_PROPERTY(V_HELPSTRING CACHE "${Name}" PROPERTY HELPSTRING)
Set(${Name} ${Value} CACHE ${V_TYPE} ${V_HELPSTRING} FORCE)
If(${V_ADVANCED})
Mark_As_Advanced(FORCE ${Name})
EndIf()
EndFunction()
Function(CacheClear Name)
GET_PROPERTY(V_ADVANCED CACHE "${Name}" PROPERTY ADVANCED)
GET_PROPERTY(V_TYPE CACHE "${Name}" PROPERTY TYPE)
GET_PROPERTY(V_HELPSTRING CACHE "${Name}" PROPERTY HELPSTRING)
Set(${Name} 0 CACHE ${V_TYPE} ${V_HELPSTRING} FORCE)
If(${V_ADVANCED})
Mark_As_Advanced(FORCE ${Name})
EndIf()
EndFunction()