aimotive-legacy / cmakex

lightweight package manager for CMake
4 stars 1 forks source link

better control of dependency versions: GIT_TAG_IGNORE #32

Closed tamaskenez closed 7 years ago

tamaskenez commented 7 years ago

add a special new option to add_pkg and def_pkg:

add_pkg(... GIT_TAG_IGNORE <branch/tag/sha> ...)

The default behaviour is that it's an error to specify different GIT_TAG's in two add_pkg commands. Also, this is an error:

add_pkg(foo ...) # not GIT_TAG
add_pkg(foo GIT_TAG <something>)

But this is not:

add_pkg(foo GIT_TAG <something>)
add_pkg(foo ...) # not GIT_TAG

Now GIT_TAG_IGNORE can be used to suppress an error:

add_pkg(foo GIT_TAG branch1 GIT_TAG_IGNORE branch2)
add_pkg(foo GIT_TAG branch2) # branch2 will have no effect

GIT_TAG_IGNORE would be effective only in the main project, that is, in the top-level deps.cmake or in other files included from the top-level deps.cmake but reside in or below deps.cmake's parent directory.

tamaskenez commented 7 years ago

GIT_TAG_OVERRIDE was implemented instead (less safe but more convenient)