Trying to build your example cmake yields the same error as mine when not linking with LLVM
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libjulia.so: undefined reference to `llvm::AttributeSet::hasAttribute(unsigned int, llvm::Attribute::AttrKind) const'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libjulia.so: undefined reference to `llvm::DataLayout::getStructLayout(llvm::StructType*) const'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libjulia.so: undefined reference to `llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::getLoopLatch() const'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libjulia.so: undefined reference to `llvm::parseAssemblyInto(llvm::MemoryBufferRef, llvm::Module&, llvm::SMDiagnostic&, llvm::SlotMapping*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libjulia.so: undefined reference to `llvm::createJumpThreadingPass(int)'