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

Remove inconsistencies in CMake naming #15

Closed
13 tasks done
Tracked by #10
doodspav opened this issue Mar 25, 2023 · 0 comments · Fixed by #16
Closed
13 tasks done
Tracked by #10

Remove inconsistencies in CMake naming #15

doodspav opened this issue Mar 25, 2023 · 0 comments · Fixed by #16
Assignees
Labels
user story User story

Comments

@doodspav
Copy link
Owner

doodspav commented Mar 25, 2023

Description

  • Naming of variables/functions/options etc. should be consistent across the whole project

Acceptance Criteria

  • All function local variables and non-target project-local variables (not cache variables or options) should be snake_case
  • All function parameters should be ALL_CAPS and prefixed with ARG_
  • If cmake_parse_arguments is used, the prefix should be ARG
  • All public cache variables and options should be ALL_CAPS
  • All public cache variables and options should be prefixed with PATOMIC_, regardless of if they're in patomic or patomic_test project
  • All public cache variables and options should be defined in a designated .cmake file
  • All function (and macro) names shoud be snake_case
  • All .cmake file names for files required to build the project (i.e. not installed version/config files) should be PascalCase
  • All .cmake files generated for installation should be <project>PascalCase.cmake (which will end up being camelCase)
  • All project names should be snake_case
  • All target names should be snake_case prefixed with patomic_
  • Components that are not excluded from all should follow naming pattern of project_Component (e.g. patomic_Runtime)
  • Components that are excluded from all should have a name matching a target if possible, so should be snake_cast

Note: These rules are guidelines, and can be ignored in special cases if it makes sense to do so, and would be understandable to another reader.

@doodspav doodspav self-assigned this Mar 25, 2023
@doodspav doodspav added the task Small standalone task that doesn't need a parent label Mar 25, 2023
@doodspav doodspav added user story User story and removed task Small standalone task that doesn't need a parent labels Mar 25, 2023
doodspav added a commit that referenced this issue Mar 25, 2023
Options / public cache variables changed:
- `patomic_INSTALL_CMAKEDIR`     -> `PATOMIC_INSTALL_CMAKEDIR`
- `patomic_BUILD_SHARED`         -> `PATOMIC_BUILD_SHARED`
- `patomic_INCLUDES_WITH_SYSTEM` -> `PATOMIC_INCLUDES_WITH_SYSTEM`
- `patomic_BUILD_TESTING`        -> `PATOMIC_BUILD_TESTING`

Signed-off-by: doodspav <[email protected]>
doodspav added a commit that referenced this issue Mar 25, 2023
- `patomic_WARNING_GUARD` -> `warning_guard`
- `patomic_BUILD_TYPE` -> `build_type`

Removed the `patomic_` prefix since they're already scoped by the directory (and project), and don't want them to be confused for an option that we forgot to make all caps.

Signed-off-by: doodspav <[email protected]>
doodspav added a commit that referenced this issue Mar 25, 2023
- `patomic_test_CREATE_TEST_TARGETS_MATCHING` -> `PATOMIC_CREATE_TEST_TARGETS_MATCHING`
- `patomic_test_SET_CTEST_PATH_ENV_WINDOWS`   -> `PATOMIC_WINDOWS_SET_CTEST_PATH_ENV`
- `patomic_test_CREATE_WINDOWS_PATH_FILE`     -> `PATOMIC_WINDOWS_CREATE_PATH_ENV_FILE`

Change the `patomic_test` prefix to just `PATOMIC` since they're all really options to do with `patomic`, and the `test` part is obvious from the remaining option name.

Signed-off-by: doodspav <[email protected]>
doodspav added a commit that referenced this issue Mar 25, 2023
- `windows_deps_path`: `VAR` -> `ARG_VAR`

Signed-off-by: doodspav <[email protected]>
doodspav added a commit that referenced this issue Mar 25, 2023
- `CMAKE_INSTALL_INCLUDEDIR` override
- `PATOMIC_INSTALL_CMAKEDIR`

Signed-off-by: doodspav <[email protected]>
@doodspav doodspav linked a pull request Mar 25, 2023 that will close this issue
doodspav added a commit that referenced this issue Mar 25, 2023
## Scope

- make `patomic_` options all-caps
- make `patomic_test_` options all-caps, rename slightly, and remove
`test` from prefix
- make project scope variables snake-case and remove `patomic_` prefix
- prefix argument names with `ARG_`
- move all options to the relevant `OptionVariables.cmake`

---------

Signed-off-by: doodspav <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user story User story
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant