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

Allow relative paths for ip_sources() and ip_include_directories(), r… #110

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

Risto97
Copy link
Contributor

@Risto97 Risto97 commented Dec 12, 2024

…elative paths are converted to absolute relative to ${CMAKE_CURRENT_SOURCE_DIR} resolve #93

…elative paths are converted to absolute relative to ${CMAKE_CURRENT_SOURCE_DIR} resolve #93
@Risto97
Copy link
Contributor Author

Risto97 commented Dec 13, 2024

Relative paths are now allowed for ip_sources() and ip_include_directories() functions.

Functionality matches the CMake target_sources() functionality:

Changed in version 3.13: Relative source file paths are interpreted as being relative to the current source directory (i.e. CMAKE_CURRENT_SOURCE_DIR). See policy CMP0076.

And `target_include_directories()

Specified include directories may be absolute paths or relative paths. A relative path will be interpreted as relative to the current source directory (i.e. CMAKE_CURRENT_SOURCE_DIR) and converted to an absolute path before storing it in the associated target property. If the path starts with a generator expression, it will always be assumed to be an absolute path (with one exception noted below) and will be used unmodified.

Meaning all relative paths given to target_sources() and target_include_directories() are converted immediately to absolute paths relative to CMAKE_CURRENT_SOURCE_DIR variable.

In short this is now possible

add_ip(test)
target_sources(${IP}
    test1.sv
)

@Risto97 Risto97 merged commit 5166025 into develop Dec 17, 2024
1 check passed
@Risto97 Risto97 deleted the rel_paths branch December 17, 2024 17:50
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.

ip_sources() allow relative file paths (include directories)
1 participant