jacksonliam / mjpg-streamer

Fork of http://sourceforge.net/projects/mjpg-streamer/
3.01k stars 1.23k forks source link

Advanced Compilation insructions missing a cd ../ #325

Open johnsall opened 2 years ago

johnsall commented 2 years ago

The instructions in the Advanced Compilation section are missing a step to go up a dir after the cmake command. Running make in that folder mseses up the installation

sarnold commented 2 years ago

Cmake is a little "finicky" as far as where you run which cmake build commands; it should work both ways, either from the source directory or from a (temp) build directory. In this case there's an extra wrinkle from the subdirectory in the source folder. Also the following examples use the cmake-cleanup PR (see the tox.ini file on that branch).

Example using mjpg-streamer; run all commands from the repo root dir:

cd mjpg-streamer
cmake -S mjpg-streamer-experimental -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DWXP_COMPAT=OFF
cmake --build build --target install -j $(nproc)

or:

Run the build using ctest in a single command:

cd mjpg-streamer/mjpg-streamer-experimental
ctest --build-generator "Unix Makefiles" --build-and-test . build --build-options -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DWXP_COMPAT=OFF --test-command ctest -V --timeout 1