CMake files updated for more control

SimTKcore exists as a separate project to provide 'one stop shopping' for SimTK Core software and support, although the software is actually developed as a set of interdependent projects. SimTK 1.0 was released in March 2008, SimTK 2.0 in December, 2009.
POST REPLY
User avatar
Michael Sherman
Posts: 807
Joined: Fri Apr 01, 2005 6:05 pm

CMake files updated for more control

Post by Michael Sherman » Tue Dec 23, 2008 2:18 pm

I updated the CMake files for projects:
SimTKcommon
Simmath
Simbody
Molmodel
(sorry, didn't do Cpodes).

Now you can control whether to build aux, tests, and examples via CMake variables, and you can control whether to build static and/or dynamic (DLL) test and example programs.

I added a new subdirectory under tests, called tests/adhoc, to hold test cases which are not to be part of the regression tests. Now any ".cpp" file found in a tests directory is assumed to be a regression tests and will be run automatically when the RUN_TESTS target is built. (Test don't have to begin with "Test" any more.) Any ".cpp" in a tests/adhoc directory will be built and can be run from the IDE but won't ever run automatically. This applies both to top-level tests and to auxiliary/tests directories.

I changed the examples and auxiliary/examples directories analogously: they will automatically build static and dynamic versions of the examples which you can run if you want, but they won't run automatically. (Each examples/*cpp file will be turned into an example.) Also, in the case of examples their source code will be installed by the INSTALL target.

My hope is that this structure will encourage people to add more tests and examples. It is really easy now -- just put a .cpp file in the right directory. And if you have some test but it isn't ready for regression prime time, just stick it in an 'adhoc' directory; you can upgrade it later if you want but at least it won't get lost.

Another change I made was to use the CMake project_label feature to name similar projects similarly so that they'll alphabetize together in an IDE that can deal with labels (Visual Studio is all I've tested). The labels are "Library", "Regr" (for regression test), "Adhoc", "Example".

Chris, I didn't fully upgrade the Molmodel examples directory; it is still doing the install by the old method although it is building with the new one.

POST REPLY