Fixed bug in CMakeLists.txt to handle message dependencies.