fpagliughi / sockpp

Modern C++ socket library.
BSD 3-Clause "New" or "Revised" License
782 stars 126 forks source link

How to build documentation using CMake #36

Closed paul35621 closed 4 years ago

paul35621 commented 4 years ago

I installed Doxygen and Graphiz (because it first said "doxygen missing components: dot") and I'm trying this on Windows:

mkdir build
cd build
cmake ..
cmake -D SOCKPP_BUILD_DOCUMENTATION=ON --build .

But no HTML files are appearing anywhere in the build directory. How does this work?

My output is:

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
-- The C compiler identification is MSVC 19.24.28314.0
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Creating static library: sockpp-static
-- Configuring done
-- Generating done
-- Build files have been written to: C:/software/sockpp/build
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
-- Creating static library: sockpp-static
-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.17 (b5fa3cd1c6e6240e20d3b80a70e3f04040b32021*)") found components:  doxygen dot
-- Configuring done
-- Generating done
-- Build files have been written to: C:/software/sockpp/build

I discovered that I could simply run doxygen to generate the documentation, but that should be in the README file. (or putting the documentation online, that would be better)

fpagliughi commented 4 years ago

As long as CMake can find Doxygen, this should be no problem. And your system appears to be finding it, so that's good.

With CMake, I believe that you just need to set all your options in the first (configuration) step, and not in the second (build) step. So this should work:

mkdir build
cd build
cmake -DSOCKPP_BUILD_DOCUMENTATION=ON ..
cmake --build .

ls doc/doc/html/index.html 
paul35621 commented 4 years ago

That does work. Thanks!