@ -1,17 +1,6 @@
# S P D X - F i l e C o p y r i g h t T e x t : C o p y r i g h t 2 0 2 5 E d e n E m u l a t o r P r o j e c t
# S P D X - L i c e n s e - I d e n t i f i e r : G P L - 3 . 0 - o r - l a t e r
# S P D X - F i l e C o p y r i g h t T e x t : C o p y r i g h t 2 0 2 5 c r u e t e r
# S P D X - L i c e n s e - I d e n t i f i e r : G P L - 3 . 0 - o r - l a t e r
# C r e a t e d - B y : c r u e t e r
# D o c s w i l l c o m e a t a l a t e r d a t e , m o s t l y t h i s i s t o j u s t r e d u c e b o i l e r p l a t e
# a n d s o m e c m a k e m a g i c t o a l l o w f o r r u n t i m e v i e w i n g o f d e p e n d e n c y v e r s i o n s
# F u t u r e c r u e t e r : W o w t h i s w a s a l i e a n d a h a l f , a t t h i s p o i n t I m i g h t a s w e l l m a k e m y o w n C P N
# h a h a j u s t k i d d i n g . . . u n l e s s ?
# TODO ( crueter ) : R e m e m b e r t o g e t m o r e t h a n 6 h o u r s o f s l e e p w h e n e v e r m a k i n g g i a n t c m a k e c h a n g e s
if ( MSVC OR ANDROID )
set ( BUNDLED_DEFAULT ON )
else ( )
@ -27,6 +16,7 @@ option(CPMUTIL_FORCE_SYSTEM
cmake_minimum_required ( VERSION 3.22 )
include ( CPM )
# c p m f i l e p a r s i n g
set ( CPMUTIL_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json" )
if ( EXISTS ${ CPMUTIL_JSON_FILE } )
@ -35,12 +25,11 @@ else()
message ( WARNING "[CPMUtil] cpmfile ${CPMUTIL_JSON_FILE} does not exist, AddJsonPackage will be a no-op" )
endif ( )
# u t i l i t y
# U t i l i t y s t u f f
function ( cpm_utils_message level name message )
message ( ${ level } "[CPMUtil] ${name}: ${message}" )
endfunction ( )
# u t i l i t y
function ( array_to_list array length out )
math ( EXPR range "${length} - 1" )
@ -53,7 +42,6 @@ function(array_to_list array length out)
set ( "${out}" "${NEW_LIST}" PARENT_SCOPE )
endfunction ( )
# u t i l i t y
function ( get_json_element object out member default )
string ( JSON out_type ERROR_VARIABLE err TYPE "${object}" ${ member } )
@ -73,14 +61,13 @@ function(get_json_element object out member default)
set ( "${out}" "${outvar}" PARENT_SCOPE )
endfunction ( )
# K i n d a c a n c e r o u s b u t w h a t e v e r
# T h e p r e f e r r e d u s a g e
function ( AddJsonPackage )
set ( oneValueArgs
N A M E
# t h e s e a r e o v e r r i d e s t h a t c a n b e g e n e r a t e d a t r u n t i m e , s o c a n b e d e f i n e d s e p a r a t e l y f r o m t h e j s o n
D O W N L O A D _ O N L Y
S Y S T E M _ P A C K A G E
B U N D L E D _ P A C K A G E
)
@ -90,6 +77,7 @@ function(AddJsonPackage)
" $ { A R G N } " )
list ( LENGTH ARGN argnLength )
# s i n g l e n a m e a r g u m e n t
if ( argnLength EQUAL 1 )
set ( JSON_NAME "${ARGV0}" )
@ -199,7 +187,6 @@ function(AddJsonPackage)
endif ( )
set ( options ${ options } ${ JSON_OPTIONS } )
# e n d o p t i o n s
# s y s t e m / b u n d l e d
@ -241,7 +228,7 @@ endfunction()
function ( AddPackage )
cpm_set_policies ( )
# TODO ( crueter ) : d o c s , g i t c l o n e
# TODO ( crueter ) : g i t c l o n e ?
# [ [
U R L c o n f i g u r a t i o n s , d e s c e n d i n g o r d e r o f p r e c e d e n c e :