[CMake] PLplot issues with the cvs version of CMake (Fortran 95)

Bill Hoffman bill.hoffman at kitware.com
Sun Mar 23 20:57:23 EDT 2008


Alan W. Irwin wrote:
> Hi Bill:
> 
> The Fortran 95 issue turned out to be that the default location for Fortran
> 95 modules has been moved from the top-level ${CMAKE_BINARY_DIR} to the 
> more
> logical subdirectory (in our case ${CMAKE_BINARY_DIR}/bindings/f95) where
> the associated fortran library was created in the build tree.  For PLplot
> this required an INCLUDE_DIRECTORIES change (to build Fortran 95 examples
> using the generated module files) as well as a change in build-tree 
> location
> for the generated Fortran modules that we install.
> 
> Since these changes are CMake version dependent, I used the following
> command to distinguish the 2.4.x version from later versions:
> 
> if(CMAKE_CACHE_MAJOR_VERSION EQUAL 2 AND CMAKE_CACHE_MINOR_VERSION EQUAL 4)
> 



> This method appears to work (I get good results now for both the 2.4.8 and
> cvs versions of CMake), but if there is a better way to distinguish CMake
> versions from within cmake, please let me know.
> 
CMAKE_MAJOR_VERSION and CMAKE_MINOR_VERSION should be set:

http://www.cmake.org/HTML/CMake-2.5.html#command_CMAKE_MAJOR_VERSION

http://www.cmake.org/HTML/CMake-2.5.html#command_CMAKE_MINOR_VERSION


> Although this build-tree location change for the generated fortran modules
> is a backwards incompatibility, I recommend you just accept that
> incompatibility for your next release. Fortran support in 2.4.8 basically
> sucks so I believe any CMake Fortran user would be happy to adopt a new
> version with Fortran properly supported for the small expense of adjusting
> for the backwards incompatibility created by adopting a much more logical
> location for the generated module files.
> 

Where did the modules go in 2.4.8?

-Bill


More information about the CMake mailing list