Skip to content

Commit

Permalink
GH-45142: [C++] Ensure using cpp/cmake_modules/*.cmake (#45143)
Browse files Browse the repository at this point in the history
### Rationale for this change

If we use `list(APPEND)` not `list(PREPEND)` for `cpp/cmake_modules/`, `*.cmake` that doesn't exist in `cpp/cmake_modules/` may be used.

See also: https://github.com/apache/iceberg-cpp/pull/6/files#r1900075993

### What changes are included in this PR?

Use `list(PREPEND)`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* GitHub Issue: #45142

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored Jan 1, 2025
1 parent 1df4889 commit 7f3b32e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ endif()
string(TOLOWER ${CMAKE_BUILD_TYPE} LOWERCASE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")

# this must be included before the project() command, because of the way
# vcpkg (ab)uses CMAKE_TOOLCHAIN_FILE to inject its logic into CMake
Expand Down

0 comments on commit 7f3b32e

Please sign in to comment.