Skip to content

Conversation

@jacobmerson
Copy link
Collaborator

No description provided.

@jacobmerson jacobmerson requested a review from Sichao25 November 16, 2025 21:45
if(spdlog_FOUND)
if(PCMS_ENABLE_SPDLOG)
add_definitions(-DPCMS_SPDLOG_ENABLED)
target_compile_definitions(pcms_core INTERFACE -DPCMS_SPDLOG_ENABLED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both PCMS_ENABLE_SPDLOG and PCMS_SPDLOG_ENABLED, or can we use just one of them in both CMakeLists.txt and source code?

I’m also wondering if it is redundant to use both add_definitions and target_compile_definitions. Based on my understanding of cmake, add_definitions affects all targets while target_compile_definitions affects pcms_core. Does our use case require both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. We should remove add_definitions and only be using the target_compile_definitions. It is probably also better to match the name of the compile definition and cmake variable as you suggest.

This commit updates PCMS configuration options to use a configuration file. This should do a better job of ensuring that downstream applications are setting up the correct configuration options if they do not build with CMake. It also has the benefit of making it easier to identify what options PCMS was configured with without parsing the CMake package files.
@jacobmerson
Copy link
Collaborator Author

@abhiyan123 this came up in one of conversations about merging #209. The file configuration.h.in gets configured to have all of the defines instead of including them in the build process with target_add_definitions. This should make it easier to link against an installed version of pcms if you don't use CMake. Also, makes it easier to see what options pcms was configured with by just looking into that file.

@jacobmerson
Copy link
Collaborator Author

@Sichao25 this is ready for re-review.

Copy link
Contributor

@Sichao25 Sichao25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jacobmerson jacobmerson merged commit b747946 into SCOREC:develop Dec 9, 2025
4 checks passed
@jacobmerson jacobmerson deleted the cmake-issues branch December 9, 2025 21:55
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.

2 participants