-
Notifications
You must be signed in to change notification settings - Fork 45
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
Allow packages to use project() #582
Comments
I will take care of this when I extend the TriBITS example/test case TribitsExampleProject2/packages/packages1/ to use a raw CMake build system to be TriBITS-compliant for an internal build with calling no TriBITS code. |
…ject (TriBITSPub#582) Now we can update TriBITS and the raw Package1 build system for it to work as a TriBITS package but without calling any TriBITS macros or functions.
This makes the documentation ad code a little more clear. As part of this, I renamed the function `tribits_write_package_client_export_files_install_targets()` to ` tribits_write_package_client_export_files_export_and_install_targets()`. That makes it a little more clear what these functions are doing.
NOTE: This does not pass all of the existing tests yet but the new tests pass.
…w CMake (TriBITSPub#582) This raw CMake build mode for Package1 uses no TriBITS macros, functions, or other functionality at all. The only change to TriBITS-proper were: * Skip check for not calling tribits_package_postprocess() if the `<Package>::all_libs` target is already defined. * Build up the list of package libraries target for the `<Project>_libs` target from `<Package>::all_libs` instead of `<Package>_libs`. This seems to pass all of the TriBITS tests.
…stall_targets() (#582) Don't know how this was allowed to merge given that the build of the docs was broken by the renaming of `tribits_write_package_client_export_files_install_targets()` to `tribits_write_package_client_export_files_export_and_install_targets()`. But this fixes that.
…stall_targets() (TriBITSPub#582) Don't know how this was allowed to merge given that the build of the docs was broken by the renaming of `tribits_write_package_client_export_files_install_targets()` to `tribits_write_package_client_export_files_export_and_install_targets()`. But this fixes that.
…stall_targets() (TriBITSPub#582) Don't know how this was allowed to merge given that the build of the docs was broken by the renaming of `tribits_write_package_client_export_files_install_targets()` to `tribits_write_package_client_export_files_export_and_install_targets()`. But this fixes that.
…ject (TriBITSPub#582) Now we can update TriBITS and the raw Package1 build system for it to work as a TriBITS package but without calling any TriBITS macros or functions.
This makes the documentation ad code a little more clear. As part of this, I renamed the function `tribits_write_package_client_export_files_install_targets()` to ` tribits_write_package_client_export_files_export_and_install_targets()`. That makes it a little more clear what these functions are doing.
NOTE: This does not pass all of the existing tests yet but the new tests pass.
…w CMake (TriBITSPub#582) This raw CMake build mode for Package1 uses no TriBITS macros, functions, or other functionality at all. The only change to TriBITS-proper were: * Skip check for not calling tribits_package_postprocess() if the `<Package>::all_libs` target is already defined. * Build up the list of package libraries target for the `<Project>_libs` target from `<Package>::all_libs` instead of `<Package>_libs`. This seems to pass all of the TriBITS tests.
…ject (TriBITSPub#582) Now we can update TriBITS and the raw Package1 build system for it to work as a TriBITS package but without calling any TriBITS macros or functions.
This makes the documentation ad code a little more clear. As part of this, I renamed the function `tribits_write_package_client_export_files_install_targets()` to ` tribits_write_package_client_export_files_export_and_install_targets()`. That makes it a little more clear what these functions are doing.
NOTE: This does not pass all of the existing tests yet but the new tests pass.
…w CMake (TriBITSPub#582) This raw CMake build mode for Package1 uses no TriBITS macros, functions, or other functionality at all. The only change to TriBITS-proper were: * Skip check for not calling tribits_package_postprocess() if the `<Package>::all_libs` target is already defined. * Build up the list of package libraries target for the `<Project>_libs` target from `<Package>::all_libs` instead of `<Package>_libs`. This seems to pass all of the TriBITS tests.
…ject (TriBITSPub#582) Now we can update TriBITS and the raw Package1 build system for it to work as a TriBITS package but without calling any TriBITS macros or functions.
This makes the documentation ad code a little more clear. As part of this, I renamed the function `tribits_write_package_client_export_files_install_targets()` to ` tribits_write_package_client_export_files_export_and_install_targets()`. That makes it a little more clear what these functions are doing.
Allow TriBITS package TribitsExampleProject/Package1 to use 100% raw CMake and update TriBITS to allow that. This raw CMake build mode for Package1 uses no TriBITS macros, functions, or other functionality at all. The only changes to TriBITS-proper needed to allow this were: * Skip check for not calling tribits_package_postprocess() if the `<Package>::all_libs` target is already defined. * Build up the list of package libraries target for the `<Project>_libs` target from `<Package>::all_libs` instead of `<Package>_libs` (since the latter does not exist for a raw CMake package). This seems to pass all of the TriBITS tests. NOTE: This commit does **not** yet contain the changes to TriBITS to allow calling project() in the package's CMakeLists.txt files and still use TriBITS macros in the package's CMakeLists.txt files. Those changes will come later as we add an example that calls some TriBITS functions.
…ject (TriBITSPub#582) Now we can update TriBITS and the raw Package1 build system for it to work as a TriBITS package but without calling any TriBITS macros or functions.
This makes the documentation ad code a little more clear. As part of this, I renamed the function `tribits_write_package_client_export_files_install_targets()` to ` tribits_write_package_client_export_files_export_and_install_targets()`. That makes it a little more clear what these functions are doing.
Allow TriBITS package TribitsExampleProject/Package1 to use 100% raw CMake and update TriBITS to allow that. This raw CMake build mode for Package1 uses no TriBITS macros, functions, or other functionality at all. The only changes to TriBITS-proper needed to allow this were: * Skip check for not calling tribits_package_postprocess() if the `<Package>::all_libs` target is already defined. * Build up the list of package libraries target for the `<Project>_libs` target from `<Package>::all_libs` instead of `<Package>_libs` (since the latter does not exist for a raw CMake package). This seems to pass all of the TriBITS tests. NOTE: This commit does **not** yet contain the changes to TriBITS to allow calling project() in the package's CMakeLists.txt files and still use TriBITS macros in the package's CMakeLists.txt files. Those changes will come later as we add an example that calls some TriBITS functions.
…ject (TriBITSPub#582) Now we can update TriBITS and the raw Package1 build system for it to work as a TriBITS package but without calling any TriBITS macros or functions.
This makes the documentation ad code a little more clear. As part of this, I renamed the function `tribits_write_package_client_export_files_install_targets()` to ` tribits_write_package_client_export_files_export_and_install_targets()`. That makes it a little more clear what these functions are doing.
…riBITSPub#582) Makes it more clear what is needed for an internal package and an external package.
…riBITSPub#582) This will allow me to exclude parts that I don't want to show in the developers guide. NOTE: The only reas the test file TribitsExampleProject2_Tests.cmake is updated is because I took 'a' out of 'in a raw'.
…riBITSPub#582) This will allow me to exclude parts that I don't want to show in the developers guide. NOTE: The only reas the test file TribitsExampleProject2_Tests.cmake is updated is because I took 'a' out of 'in a raw'.
…ub#582) This change was made several years ago but we forgot to update this documentation.
Several things were done here: * Added new section "How to implement a TriBITS-compliant internal package using raw CMake" * Added new section "How to implement a TriBITS-compliant external package using raw CMake" * Added subsection on example project TribitsExampleProject2 under the "Example TriBITS Projects" section. * Added generation of reduced versions of the package1/CMakeLists.raw.cmake file for different cases. (But will only trigger a re-make if the generated files change.) * Added make dependencies on generated *.cmake files * generate-guide.sh: Added time to 'make' command and discard STDOUT for 'cd -' command (makes output look better)
…riBITSPub#582) Now just calls tribits_set_cache_var_and_default() then mark_as_advanced(). Suggested by @KyleFromKitware
…iBITSPub#582) This commit exposes the bug described in: https://gitlab.kitware.com/cmake/cmake/-/issues/25157 and provides the suggested print statements by Brad King.
…riBITSPub#582) This will allow me to exclude parts that I don't want to show in the developers guide. NOTE: The only reas the test file TribitsExampleProject2_Tests.cmake is updated is because I took 'a' out of 'in a raw'.
…ub#582) This change was made several years ago but we forgot to update this documentation.
Several things were done here: * Added new section "How to implement a TriBITS-compliant internal package using raw CMake" * Added new section "How to implement a TriBITS-compliant external package using raw CMake" * Added subsection on example project TribitsExampleProject2 under the "Example TriBITS Projects" section. * Added generation of reduced versions of the package1/CMakeLists.raw.cmake file for different cases. (But will only trigger a re-make if the generated files change.) * Added make dependencies on generated *.cmake files * generate-guide.sh: Added time to 'make' command and discard STDOUT for 'cd -' command (makes output look better)
…riBITSPub#582) Now just calls tribits_set_cache_var_and_default() then mark_as_advanced(). Suggested by @KyleFromKitware
Allow 100% raw CMake to be used in a TriBITS-compliant package (#582)
@masterleinad, would you be willing to review the documentation and examples on how to use 100% raw CMake to create a TriBITS-compliant internal and external package: ? Specifically, can you please review the documentation and examples at: ? |
…bits This brings in the following TriBITS PRs: * TriBITSPub/TriBITS#591: Allow 100% raw CMake to be used in a TriBITS-compliant package (TriBITSPub/TriBITS#582) * TriBITSPub/TriBITS#588: gitdist: Pass in '-c color.status=always' when --dist-no-color is not added * TriBITSPub/TriBITS#590: Fix: gitdist: dist-repo-status: Display tag or SHA1 instead of 'HEAD' * TriBITSPub/TriBITS#587: gitdist: dist-repo-status: Display tag or SHA1 instead of 'HEAD' * TriBITSPub/TriBITS#586: More cleanup of packaging support (trilinos#11976) This goes back to TriBITS commits from June 2023.
See #591 (reference) for some quick feedback. |
This improves the message as suggested by @masterleinad in the review of PR configured "within a TriBITS project" but is not really being configured "with TriBITS". (Package1 is being configured with 100% raw CMake, it just happens to be configured under a TriBITS project.)
When using raw CMake inside of this package, this is a resolved issue as of the merge of PR: However, if using TriBITS functions inside of the package, then some more work would need to be done (to differentiate the TriBITS project name and base source and binary directories from the most recent call to So, this should address the Kokkos use case. |
trilinos/Trilinos#11779 explores using Kokkos as a native CMake project within
Trilinos
'TriBITS
build system. In the process, I noticed thattribits_package_postprocess
doesn't work properly if the package usesproject()
, see https://github.com/trilinos/Trilinos/pull/11779/files#r1196855222, sinceTriBITS/tribits/core/package_arch/TribitsPackageMacros.cmake
Line 870 in b669da7
would report that the code is executed at the top level instead of at the package level and then set
${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS
in the same scope instead of in the parent scope.Using
$(CMAKE_PROJECT_NAME}_SOURCE_DIR)
instead of$(PROJECT_NAME}_SOURCE_DIR)
fixes this for me.Note that there might be more cases where it would be more appropriate to check for
CMAKE_PROJECT_NAME
instead ofPROJECT_NAME
but this appears sufficient for my case.The text was updated successfully, but these errors were encountered: