Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CMake files to better support nmos-cpp as a library #2

Closed
wants to merge 107 commits into from

Commits on Aug 2, 2021

  1. Configuration menu
    Copy the full SHA
    0e21566 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aabcac1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c3bbfcd View commit details
    Browse the repository at this point in the history
  4. Use CMAKE_CURRENT_BINARY_DIR in CMake module/prefix path to support a…

    …dd_subdirectory(.../nmos-cpp/Development)
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    bfcfb56 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    18ebb15 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    780f11b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    48e721d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    37fad65 View commit details
    Browse the repository at this point in the history
  9. Initial refactor to do more with CMake targets and use fewer variable…

    …s; get rid of link_directories and most of the include_directories
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    fb2be0c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1382e05 View commit details
    Browse the repository at this point in the history
  11. Add a slog INTERFACE target to make clearer which of the other target…

    …s depend on it
    
    (e.g. there are some question marks in the code as to whether lldp and mdns libs should or not)
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    8c83982 View commit details
    Browse the repository at this point in the history
  12. Use target_compile_definitions rather than fiddling with CMAKE_CXX_FL…

    …AGS for specific definitions and add_compile_options or add_definitions for almost all other cases that are more general
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    c7bad85 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    bb6e78b View commit details
    Browse the repository at this point in the history
  14. Mark some of the target library dependencies as PRIVATE, where those …

    …dependencies' interface definitions, etc. don't need to be transitively applied
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    b0bcdc4 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    fec796d View commit details
    Browse the repository at this point in the history
  16. Confusingly, Boost_LIBRARIES is provided by the CMake FindBoost.cmake…

    … module and recently also by Conan for most generators (cmake_find_package for example) so Linux and Visual Studio "Open folder" work fine, but with cmake_find_package_multi (which we've traditionally used to generate multi-configuration Visual Studio solutions) it isn't, so map the required components to targets instead
    
    Same seems to be true for OPENSSL_INCLUDE_DIR and WEBSOCKETPP_INCLUDE_DIR
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    74d4e90 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    bd3fc53 View commit details
    Browse the repository at this point in the history
  18. Move /ignore:4099 into nmos-cpp target so that not every executable n…

    …eeds to do it (seems no worse than force disabling compiler warnings)
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    a01451b View commit details
    Browse the repository at this point in the history
  19. Move _WIN32_WINNT into the nmos-cpp::Boost target and add the missing…

    … dependency to mdns and lldp
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    de5a0c7 View commit details
    Browse the repository at this point in the history
  20. Protect call to enable_testing so it's only executed if this is the t…

    …op-level project (see PROJECT_IS_TOP_LEVEL in CMake 3.21)
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    af1dcc4 View commit details
    Browse the repository at this point in the history
  21. Change the default for bst::shared_mutex, etc. to be to use Boost

    (it'd still be better to auto-detect in the long run)
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    03853e9 View commit details
    Browse the repository at this point in the history
  22. Missing initializers

    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    46581b8 View commit details
    Browse the repository at this point in the history
  23. Remove the directory prefixes from the included files that are in the…

    … same directory, and rely on searching the directory where the current file is found, in order to avoid the need for the project root directory to be in the include path
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    001acce View commit details
    Browse the repository at this point in the history
  24. At last, use target_include_directories rather than include_directori…

    …es for the whole directory/project
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    ce4ce46 View commit details
    Browse the repository at this point in the history
  25. Add a version check for Conan to get a sensible error message - e.g. …

    …the Boost recipe uses features from at least 1.33.0
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    4b6de18 View commit details
    Browse the repository at this point in the history
  26. Tease apart the platform-specific dependencies on additional platform…

    …/system libs, Boost components, Bonjour and PCAP, so that (next) each target's dependencies can be brought together
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    9d19cb2 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    8d2f349 View commit details
    Browse the repository at this point in the history
  28. Boost has to come before cpprestsdk because the config of the latter …

    …checks Boost_VERSION_COMPONENTS
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    2f3eccb View commit details
    Browse the repository at this point in the history
  29. Split the creation of the dependency targets out from the common CMak…

    …e and compiler config; the CACHE variables are still spread through the files, but BUILD_LLDP, the only one that affects _what_ is built rather than _how_, is now in the top-level CMakeLists.txt
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    7057616 View commit details
    Browse the repository at this point in the history
  30. Now that add_subdirectory(.../nmos-cpp/Development <binary_dir> EXCLU…

    …DE_FROM_ALL) behaves in a sane fashion, get rid of NMOS_CPP_DIR and just use current source-directory-relative paths
    garethsb committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    5c7e462 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2021

  1. Rename FIND_PACKAGE_USE_CONFIG to FIND_PACKAGE_MODE (to indicate eith…

    …er not defined/empty or CONFIG or MODULE)
    garethsb committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    3e26d39 View commit details
    Browse the repository at this point in the history
  2. Bump required CMake version to 3.13 since I started using target_link…

    …_directories in the initial refactor(fb2be0c) and recently also target_link_options - remember to update docs
    garethsb committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    c7558dd View commit details
    Browse the repository at this point in the history
  3. Simplify config of DNSSD target and install dns_sd.h with the patched…

    … Windows build of dnssd.lib
    garethsb committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    556f91b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    12fbb76 View commit details
    Browse the repository at this point in the history
  5. Try to workaround "CMake Error at cmake/NmosCppDependencies.cmake:257…

    … (install): install FILES given no DESTINATION!" on Windows in GitHub Actions
    garethsb committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    f23ef72 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8365dd0 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f3f63e4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d597900 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    64ec003 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    15c1e2d View commit details
    Browse the repository at this point in the history
  11. Bump CMake version

    garethsb committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    5a73eba View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0c0812a View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2021

  1. Introduce BUILD_EXAMPLES and BUILD_TESTS to configure whether nmos-cp…

    …p-tests and nmos-cpp-node and nmos-cpp-registry are built - both ON by default
    
    Mark some of the existing cache variables as advanced
    garethsb committed Aug 4, 2021
    Configuration menu
    Copy the full SHA
    3c8b03f View commit details
    Browse the repository at this point in the history
  2. Bump requirement to CMake 3.15 to be able to use CMAKE_FIND_PACKAGE_P…

    …REFER_CONFIG and bring the Conan-related config of CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH into NmosCppConan.cmake
    garethsb committed Aug 4, 2021
    Configuration menu
    Copy the full SHA
    e731544 View commit details
    Browse the repository at this point in the history
  3. Add "external" example app in the Sandbox that demonstrates how to us…

    …e find_package(nmos-cpp) or add_subdirectory(.../nmos-cpp/Development)
    garethsb committed Aug 4, 2021
    Configuration menu
    Copy the full SHA
    1d54989 View commit details
    Browse the repository at this point in the history
  4. Add missing description

    garethsb committed Aug 4, 2021
    Configuration menu
    Copy the full SHA
    3ea7c6d View commit details
    Browse the repository at this point in the history
  5. CMake format tweaks

    garethsb committed Aug 4, 2021
    Configuration menu
    Copy the full SHA
    f2e7724 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2021

  1. Clean up as now requiring at least Conan 1.33

    (from commit 4b6de18)
    garethsb committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    8799df5 View commit details
    Browse the repository at this point in the history
  2. CMake format tweaks

    (removing a warning from cmake-lint from cheshirekow/cmake_format)
    garethsb committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    a4da8cb View commit details
    Browse the repository at this point in the history
  3. More clean up possible now that we have CMP0091/CMP0092 set to NEW vi…

    …a cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
    garethsb committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    1d18c08 View commit details
    Browse the repository at this point in the history
  4. Finally worked out how to do the dependencies from mdns on DNSSD, and…

    … from lldp on PCAP. The key was requiring CMake 3.17 to get CMP0099, transitive INTERFACE_LINK_OPTIONS for static libs. Thanks to @robertmaynard, Robert Maynard, NVIDIA.
    garethsb committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    f8282a1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e6ea855 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    44a37ee View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    18266e9 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2021

  1. Configuration menu
    Copy the full SHA
    93756ca View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8cc4554 View commit details
    Browse the repository at this point in the history
  3. Add CMAKE_INSTALL_PREFIX so administrator privileges aren't required

    Also bump Ubuntu 14.04 build to cpprestsdk v2.10.18 for consistency with the Conan builds
    garethsb committed Aug 6, 2021
    Configuration menu
    Copy the full SHA
    b01636b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e682f10 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    720360c View commit details
    Browse the repository at this point in the history
  6. Rework compiler settings as an INTERFACE target to be used as a PRIVA…

    …TE dependency
    
    (Sandbox/my-nmos-node should now build on Ubuntu 14.04)
    garethsb committed Aug 6, 2021
    Configuration menu
    Copy the full SHA
    4e365a4 View commit details
    Browse the repository at this point in the history
  7. Move /ignore:4099 into compile-settings target for greater flexibilit…

    …y (yes, it's a link setting but pah! cf. commit a01451b)
    garethsb committed Aug 6, 2021
    Configuration menu
    Copy the full SHA
    d14c8d7 View commit details
    Browse the repository at this point in the history
  8. Do not use install(TARGETS ... INCLUDES DESTINATION ${NMOS_CPP_INSTAL…

    …L_INCLUDEDIR}) since this is added explicitly for the targets that actually need it
    
    (Improves the installed nmos-cpp-targets.cmake which had some unnecessary and in many cases repeated instances of ${_IMPORT_PREFIX}/include in INTERFACE_INCLUDE_DIRECTORIES)
    garethsb committed Aug 6, 2021
    Configuration menu
    Copy the full SHA
    1771269 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2021

  1. Configuration menu
    Copy the full SHA
    dfa00b2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e6e51f7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    da8d36b View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2021

  1. Configuration menu
    Copy the full SHA
    eb48b74 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c52f1a7 View commit details
    Browse the repository at this point in the history
  3. Hmmm; this generator expression wasn't causing me problems in the Con…

    …an recipe and now it is... let's just try letting CMake do the right thing on its own...
    garethsb committed Aug 8, 2021
    Configuration menu
    Copy the full SHA
    5fb530b View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2021

  1. Configuration menu
    Copy the full SHA
    57db6d3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    91c8c6f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    18046cd View commit details
    Browse the repository at this point in the history
  4. Although zlib is required to build with websocketpp, perhaps we don't…

    … need it explicitly, because nmos-cpp code doesn't depend on it directly and the websocketpp recipe already has the dependency?
    garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    4334540 View commit details
    Browse the repository at this point in the history
  5. Add explanation in comments

    garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    dfd81c4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c5bdd1e View commit details
    Browse the repository at this point in the history
  7. Add explanation in comments

    garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    6e0f8a5 View commit details
    Browse the repository at this point in the history
  8. Back to more conventional names

    prince-chrismc authored and garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    4130e87 View commit details
    Browse the repository at this point in the history
  9. Explain unused variable

    garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    18f9306 View commit details
    Browse the repository at this point in the history
  10. No need to build unit tests

    garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    adc447b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    27adbb0 View commit details
    Browse the repository at this point in the history
  12. Since NmosCppConan.cmake checks CONAN_EXPORTED and does conan_basic_s…

    …etup if so, the wrapper CMakeLists.txt isn't required
    garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    07397ae View commit details
    Browse the repository at this point in the history
  13. Add nmos-cpp-registry and nmos-cpp-node to the path and use nmos-cpp-…

    …registry in the test_package
    garethsb committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    a3dad30 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    143dcd0 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    e3ffabb View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2021

  1. Just use the dependency config-file packages or find-module packages …

    …that were created by Conan cmake_find_package[_multi] when building nmos-cpp
    garethsb committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    54110ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f48155b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e2f1c4a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b7a9f3d View commit details
    Browse the repository at this point in the history
  5. Go back to using two different variables since semicolons are proving…

    … so problematic... Put the nmos-cpp install directory in the CMAKE_PREFIX_PATH and the build path in the CMAKE_INSTALL_PREFIX as the former should be searched before the latter by find_package
    garethsb committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    5f20d47 View commit details
    Browse the repository at this point in the history
  6. Now it's working again... to be more confident that things are being …

    …found where expected, add --debug-find to the install test
    garethsb committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    14fd435 View commit details
    Browse the repository at this point in the history
  7. ...and let's see if that still works but slims down the 7000 lines of…

    … additional logging we got from --debug-find
    garethsb committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    ce13f8a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    12a2db5 View commit details
    Browse the repository at this point in the history
  9. Restore default find locations because although the last commit's wor…

    …kflows were successful on Windows and Ubuntu 18.04 and 20.04, it failed on macOS (couldn't find CoreFoundation) and on Ubuntu 14.04 (couldn't find system-installed Boost), and the logs weren't much shorter anyway... so I'll keep --debug-find for occasional debugging!
    garethsb committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    17163c5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1d89097 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2021

  1. As a significantly less verbose option than --debug-find, generate an…

    …d dump into the console a log file of where the most important dependencies have been found
    garethsb committed Aug 11, 2021
    Configuration menu
    Copy the full SHA
    a07d4af View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2021

  1. When built with USE_ADD_SUBDIRECTORY, the Boost::, and cpprestsdk:: t…

    …argets are not available because the find-module or config-file packages use add_library() without GLOBAL for the IMPORTED targets, so the target names only have scope in the subdirectory. Rather than set the IMPORTED_GLOBAL target property explicitly somewhere in nmos-cpp itself, just generate the list of include directories directly from the my-nmos-node executable instead.
    garethsb committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    8f9801a View commit details
    Browse the repository at this point in the history
  2. Recent activity

    garethsb committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    17ec7ab View commit details
    Browse the repository at this point in the history
  3. Add NMOS_CPP_ prefix to the most important/likely to conflict CMake c…

    …ache variables, e.g. BUILD_EXAMPLES, BUILD_TESTS, USE_CONAN
    garethsb committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    088e3e2 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #4 from garethsb/library-cmake-prefix-cache-variables

    Add NMOS_CPP_ prefix to the CMake cache variables, e.g. BUILD_EXAMPLES, BUILD_TESTS, USE_CONAN
    garethsb committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    35022f8 View commit details
    Browse the repository at this point in the history
  5. Add NMOS_CPP_ cache variables to the documentation and hide more non-…

    …Conan instructions behind HTML <details>
    garethsb committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    e185b7a View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2021

  1. Configuration menu
    Copy the full SHA
    ccf738b View commit details
    Browse the repository at this point in the history
  2. If we're using Conan, find json-schema-validator package rather than …

    …building from third_party source
    
    Reorder dependencies consistently in conanfiles, NmosCppDependencies.cmake and Dependencies docs
    garethsb committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    0b7689b View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2021

  1. Rename NMOS_CPP_USE_SYSTEM_BONJOUR to NMOS_CPP_USE_BONJOUR_SDK and ad…

    …d comment to more clearly explain the rationale for building the patched dnssd.lib and that the Bonjour service and client DLL (dnssd.dll) are still required
    garethsb committed Aug 15, 2021
    Configuration menu
    Copy the full SHA
    585b518 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2021

  1. Make the delay configurable

    garethsb committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    b4c600e View commit details
    Browse the repository at this point in the history
  2. Map CMake target name to Conan component name (json-schema-validator …

    …vs. nlohmann_json_schema_validator)
    
    Fixes bug in 0b7689b
    garethsb committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    605ea4d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c899e41 View commit details
    Browse the repository at this point in the history
  4. Reinstate use of wrapper CMakeLists.txt (revert commit 07397ae and am…

    …end slightly) since the existing include in NmosCppConan.cmake didn't work for out-of-source builds, and it seems slightly more elegant to keep the as much of the Conan recipe-specific stuff alongside the conanfile.py and just "turn off" NmosCppConan.cmake in the case of CONAN_EXPORT but take no other action.
    garethsb committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    190cea9 View commit details
    Browse the repository at this point in the history
  5. Update for PR

    garethsb committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    6e692a1 View commit details
    Browse the repository at this point in the history