Merge topic 'vs-intel-15'
a128129a
VS: Support Intel Fortran 15 .vfproj generation (#15175)
This commit is contained in:
commit
d2562e2353
|
@ -796,6 +796,20 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||||
<< "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n"
|
<< "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n"
|
||||||
<< "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n";
|
<< "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n";
|
||||||
|
|
||||||
|
if (this->FortranProject)
|
||||||
|
{
|
||||||
|
// Intel Fortran >= 15.0 uses TargetName property.
|
||||||
|
std::string targetNameFull = target.GetFullName(configName);
|
||||||
|
std::string targetName =
|
||||||
|
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
|
||||||
|
std::string targetExt =
|
||||||
|
cmSystemTools::GetFilenameLastExtension(targetNameFull);
|
||||||
|
fout <<
|
||||||
|
"\t\t\tTargetName=\"" << this->EscapeForXML(targetName) << "\"\n"
|
||||||
|
"\t\t\tTargetExt=\"" << this->EscapeForXML(targetExt) << "\"\n"
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
// If unicode is enabled change the character set to unicode, if not
|
// If unicode is enabled change the character set to unicode, if not
|
||||||
// then default to MBCS.
|
// then default to MBCS.
|
||||||
if(targetOptions.UsingUnicode())
|
if(targetOptions.UsingUnicode())
|
||||||
|
|
|
@ -8,13 +8,14 @@ set_property(TARGET FortranOnlylib PROPERTY Fortran_FORMAT FIXED)
|
||||||
set_property(SOURCE world.f PROPERTY Fortran_FORMAT FREE)
|
set_property(SOURCE world.f PROPERTY Fortran_FORMAT FREE)
|
||||||
|
|
||||||
# create an executable that calls hello and world
|
# create an executable that calls hello and world
|
||||||
add_executable(FortranOnly testf.f)
|
add_executable(FortranOnly1 testf.f)
|
||||||
target_link_libraries(FortranOnly FortranOnlylib)
|
set_property(TARGET FortranOnly1 PROPERTY OUTPUT_NAME FortranOnly)
|
||||||
|
target_link_libraries(FortranOnly1 FortranOnlylib)
|
||||||
|
|
||||||
# create a custom command that runs FortranOnly and puts
|
# create a custom command that runs FortranOnly1 and puts
|
||||||
# the output into the file testfhello.txt
|
# the output into the file testfhello.txt
|
||||||
add_custom_command(OUTPUT ${FortranOnly_BINARY_DIR}/testfhello.txt
|
add_custom_command(OUTPUT ${FortranOnly_BINARY_DIR}/testfhello.txt
|
||||||
COMMAND ${FortranOnly_BINARY_DIR}/${CMAKE_CFG_INTDIR}/FortranOnly
|
COMMAND FortranOnly1
|
||||||
> testfhello.txt)
|
> testfhello.txt)
|
||||||
# create a second executable FortranOnly2 that has
|
# create a second executable FortranOnly2 that has
|
||||||
# testfhello.txt has an source file so that it will
|
# testfhello.txt has an source file so that it will
|
||||||
|
@ -27,15 +28,15 @@ add_custom_target(checktestf2 ALL
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-P ${FortranOnly_SOURCE_DIR}/checktestf2.cmake)
|
-P ${FortranOnly_SOURCE_DIR}/checktestf2.cmake)
|
||||||
|
|
||||||
# create a custom target that runs FortranOnly exectuable and creates
|
# create a custom target that runs FortranOnly1 exectuable and creates
|
||||||
# a file out.txt that should have hello world in it.
|
# a file out.txt that should have hello world in it.
|
||||||
add_custom_target(sayhello ALL
|
add_custom_target(sayhello ALL
|
||||||
COMMAND ${FortranOnly_BINARY_DIR}/${CMAKE_CFG_INTDIR}/FortranOnly > out.txt
|
COMMAND FortranOnly1 > out.txt
|
||||||
)
|
)
|
||||||
# make sure stuff is built in the right order
|
# make sure stuff is built in the right order
|
||||||
add_dependencies(checktestf2 FortranOnly2)
|
add_dependencies(checktestf2 FortranOnly2)
|
||||||
add_dependencies(sayhello FortranOnly)
|
add_dependencies(sayhello FortranOnly1)
|
||||||
add_dependencies(FortranOnly2 FortranOnly)
|
add_dependencies(FortranOnly2 FortranOnly1)
|
||||||
|
|
||||||
# add a custom target that checkes that out.txt has the correct
|
# add a custom target that checkes that out.txt has the correct
|
||||||
# content
|
# content
|
||||||
|
|
Loading…
Reference in New Issue