Itseez/opencv — pull request #1551 by alalek (2013-10-02 17:27:54+00:00)
Title: (2.4 only) CMake configuration update

- Update cmake 'install' target for Windows platform (added / to paths);
- Refactored dependencies resolver in OpenCVModule.cmake;
- Refactored OpenCVConfig.cmake to allow standalone samples build (without OpenCV sources, only via `find_package(OpenCV)`). Major change is: paths to libraries are replaced to CMake targets;

Minor updates:
- Copy .pdb files for static libraries (to resolve LNK4099 warnings);
- Eliminate some warnings in samples on Windows builds (from #1401).

#### How to test build of samples via find_package:

Create 3 directories:
- `opencv` with opencv source tree,
- `opencv_build`
- `samples_build`

From `opencv_build` run:

```
cmake -G"Visual Studio 10 Win64" -DINSTALL_CREATE_DISTRIB=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DENABLE_SSE=ON -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF ../opencv
cmake --build . --config debug --target install
cmake --build . --config release --target install
```

From `samples_build` run:

```
set OPENCV_DIR=%CD%/../opencv_build/install/
cmake -G"Visual Studio 10 Win64" "-DOpenCV_DIR=%OPENCV_DIR%" -DBUILD_SHARED_LIBS=ON ../opencv/samples
cmake --build . --config release
```

Find samples binaries in `samples_build/{c|cpp|ocl|gpu}/release`