Coder Social home page Coder Social logo

cpfcmake's Introduction

Welcome to CPFCMake

Please note that this project is in an early state of development. Interfaces are not stable.

Package documentation

cpfcmake's People

Contributors

knitschi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

cpfcmake's Issues

Find out if we can simplify or get rid of the config-dependent command and argument file mechanism.

The mechanism for executing commands that have a configuration specific output is complicated and bug-prone. Especcially the escaping of special characters is hard to get right. The mechanism was implemented as a workaround for the problem that add_custom_command() does not support generator expressions in its OUTPUT argument.
Maybe we can use mitigate the problem by.

  • Wrapping command lists with generator expressions. ; in generator expressions has become possible i think.
  • Executing multiple commands instead of one with many arguments, to get rid of argument file mechanism.

If cmake should implement generator expressions in OUTPUT we may able to get rid of this completely.

Add a code formatting target.

The CPF should provide a target that formats the source files with a given ruleset. This task is about finding a tool that does that and than implement a target that runs the tools. Cross-platform tools should be preferred.

  • ClangFormat is such a tool, but I think it only works on Linux.

Make sure the generate step is out-dated when the config file changes

Currently users have to manually reexecute the 2_Generate.py <config> command in order to make changes in the config file apply to the project. This is annoying when these changes occur often, like when changing the name of the executed test.

Maybe including the config file in the cpfInit.cmake file will do the trick.

Add support for interface libraries to cpfAddPackage()

CMake 3.11 enabled the use of custom target properties for interface libraries. This should allow us to create interface libraries via the cpfAddPackage() calls that have the usual custom properties of the CPF.
The task is to enhance cpfAddPackage() that it can be used in the libSwitchWarningsOff package.

  • The minimum cmake version must then be increased to 3.11

Packaging and install target redesign.

  • Do not create package install targets and run them in the pipeline. Instead use the install script commands with set install prefix to assemble the package content.
  • Use the COMPONENT option of the install() command to handle different package content types.
  • Do not set the install prefix cmake variable, because we no longer need it.

Add code coverage target for Linux.

Currently the pipeline can only create test coverage reports on Windows using OpenCppCoverage. We should add a target that does the same on Linux.

Notes:

  • There are options for gcc that enable producing .gcda files. Those file can be used by a tool called lcov.
    article
  • There also is a CMake module for that toolchain: CTestCoverageCollectGCOV
  • research for other posibilities.

Remove the need for a fresh generate step after changing the config file.

Currently the the user needs to do a 2_Generate.py <config> after making changes to the config file.
This can easily be forgotten and it would be more convenient if changes had effect without the need for a second manual step. We should find out if this is possible, without getting negative side-effects.

Remove or clean up function cpfRemoveWarningFlagsForSomeExternalFiles()

The function reduces the warning level for a hard-coded source-file which is added by linking to the staticly compiled qt hunter package via the INTERFACE_SOURCES property. The code suggests that this is only a problem on Linux.

The function should at least remove the hard-coded filename and lower the warning-level on all imported INTERFACE_SOURCES. What is the correct solution?

Add tests for abi-compliance-checker targets.

These tests require some extra thoughts because we must find a way to provide the CPF with previously created distribution packages. We have to see if we can simply add a file location as the web-page address.
If this works we can add a TestData directory that provides the download directory structure of the webpage.

Investigate other documentation pipelines.

I am not completely happy with Doxygen. I do not like the style of the output and I lack the skills to create my own css file which may make it better.

Problems with Doxygen:

  • The default style lets the content have the same width as the browser window. IMO a limitation of the content to a smaller width looks better and is easier to read. I lack the skill to create a css file that fixes the problem and I could not find any usefull css files for doxygen on the web.
  • The default generated content of class descriptions is visually cluttered.
  • Can it automatically create an index for free pages?

Good things about Doxygen:

  • Integration of graphviz and plantuml which allows creating diagrams.

We could either look at other doxygen based projects how to improve the default style, or use a different generator. Doxygens documentation itself seams to be heavily customized. Other examples are linked in the doxygen docs http://www.stack.nl/~dimitri/doxygen/results.html

Other alternatives could be:

  • Doxygen + Sphinx + Breathe example ceres solver
  • Can the Qt documentation pipeline be used by clients? QDoc does not read documentation from .cpp files.

Make the Windows + Ninja + MSVC configuration work.

The last time i tried this I had errors because there seemed to be parallel access to some debug info databases. However Visual Studio's CMake mode uses Ninja out of the box. So it should work. Why did it not work for me? Is the /MD option vorbidden with Ninja?

Check out clazy.

Clazy is a clang based tool that does static analysis of C++/Qt code. This task is to investigate if it is usefull enough to justify a clazy target in the CPF pipeline.

  • Run the tool manually on a big enough qt project an see what kind of errors it finds.

Implement a mechanism that allows switching between precompiled and inlined packages.

The CPF should provide the developer with the option to consume a CPF package dependencie via precompiled binaries or by including its sources into the source tree. The first option is usefull to reduce compile times when a package is rarely changed. The second option is of advantage if the package is changed regularly because of the current working activity of the developer. Enabling this switch by only changing a CMake variable seems to be usefull in day to day development.

