--- examples/CMakeLists.txt.orig	2019-04-07 03:21:23 UTC
+++ examples/CMakeLists.txt
@@ -8,7 +8,7 @@ if (BUILD_C_BINDINGS)
     set_target_properties(flann_example_c PROPERTIES COMPILE_FLAGS -std=c99)
 
     add_dependencies(examples flann_example_c)
-    install (TARGETS flann_example_c DESTINATION bin )
+    install (TARGETS flann_example_c DESTINATION ${EXAMPLES_SUBDIR})
 endif()
 
 if (HDF5_FOUND)
@@ -22,7 +22,7 @@ if (HDF5_FOUND)
     endif()
 
     add_dependencies(examples flann_example_cpp)
-    install (TARGETS flann_example_cpp DESTINATION bin)
+    install (TARGETS flann_example_cpp DESTINATION ${EXAMPLES_SUBDIR})
 
 
     if (USE_MPI AND HDF5_IS_PARALLEL)
@@ -31,7 +31,7 @@ if (HDF5_FOUND)
         target_link_libraries(flann_example_mpi flann_cpp ${HDF5_LIBRARIES} ${MPI_LIBRARIES} ${Boost_LIBRARIES})
 
         add_dependencies(examples flann_example_mpi)
-        install (TARGETS flann_example_mpi DESTINATION bin)
+        install (TARGETS flann_example_mpi DESTINATION ${EXAMPLES_SUBDIR})
     endif()
 else()
     message("hdf5 library not found, not compiling flann_example.cpp")
