@@ -423,6 +423,13 @@ function _get_configs_for_android(package, configs, opt)
423
423
table.insert (configs , " -DCMAKE_MAKE_PROGRAM=" .. make )
424
424
end
425
425
end
426
+
427
+ -- avoid find and add system include/library path
428
+ -- @see https://github.com/xmake-io/xmake/issues/2037
429
+ table.insert (configs , " -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH" )
430
+ table.insert (configs , " -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH" )
431
+ table.insert (configs , " -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH" )
432
+ table.insert (configs , " -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER" )
426
433
end
427
434
_get_configs_for_generic (package , configs , opt )
428
435
end
@@ -453,6 +460,7 @@ function _get_configs_for_appleos(package, configs, opt)
453
460
envs .CMAKE_SYSTEM_NAME = " Darwin"
454
461
end
455
462
envs .CMAKE_OSX_ARCHITECTURES = package :arch ()
463
+ envs .CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = " BOTH"
456
464
envs .CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = " BOTH"
457
465
envs .CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = " BOTH"
458
466
envs .CMAKE_FIND_ROOT_PATH_MODE_FRAMEWORK = " BOTH"
@@ -484,6 +492,7 @@ function _get_configs_for_mingw(package, configs, opt)
484
492
-- avoid find and add system include/library path
485
493
-- @see https://github.com/xmake-io/xmake/issues/2037
486
494
envs .CMAKE_FIND_ROOT_PATH = sdkdir
495
+ envs .CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = " BOTH"
487
496
envs .CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = " BOTH"
488
497
envs .CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = " BOTH"
489
498
envs .CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = " NEVER"
@@ -578,6 +587,7 @@ function _get_configs_for_cross(package, configs, opt)
578
587
-- avoid find and add system include/library path
579
588
-- @see https://github.com/xmake-io/xmake/issues/2037
580
589
envs .CMAKE_FIND_ROOT_PATH = sdkdir
590
+ envs .CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = " BOTH"
581
591
envs .CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = " BOTH"
582
592
envs .CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = " BOTH"
583
593
envs .CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = " NEVER"
0 commit comments