Hi,

It seems like cmake cannot handle the case where the module name is the result of a macro. I am using this approach to compile the same code for different floating point precision. Any advice appreciated. This approach would apply to hundreds of files.

The error is:
Error copying Fortran module "concat".  Tried "CONCAT.mod" and "concat.mod".
make[2]: *** [CMakeFiles/flib.dir/baz.o.provides.build] Error 1
make[1]: *** [CMakeFiles/flib.dir/all] Error 2
make: *** [all] Error 2


Regards,

Juan


baz.F:
#include "fmacros.inc"

      module CONCAT(baz)
      contains
      subroutine car(t3)
      end subroutine
      end module CONCAT(baz)

foo.F:
#include "fmacros.inc"

      module CONCAT(foo)
      contains
      subroutine bar(t1, t2)
      use CONCAT(baz)
      implicit none
      REAL(kind=8) t1
      REAL(kind=DWIDTH) t2
      call baz(t2)
      end subroutine
      end module CONCAT(foo)

fmacros.inc:

#define CONCAT(a) a/**/_double
#define DWIDTH 8

main.cc:
extern "C" {
void
}

CMakeLists.txt:

PROJECT(foo)
ENABLE_LANGUAGE(CXX Fortran)

ADD_LIBRARY(flib foo.F baz.F)



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to