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

Contents of /trunk/phylmd/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: 1292 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 set(file_list_var aaam_bud.f90 ajsec.f90 chem.f90 clesphys2.f90
2 clesphys.f90 clouds_gno.f90 cltrac.f90 cltracrn.f90 comfisrtilp.f90
3 comgeomphy.f90 concvl.f90 conf_phys.f90 cv_driver.f90 cvltr.f90
4 diagcld1.f90 dimphy.f90 dimsoil.f90 FCTTRE.f90
5 fisrtilp.f90 gr_phy_write.f90 hgardfou.f90 histwrite_phy.f90
6 indicesol.f90 ini_histins.f90 initrrnpb.f90 minmaxqfi.f90
7 newmicro.f90 nflxtr.f90 orbite.f90 ozonecm.f90 phyetat0.f90
8 phyredem0.f90 phyredem.f90 physiq.f90 phytrac.f90 radepsi.f90
9 radiornpb.f90 suphec.f90 time_phylmdz.f90 transp.f90 transp_lay.f90
10 yoethf.f90 YOMCST.f90 zenang.f90)
11
12 list(TRANSFORM file_list_var PREPEND ${CMAKE_CURRENT_LIST_DIR}/)
13 target_sources(LMDZE_objects PRIVATE ${file_list_var})
14
15 foreach(my_dir Mobidic Thermcell Orography Radlwsw CV30_routines Conflx
16 Interface_surf)
17 include(${CMAKE_CURRENT_LIST_DIR}/${my_dir}/CMakeLists.txt)
18 endforeach(my_dir)
19
20 add_executable(test_orbite ${CMAKE_CURRENT_LIST_DIR}/test_orbite.f90)
21 target_link_libraries(test_orbite LMDZE_objects ${netcdff_LIBRARY}
22 ${NetCDF_LIBRARY})
23
24 add_executable(test_ozonecm ${CMAKE_CURRENT_LIST_DIR}/test_ozonecm.f90)
25 target_include_directories(test_ozonecm PRIVATE ${netcdff_INCLUDE_DIR})
26 target_link_libraries(test_ozonecm ${netcdff_LIBRARY}
27 ${NetCDF_LIBRARY} LMDZE_objects)

  ViewVC Help
Powered by ViewVC 1.1.21