Skip to content

Commit 71f746c

Browse files
committed
cmake: Include include directory for subtree builds
1 parent 5431b9d commit 71f746c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ endif()
3131
get_target_property(use_pic secp256k1 POSITION_INDEPENDENT_CODE)
3232
set_target_properties(secp256k1_precomputed PROPERTIES POSITION_INDEPENDENT_CODE ${use_pic})
3333

34-
target_include_directories(secp256k1 PUBLIC
34+
target_include_directories(secp256k1 INTERFACE
35+
# Add the include path for parent projects so that they don't have to manually add it.
36+
$<BUILD_INTERFACE:$<$<NOT:$<BOOL:${PROJECT_IS_TOP_LEVEL}>>:${PROJECT_SOURCE_DIR}/include>>
3537
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
3638
)
3739
set_target_properties(secp256k1 PROPERTIES

0 commit comments

Comments
 (0)