diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index baddd2e6..7c0e93e3 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -31,12 +31,16 @@ if (BUILD_D) endif() if (BUILD_4) - add_executable(cnvgrib cnv12.F90 cnv22.F90 gds2gdt.F90 makepdsens.F90 - pds2pdtens.F90 putgbexn.F90 cnv21.F90 cnvgrib.F90 gdt2gds.F90 - makepds.F90 pds2pdt.F90 setbit.F90) - target_link_libraries(cnvgrib PUBLIC ${PROJECT_NAME}_4) - target_link_libraries(cnvgrib PRIVATE bacio::bacio - ${JASPER_LIBRARIES} PNG::PNG ${ZLIB_LIBRARY}) + + if (BUILD_WITH_W3EMC) + add_executable(cnvgrib cnv12.F90 cnv22.F90 gds2gdt.F90 makepdsens.F90 + pds2pdtens.F90 putgbexn.F90 cnv21.F90 cnvgrib.F90 gdt2gds.F90 + makepds.F90 pds2pdt.F90 setbit.F90) + target_link_libraries(cnvgrib PUBLIC ${PROJECT_NAME}_4) + target_link_libraries(cnvgrib PRIVATE bacio::bacio w3emc::w3emc_4 + ${JASPER_LIBRARIES} PNG::PNG ${ZLIB_LIBRARY}) + install(TARGETS cnvgrib RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() add_executable(degrib2 degrib2.F90 prlevel.F90 prvtime.F90) target_link_libraries(degrib2 PUBLIC ${PROJECT_NAME}_4) @@ -57,7 +61,6 @@ if (BUILD_4) target_link_libraries(tocgrib2super PRIVATE bacio::bacio ${JASPER_LIBRARIES} PNG::PNG ${ZLIB_LIBRARY}) - if(CMAKE_C_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set_target_properties(degrib2 PROPERTIES COMPILE_FLAGS "-convert big_endian -fpp") set_target_properties(grb2index PROPERTIES COMPILE_FLAGS "-convert big_endian -fpp") @@ -66,7 +69,6 @@ if (BUILD_4) set_target_properties(grb2index PROPERTIES COMPILE_FLAGS "-fconvert=big-endian -cpp") endif() - install(TARGETS cnvgrib RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS degrib2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS grb2index RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS tocgrib2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})