cmake mentioned CUDA_TOOLKIT_ROOT_DIR as cmake variable, not environment one. That’s why it does not work when you put it into .bashrc. If you look into FindCUDA.cmake it clearly says that:
The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR if the prefix
cannot be determined by the location of nvcc in the system path and REQUIRED
is specified to find_package(). To use a different installed version of the
toolkit set the environment variable CUDA_BIN_PATH before running cmake
(e.g. CUDA_BIN_PATH=/usr/local/cuda1.0 instead of the default /usr/local/cuda)
or set CUDA_TOOLKIT_ROOT_DIR after configuring. If you change the value of
CUDA_TOOLKIT_ROOT_DIR, various components that depend on the path will be
relocated.
So put CUDA_BIN_PATH into .bashrc or specify CUDA_TOOLKIT_ROOT_DIR to cmake:
cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-5.5 ..