-
in set_project('my-project')
set_version('0.1')
-- how do i override this and provide my own include+library paths from CLI?
add_requires('my-dependlib')
target('my-lib')
add_files('main.c')
add_package('my-dependlib') in shell: # don't want to use xmake's package searcher. give my own paths for this special build.
xmake f --my-dependlib-includes=path/to/include --my-dependlib-lib=path/to/lib
# but this must also work, whether from system or from fetching+building
xmake f |
Beta Was this translation helpful? Give feedback.
Answered by
corpserot
Aug 30, 2025
Replies: 1 comment
-
my solution looked something like this. if there is a cleaner approach, i'd appreciate if someone shares it ❤️ set_project('my-project')
set_version('0.1')
option('mydependlib-libpath')
set_description('Path to mydependlib library')
option_end()
option('mydependlib-includepath')
set_description('Path to mydependlib headers')
option_end()
if not has_config('mydependlib-libpath', 'mydependlib-includepath') then
add_requires('mydependlib')
end
target('my-lib')
add_files('main.c')
add_links('mydependlib')
if has_config('mydependlib-libpath', 'mydependlib-includepath') then
add_includedirs('$(mydependlib-includepath)')
add_linkdirs('$(mydependlib-libpath)')
else
add_package('mydependlib')
end |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
corpserot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my solution looked something like this. if there is a cleaner approach, i'd appreciate if someone shares it ❤️