diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a79576b5..ebe46d9fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -666,7 +666,11 @@ if((NOT DEFINED HDF5_PLUGIN_PATH) OR ("${HDF5_PLUGIN_PATH}" STREQUAL "")) string(REPLACE "\\" "/" AUP "$ENV{ALLUSERSPROFILE}") set(HDF5_PLUGIN_PATH "${AUP}/hdf5/lib/plugin") else() - set(HDF5_PLUGIN_PATH "/usr/local/hdf5/lib/plugin") + if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(HDF5_PLUGIN_PATH "/usr/local/hdf5/lib/plugin") + else() + set(HDF5_PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/hdf5/lib/plugin") + endif(NOT DEFINED CMAKE_INSTALL_PREFIX) endif() set(ENV{HDF5_PLUGIN_PATH} "${HDF5_PLUGIN_PATH}") endif() @@ -696,7 +700,7 @@ if(NETCDF_ENABLE_PLUGIN_INSTALL) endif(DEFINED ENV{HDF5_PLUGIN_PATH}) message(STATUS "Defaulting to -DPLUGIN_INSTALL_DIR=${NETCDF_PLUGIN_INSTALL_DIR}") endif() -endif(ENABLE_PLUGIN_INSTALL) +endif(NETCDF_ENABLE_PLUGIN_INSTALL) if(ENABLE_PLUGIN_INSTALL) # Use the lowest priority dir in the path