Hyperspectral imaging entails data typically spanning hundreds of contiguous wavebands in a certain spectral range. Each spatial point in hyperspectral images is therefore represented by a vector whose entries correspond to the intensity on each spectral band. Hyperspectral imaging enables object and feature detection, classification, or identification based on their spectral characteristics. Novel architectures have been developed for the acquisition of compressive spectral images with just a few coded aperture focal plane array measurements. This work focuses on the development of a target detection approach in hyperspectral images directly from compressive measurements without first reconstructing the full data cube that represents the real image. The estimated sparse vector is obtained by solving a sparsity-constrained optimization problem and it is then used to directly determine if the test pixel is a target pixel. Simulations show that it is possible to perform certain transformations to the dictionaries used in traditional target detection, in order to achieve an accurate image representation in the compressed subspace.