title: Could NOT find HDF5 during compilation (server)
body: <p>I was able to compile perfectly a code using HDF5 in my computer but now I would like to compile it in a server.</p>
  
  <p>In the server, HDF5 is well installed in the following path:</p>
  
  <blockquote>
    <p>/usr/local/HDF_Group/HDF5/1.8.17/lib/</p>
  </blockquote>
  
  <p>But I got this error during the compilation using CMake:</p>
  
  <blockquote>
    <p>CMake Error at
    /usr/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148
    (message):   Could NOT find HDF5 (missing: HDF5_LIBRARIES
    HDF5_INCLUDE_DIRS   HDF5_HL_LIBRARIES) Call Stack (most recent call
    first):<br>
    /usr/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388
    (_FPHSA_FAILURE_MESSAGE)<br>
    /usr/local/share/cmake-3.6/Modules/FindHDF5.cmake:690
    (find_package_handle_standard_args)   CMakeLists.txt:4 (FIND_PACKAGE)</p>
    
    <p>-- Configuring incomplete, errors occurred!</p>
  </blockquote>
  
  <p>The beginning of my CMakeList.txt</p>
  
  <pre><code>FIND_PACKAGE(HDF5 REQUIRED)
  
  find_package (HDF5 NAMES hdf5 COMPONENTS C static) 
  INCLUDE_DIRECTORIES
  (${HDF5_INCLUDE_DIR}) message(STATUS ${HDF5_INCLUDE_DIR})
  set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY})
  
  include_directories(/usr/local/HDF_Group/)
  link_directories(/usr/local/HDF_Group/HDF5/1.8.17/lib/)
  link_directories(/usr/local/lib)
  </code></pre>
  
  <p>Could you please help me ?As I'm not well familiar with CMake, Maybe I did not link it properly...</p>
  
  <p>Thank in advance,</p>
  
  <p><strong>EDIT: SOLVED</strong></p>
  
  <p>I solved my issue by doing this:</p>
  
  <pre><code>export HDF5_DIR=/usr/local/HDF_Group/HDF5/1.8.17/share/cmake 
  </code></pre>
  
  <p>And I added it into my /home/user/.bashrc so that I don't have to do this command line each time.</p>