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

add -DCMAKE_PROJECT_INCLUDE argument #480

Conversation

leleliu008
Copy link
Contributor

close #479

add -DCMAKE_PROJECT_INCLUDE argument to allow user injecting custom code into source subproject without modifying it's source code.

for example, user may want to link static libraries, they can write following code to project-after.cmake

set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")

then pass -DCMAKE_PROJECT_INCLUDE=project-after.cmake to cmake command

then project-after.cmake will be automatically run after project() command

Reference: https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_INCLUDE.html

Signed-off-by: leleliu008 leleliu008@gmail.com

…ode into source subproject without modifying it's source code.

for example, user may want to link static libraries, they can write following code to `project-after.cmake`
```
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
```

then pass `-DCMAKE_PROJECT_INCLUDE=project-after.cmake` to cmake command

then project-after.cmake will be automatically run after `project()` command

Reference: https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_INCLUDE.html

Signed-off-by: leleliu008 <leleliu008@gmail.com>
@leleliu008 leleliu008 force-pushed the add-CMAKE_PROJECT_INCLUDE-argument-to-source-subproject branch from 0854f8b to 14ff0a8 Compare September 10, 2022 09:29
@rizsotto rizsotto merged commit 0de4847 into rizsotto:master Sep 11, 2022
@rizsotto
Copy link
Owner

Thanks @leleliu008!

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.

-DCMAKE_PROJECT_INCLUDE argument is not passed to source subproject
2 participants