将编译标志添加到cmake中的一组文件中

时间:2016-01-12 11:04:56

标签: cmake fortran fortran90 fortran77 intel-fortran

我的许多文件都是旧的遗留堡垒,需要-auto标志(英特尔)或-fautomatic(gfortran),但代码的新部分有OpenMP指令,特别需要CMAKE_FORTRAN_FLAGS="-O3 -save" CMAKE_FORTRAN95_FLAGS="-auto" (英特尔)FOREACH(f ${for_SOURCES}) GET_FILENAME_COMPONENT(f_abs_path ${f} ABSOLUTE) GET_FILENAME_COMPONENT(f_path ${f} PATH) #DIRECTORY in modern cmake GET_FILENAME_COMPONENT(f_base ${f} NAME_WE) GET_FILENAME_COMPONENT(f_ext ${f} EXT) GET_FILENAME_COMPONENT(f_name ${f} NAME) set (f_processed ${CMAKE_BINARY_DIR}/${f_path}/${f_base}.f) add_custom_target (${f_base} DEPENDS ${f_processed} ) add_custom_command (OUTPUT ${f_processed} COMMAND ${CMAKE_COMMAND} -E copy ${f_abs_path} ${f_processed} DEPENDS ${f_path}/${f_name}) set_source_files_properties( ${f_processed} PROPERTIES COMPILE_FLAGS ${CMAKE_Fortran95_FLAGS}) LIST(APPEND processed_files ${f_processed}) ENDFOREACH(f ${for_SOURCES}) (gfortran)。我调用遗留文件name.f和新文件name.for(为了便于编辑emacs) 那么我就设置了

VERBOSE=1

然后在我的CMakeLists.txt文件中,我有:

{{1}}

但它没有获得make {{1}}所示的旗帜。我该怎么办?

0 个答案:

没有答案