The idea was first brought up here: ruslo/hunter#932
I currently believe that this should not be implemented in hunter but rather in the CPF. Hunter can in general not guarantee that a package can be inlined, while CPF packages can be designed to be inlineable.

The mechanism would have to change a git-submodule dependency to a hunter dependency and back.
The cpf would have to know how a repository based dependency can be transformed into a dependency on the distribution package.

Problems to solve

  • CPF packages must be inlinable. This means it should not make a difference if package targets are imported or added via add_subdirectroy(). To achieve this we can use alias targets to create targets with
    the same name of imported targets.
  • It would be helpfull and maybe even necessary to have 'decentralized' hunter packages. With that I mean packages that can be used with hunter without adding them to the hunter repository directly.
  • It would be helpfull and maybe necessary if hunter would support a mode where it can be pointed to
    a git repository + commit instead of a .tar.gz release package.

Possibly related discussions on hunter for "decentralized" packages and git-repo packages.

Let the user choose a compatibility scheme for libraries

The CPF currently implements only the "exact same version" compatibility scheme. It may be useful for general use if the user could also choose between "same patch version", "same minor version" and "same major version" schemes. This would require changes to the install commands where a scheme is selected for the packages .cmake files. It may also have an effect on the api-checker targets. It will also have an effect on the installed symbolic links on linux which are involved in implementing the compatibility scheme.

Consider using a CMakeSettings.json file like it is used in VS2017 instead of using our own cpfCIBuildConfigurations.json and <config>.cmake files.

VS2017 in CMake mode allows keeping multiple configurations in a CMakeSettings.json file.
It more or less holds the information that we now keep in our .cmake file + cmake command line arguments.

If we could use that format we would support Visual Studio out of the box. Our .json file however also contains information about on which system the build should happen. Can this information be added to the CMakeSettings.json file without breaking it?

Exchange global doxygen target with per-package targets.

Currently doxygen is run on the whole CI-project which will not scale for big projects. Doxygen has the ability to generate indexes for single packages and than combine the results with another call. This approach was first used when implementing the documentation target, but it turned out that this functionality was buggy at the time. Bugreport. The result is not the same when using this method compared to one global call of doxygen.

If the global doxygen target turns out to be a problem we may need to revisit this problem.

Use more specific names for per-package targets.

Rename targets

  • staticAnalysis_ -> clang-tidy. The clang tidy target should also checkt that clang is used as the compiler.
  • dynamicAnalysis_ -> Split up in opencppcoverage and valgrind.
  • documentation_ -> doxygen
  • versionCompatibilityChecks_ -> abi-compliance-checker-report, abi-compliance-checker-api-check, abi-compliance-checker-abi-check

This should increase the transparency what is actually done by the target. Maybe it is useful to add an extra global bundle target with the special name.

Add auto generated statistics page to html output.

It would be nice to have a page that displays project statistics like lines-of-code or git statistics.
For lines of code we could use cloc on Linux. Does it create html pages?

  • What other tools are they and do they generate html pages?
  • Implement custom targets to run the tools.

Investigate if deployed source file can be found automatically by .pdb files.

The goal of the investigation is to manually construct a solution that allows debugging packages without the need of manually searching for source files in the Visual Studio pop-up dialog.

Because .pdb files hold only absolute pathes to the .cpp file that belongs to them, the source files of a package are not automatically found when debugging into a package. It somehow seems to be possible to specify a source file server command in the .pdb file which is intended to load sources from a central server.
Maybe this mechanism can be high-checked to load sources from a relative path in the package.

More Information:
https://www.codeproject.com/Articles/245824/Sourcepack-indexing-PDB-files-with-source-archive
https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md

If this is possible, create a task for implementing the solution in CPFCMake.

Consider using install( ... COMPONENT ... ) to handle the package content type.

Currently the different content types are handled with custom targets and the install() commands install the developer files. We should consider using the COMPONENT option of the install command to handle various file. Components could be

  • runtime: executables and shared libraries.
  • developer: libs, public-header, pdb files and source files on windows.
  • sources: all source files
  • docs: generated documentation

Allow using the same dependency in different versions.

For very large projects it must be possible to have different versions of a library in the dependency tree at the same time. If this is not allowed, all clients of the library must be updated at the same time when the library version changes. This does not scale. Allowing multiple versions of one library at the same time allows updating one client at a time in non global steps.

  • To allow this the package directory names have to include the version number in order to allow multiple parallel packages. This would require an automatic mechanism that adds the git-submodules instead of the currently used manual maintanance.
  • Does hunter/cmake support multiple target versions at the same time? This is required before the problem can be solved.

Factor the doxygen target out in its own package.

The target is currently added by calling cpfAddGlobalMonolithicDocumentationTarget() in cpfAddPackages(). We should move this in a separate CMakeLists file and add the function call there.
Then we can add all global doxygen files to that package and re-use them for other build-projects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.