Hello, I am in the process of converting a bigger project from pure GNU Make to CMake - mostly because managing dependencies for the Fortran sources has become too painful.
Things seem to be mostly working, but I'm hitting one problem. When trying to run the (CMake-generated) Makefile, it fails with: $ make VERBOSE=1 [...] make[2]: Entering directory `/home/nrath/Q2D/LamyRidge/src/model/build' /home/nrath/.local/stow/cmake/bin/cmake -E cmake_copy_f90_mod dagmg_allroutines CMakeFiles/LR_model.dir/dagmg_allroutines.mod.stamp Intel /home/nrath/.local/stow/cmake/bin/cmake -E cmake_copy_f90_mod dagmg_mem CMakeFiles/LR_model.dir/dagmg_mem.mod.stamp Intel /home/nrath/.local/stow/cmake/bin/cmake -E cmake_copy_f90_mod dagmg_pardiso CMakeFiles/LR_model.dir/dagmg_pardiso.mod.stamp Intel Error copying Fortran module "dagmg_pardiso". Tried "DAGMG_PARDISO.mod" and "dagmg_pardiso.mod". make[2]: *** [CMakeFiles/LR_model.dir/home/nrath/Q2D/LamyRidge/src/comm/agmg-seq/dagmg.f90.o.provides.build] Error 1 make[2]: Leaving directory `/home/nrath/Q2D/LamyRidge/src/model/build' make[1]: *** [CMakeFiles/LR_model.dir/all] Error 2 make[1]: Leaving directory `/home/nrath/Q2D/LamyRidge/src/model/build' make: *** [all] Error 2 I am not sure why CMake is trying to copy module files around, but when I looked at the file that provides the "dagmg_pardiso" module, I found this code: !DEC$ IF DEFINED(_MKL_) MODULE dagmg_PARDISO USE dagmg_PARDISSO INTERFACE [...] END INTERFACE END MODULE dagmg_PARDISO !DEC$ ENDIF !----------------------------------------------------------------------- !DEC$ IF .NOT. DEFINED(_MKL_) SUBROUTINE PARDISO( PT, MAXFCT, MNUM, MTYPE, PHASE, N, A, IA, JA & , PERM, NRHS, IPARM, MSGLVL, B, X, ERROR ) [...] END SUBROUTINE PARDISO !DEC$ ENDIF I do not define __MKL__. Is it possible that the CMake dependency parser doesn't understand this way of defining conditionals, and thus looks for a module that does not exist? If so, what would be the best way to work around this? (The code is from a third-party library, so unfortunately I cannot easily change it). Best, -Nikolaus -- 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