Hi,
You can opt-out freenect2 from rtabmap compilation:
cd rtabmap/build
cmake -DWITH_FREENECT2=OFF .
cmake --build . --config Release
but... did you install RTAB-Map binaries with the installer or zip from the release? This package is not really meant to be used as library for other apps.
If you want to test loop closure detection alone, you can use RTAB-Map app, then in Preferences->RTAB-Map Settings, uncheck "Activate metric RGB-D SLAM". If you want to use rtabmap library for loop closure deteciton in another project (and thus really building the
loop closure example), you will need to rebuild rtabmap from source as you will need development files from third party libraries (like PCL and OpenCV). Building rtabmap on Ubuntu is the easiest, on windows you can look at this file, which shows a
recipe to build rtabmap with all dependencies on windows.
cheers,
Mathieu