-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use ROOT_MAIN_{SOURCE,BINARY}_DIR instead of CMAKE_{SOURCE, BINARY}_DIR. NFC #18130
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
base: master
Are you sure you want to change the base?
Conversation
f1d6c1d
to
1f217a4
Compare
Test Results 18 files 18 suites 4d 5h 42m 9s ⏱️ Results for commit a092ad5. ♻️ This comment has been updated with latest results. |
1f217a4
to
fda5934
Compare
In many places, can we instead use |
fda5934
to
f575ca6
Compare
…IR. NFC This patch renames `CMAKE_SOURCE_DIR` to `ROOT_MAIN_SOURCE_DIR` and `CMAKE_BINARY_DIR` to `ROOT_MAIN_BINARY_DIR`. The change unblocks progress on PR root-project#16751 and root-project#16211 by allowing them to disentangle the build step of building a user-specified set of components after another which was already built at an earlier stage. Supersedes: root-project#17746.
f575ca6
to
a092ad5
Compare
I intended this for a quick nfc. If you can comment on where you think this should be done I can give it a shot (perhaps in a separate pr)?
Fixed, probably we don't need that change there. |
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/bin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the top-level CMakeLists.txt
I think we should use CMAKE_PROJECT_*
after project(ROOT)
.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib) | |
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib) | |
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/bin) | |
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PROJECT_BINARY_DIR}/lib) | |
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_PROJECT_BINARY_DIR}/lib) | |
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PROJECT_BINARY_DIR}/bin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, even longer. Assuming everybody agrees with that suggestion I will do the mass rename.
endif() | ||
set(LICENSE_FILE ${ARG_LICENSE_FILE}) | ||
|
||
# ReadMe file | ||
if("${ARG_README_FILE}" STREQUAL "") | ||
set(ARG_README_FILE ${CMAKE_SOURCE_DIR}/README.rst) | ||
set(ARG_README_FILE ${ROOT_MAIN_SOURCE_DIR}/README.rst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path is likely wrong, it should probably be something inside bindings/pyroot/cppyy/
...
COMMAND ${CMAKE_COMMAND} -E copy ${ROOT_MAIN_SOURCE_DIR}/builtins/nlohmann/json.hpp ${ROOT_MAIN_BINARY_DIR}/include/nlohmann/json.hpp | ||
DEPENDS ${ROOT_MAIN_SOURCE_DIR}/builtins/nlohmann/json.hpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMMAND ${CMAKE_COMMAND} -E copy ${ROOT_MAIN_SOURCE_DIR}/builtins/nlohmann/json.hpp ${ROOT_MAIN_BINARY_DIR}/include/nlohmann/json.hpp | |
DEPENDS ${ROOT_MAIN_SOURCE_DIR}/builtins/nlohmann/json.hpp) | |
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/json.hpp ${ROOT_MAIN_BINARY_DIR}/include/nlohmann/json.hpp | |
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/json.hpp) |
This patch renames
CMAKE_SOURCE_DIR
toROOT_MAIN_SOURCE_DIR
andCMAKE_BINARY_DIR
toROOT_MAIN_BINARY_DIR
.The change unblocks progress on PR #16751 and #16211 by allowing them to disentangle the build step of building a user-specified set of components after another which was already built at an earlier stage.
Supersedes: #17746.