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

GHI #18 Fix and polish CMake #19

Merged
merged 18 commits into from
Oct 21, 2023
Merged

Conversation

doodspav
Copy link
Owner

@doodspav doodspav commented Oct 21, 2023

The few visible changes made:

  • renamed create_test(...) to _create_test(...)
  • added create_bt(...) and create_ut(...)
  • BTs are skipped if patomic::patomic isn't available and can't be found
  • UTs are skipped if patomic_test isn't build as a sub-project of patomic (because patomic sets PATOMIC_{BINARY, SOURCE}_DIR variables for the UTs to find the required files)
  • gmock currently not linked because it breaks automatic test lookup (might add later once there's a pipeline)

doodspav added 18 commits June 16, 2023 09:12
- introduce `package_name` and `target_name` variables and use these where appropriate (i.e. without confusing reviewers about what values some variables hold)
- replace `InstallConfig.cmake` with `in/patomic-config.cmake.in`
- only include targets file in config file if target isn't already defined
- add summary table in `OptionVariables.cmake`
- change PATH cache variables to STRING so that there aren't issues if they're set on the command line
- changed installed CMake names to kebab-case
- include `GNUInstallDirs` after setting `CMAKE_INSTALL_INCLUDEDIR` cache variable to avoid interfering with pre-existing one (previously changes didn't take effect)
- add `/` at the end of the directory paths in `install(...)`, or CMake is unhappy
…esPath.cmake`

- previously would do stuff if HOST was Windows even if TARGET wasn't windows
- fixed by checking TARGET system
- expected by `patomic-test`, but always set by `patomic` if tests are enabled
- if not set, UTs are disabled since we don't have access to required source files
- UT requires PATOMIC_{BINARY, SOURCE}_DIR variables are set (but these are private, so only works if patomic_test is a sub-project of patomic)
- BT requires patomic::patomic target is available
- define PATOMIC_STATIC_DEFINE to disable visibility macros
- otherwise will have issues of using the wrong import/export specification (because including a header file without telling CMake we're an importer so that it sets the correct defines)
- not an issue since we don't link against any libraries in UTs

Signed-off-by: doodspav <[email protected]>
- breaks test lookup on Windows
- and not sure that it would work on older CMake versions anyway since there's no `GTest::GMock` target

Signed-off-by: doodspav <[email protected]>
- start with a CML file in `/src`
- unfortunately can't put one in `/include` because it would be available to users as well
@doodspav doodspav self-assigned this Oct 21, 2023
@doodspav doodspav enabled auto-merge (squash) October 21, 2023 17:10
@doodspav doodspav disabled auto-merge October 21, 2023 17:12
@doodspav doodspav merged commit e15fe7e into develop Oct 21, 2023
@doodspav doodspav deleted the feature/ghi-18-fix-cmake-stuff branch October 21, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant