/[lmdze]/trunk/filtrez/CMakeLists.txt
ViewVC logotype

Contents of /trunk/filtrez/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 351 - (show annotations)
Tue Jan 7 11:59:00 2020 UTC (4 years, 4 months ago) by guez
File MIME type: text/plain
File size: 418 byte(s)
Simplify `CMakeLists.txt` files

Take advantage of improved building of libraries: use `find_package`
instead of `find_path` and `find_library`.

Link each executable to target `LMDZE_objects` instead of including the
corresponding objects in the definition of the target executable. This
way, the executable inherits the dependencies of `LMDZE_objects` and
we do not need them in `library_list`.

Remove the definition of `library_list`. Replace the reference to
`library_list` by references to just `netcdff_LIBRARY` and `NetCDF_LIBRARY`.

1 file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/file_list file_list_var)
2 list(TRANSFORM file_list_var PREPEND ${CMAKE_CURRENT_LIST_DIR}/)
3 target_sources(LMDZE_objects PRIVATE ${file_list_var})
4
5 add_executable(test_inifilr ${CMAKE_CURRENT_LIST_DIR}/test_inifilr.f90)
6 target_include_directories(test_inifilr PRIVATE ${netcdff_INCLUDE_DIR})
7 target_link_libraries(test_inifilr LMDZE_objects ${netcdff_LIBRARY}
8 ${NetCDF_LIBRARY})

  ViewVC Help
Powered by ViewVC 1.1.21