| 4329 | } |
| 4330 | |
| 4331 | std::string cmGeneratorTarget::CreateFortranModuleDirectory( |
| 4332 | std::string const& working_dir) const |
| 4333 | { |
| 4334 | std::string mod_dir; |
| 4335 | std::string target_mod_dir; |
| 4336 | if (cmValue prop = this->GetProperty("Fortran_MODULE_DIRECTORY")) { |
| 4337 | target_mod_dir = *prop; |
| 4338 | } else { |
| 4339 | std::string const& default_mod_dir = |
| 4340 | this->LocalGenerator->GetCurrentBinaryDirectory(); |
| 4341 | if (default_mod_dir != working_dir) { |
| 4342 | target_mod_dir = default_mod_dir; |
| 4343 | } |
| 4344 | } |
| 4345 | cmValue moddir_flag = |
| 4346 | this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG"); |
| 4347 | if (!target_mod_dir.empty() && moddir_flag) { |
| 4348 | // Compute the full path to the module directory. |
| 4349 | if (cmSystemTools::FileIsFullPath(target_mod_dir)) { |
| 4350 | // Already a full path. |
| 4351 | mod_dir = target_mod_dir; |
| 4352 | } else { |
| 4353 | // Interpret relative to the current output directory. |
| 4354 | mod_dir = cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), |
| 4355 | '/', target_mod_dir); |
| 4356 | } |
| 4357 | |
| 4358 | // Make sure the module output directory exists. |
| 4359 | cmSystemTools::MakeDirectory(mod_dir); |
| 4360 | } |
| 4361 | return mod_dir; |
| 4362 | } |
| 4363 | |
| 4364 | void cmGeneratorTarget::AddISPCGeneratedHeader(std::string const& header, |
| 4365 | std::string const& config) |
no test coverage detected