<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi Marco.<br><br></div>Sane compilers allow later command-line options to override earlier ones, so what you're doing should be fine. Unfortunately, I know some Fortran compilers are not sane in this regard.<br>
<br></div>If you really need to solve this by explicitly modifying the global list for a particular file, the only thing I can think of is move those files to a separate CMakeList and turn them into an object library:<br>
<br></div># In normal CMakeList:<br><br></div>add_subdirectory(special_file_dir)<br><br></div><div>add_executable(YourNormalTarget normal_file1.f90 normal_file2.f90 $<TARGET_OBJECTS:special_files>)<br></div><div><br>
<br></div># In special_file_dir/CMakeLists.txt:<br><br></div>set(CMAKE_Fortran_FLAGS "-only -flags -you -want")<br><br></div>add_library(special_files OBJECT special_fil1.f90 special_file2.f90)<br><br><br></div>
I haven't tested it, but it should work.<br><br></div>Petr<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 4:29 PM, marco restelli <span dir="ltr"><<a href="mailto:mrestelli@gmail.com" target="_blank">mrestelli@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
   I would like to reset CMAKE_Fortran_FLAGS for one specific file in<br>
a project. I have tried<br>
<br>
SET_SOURCE_FILES_PROPERTIES(my_file.f90 PROPERTIES COMPILE_FLAGS "-O0 -g")<br>
<br>
but it appends the new flags keeping the old ones. How can reset these<br>
flags? Specifically, I have some files for which I need to avoid any<br>
error checking and any optimization, independently from the selected<br>
compiler.<br>
<br>
Thanks, regards,<br>
   Marco<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>