cmake and dunepy.
Only add line to CMakeLists.txt if the source file has been successfully created to avoid later problems with cmake.
Only add line to CMakeLists.txt if the source file has been successfully created to avoid later problems with cmake.