diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a213736..2493be0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ endif() # User options. option(OPENMP "use OpenMP threading" ON) +option(LINK_W3EMC "Link w3emc library" ON) # Find packages. find_package(MPI REQUIRED) diff --git a/src/tave.fd/CMakeLists.txt b/src/tave.fd/CMakeLists.txt index 70905a0b..1d4cd1d4 100644 --- a/src/tave.fd/CMakeLists.txt +++ b/src/tave.fd/CMakeLists.txt @@ -10,8 +10,13 @@ endif() set(exe_name tave.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 +if(LINK_W3EMC) + target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 w3emc::w3emc_d g2::g2_d) +else() + target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + g2::g2_d) +endif() install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/vint.fd/CMakeLists.txt b/src/vint.fd/CMakeLists.txt index 118faab2..a9d21699 100644 --- a/src/vint.fd/CMakeLists.txt +++ b/src/vint.fd/CMakeLists.txt @@ -10,8 +10,13 @@ endif() set(exe_name vint.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 - w3emc::w3emc_d - g2::g2_d) +if(LINK_W3EMC) + target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + w3emc::w3emc_d + g2::g2_d) +else() + target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + g2::g2_d) +endif() install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})