Bugfix for previous pull request (Eigen)

Last pull request broke the webdemo. This PR addresses this issue.

@atgeirr Can you take a quick look? The CMake scripts in general are a bit poorly designed (some variables being set up in confusing manners), but this runs well with the webdemo on my machine now at least.