This paper discusses how the state-of-the-art techniques in cyber-physical systems facilitate building smart warehouses to achieve the promising vision of industry 4.0. We focus on four significant issues when applying CPS techniques in smart warehouses. First, efficient CPS data collection: when limited communication bandwidth meets numerous CPS devices, we need to make more effort to study efficient wireless communication scheduling strategies. Second, accurate and robust localization: localization is the basis for many fundamental operations in smart warehouses, but still needs to be improved from various aspects like accuracy and robustness. Third, human activity recognition: human activity recognition can be applied in human-computer interaction for remote machine operations. Fourth, multi-robot collaboration: smart robots will take the place of humans to accomplish most tasks particularly in a harsh environment, and smart and fully-distributed robot collaborating algorithms should be investigated. Finally, we point out some challenging issues in the future CPS-based smart warehouse, which could open some new research directions.