iauns/cpm — pull request #6 by toeb (2014-02-12 19:05:33+00:00)
Title: Support for Mercurial

I needed to add the Eigen Matrix library (https://bitbucket.org/eigen/eigen/) as a module to a my project. It happened to be hosted in a mercurial repository which you currently do not support. So I forked your repo and copied the git _cpm_ensure_git_repo_is_current and modified it for mercurial. Also I updated CPM_EnsureRepoIsCurrent.

if mercurial is not found a warning is issued, however the rest will still work.

I also added bitbucket as a repo hoster in the create uuid macro

I am not a pro at mercurial so I do not know what happens if subrepositories are involved (maybe mercurial handles them automatically?) for now I just support a single mercurial repo.

I added a init-cpm and init-cpm-module file in your root directory which allows for even less overhead when starting a project. you just include them like so:

this would also allow more initialization code later on depending on where you plan to go with the project (some kind of central repository webservice like npm or nuget, modules hosted as zip files, etc?).
```
# initialize
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/init.cmake)
file(DOWNLOAD https://raw.github.com/toeb/cpm/master/init-cpm-module.cmake ${CMAKE_CURRENT_BINARY_DIR}/init.cmake)
endif()
include(${CMAKE_CURRENT_BINARY_DIR}/init.cmake)
```

please tell me if you find these thoughts and changes useful.

Cheers!
Tobi