I'm converting PortMidi to use CMake. Visual Studio and Xcode versions 
are done, and I'll soon modify things to work on Linux. I've been trying 
to keep is so that CMake is not necessary for ordinary users that just 
want to build the libraries from sources. I would be very happy to hear 
from anyone that can test the latest version with Visual Studio or Xcode 
-- just grab the latest version via SVN from SourceForge. Also, I made 
changes anticipating 64-bit systems (mainly being more careful with 
integer sizes and the Java JNI interface where addresses are 
stored/passed as integers), but have not been able to test on any 64-bit 
systems.

Some comments on CMake for anyone that's interested: I was disappointed 
to discover that CMake uses absolute paths almost always. Even though it 
claims to make Visual Studio projects and Xcode projects, you can't 
bundle up the project files and expect someone else to use them. The 
expectation is that anyone else will rebuild their own local project 
files using CMake. IMO, this is a poor design, although it would take 
some sophistication to implement and use relative paths correctly.

On the plus side, CMake can generate different versions of Visual C++ 
and Xcode projects, all from one set of descriptions, so already it 
enabled me to remove the distinct VC8 and VC9 project files. Also, I 
expect that MinGW and Unix makefiles for various systems, and management 
of debug and release versions will not require shipping a separate 
Makefile for each. The results already seem more consistent -- it's a 
real pain to go through 50 configuration variations just to add or 
delete a compile-time flag.

Another place where CMake falls down (at least I couldn't figure out how 
to do it with current CMake) is in using Java. PortMidi's PmDefaults 
program uses Java to create a cross-platform graphical interface to 
select default devices. I had to make a separate Xcode project by hand 
to build the Java application, and I still use a make.bat file to build 
it in Windows. If anyone knows how to do this with Cmake, I'm interested.

In order to address the absolute path problem, I wrote some awk scripts 
that edit my CMake-generated project files. This is a real hack and is 
very dependent upon the syntactic details of the CMake-generated files, 
but it's not a lot of code and it seems to work. Overall, I'm happier 
knowing that the project files were generated systematically by some 
hacks than having project files generated by hand through graphical 
interfaces with hundreds of opportunities for errors.

-Roger

_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to