javac: file not found indicates just that: the cmake system tried to invoke the java compiler and the command failed. This is probably due to cmake not being able to locate the JDK installation, the installation being absent, or the user failing to provide cmake with a path to the JDK installation. This has been worked on before, but I think there may not be a foolproof way to do this. I think this is not a bug and is not related to building outside of the source dir. If building inside the source dir works, and then just changing the build location fails AND if you provide a fix or a compelling reason this is necessary, I will change my opinion. Otherwise, I think it is only practical to support one way to build portmidi, but always good to know if other methods are (or are not) available. I'll leave this report open for a bit to see if there are other comments or information.