Skip to content

Commit

Permalink
Use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed Oct 28, 2024
1 parent 597e49c commit eee52c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ find_package(pybind11 REQUIRED)

pybind11_add_module(acquire_zarr acquire-zarr-py.cpp)

target_include_directories(acquire_zarr PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_include_directories(acquire_zarr PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(acquire_zarr PRIVATE acquire-zarr)

set_target_properties(acquire_zarr PROPERTIES
Expand Down
6 changes: 3 additions & 3 deletions src/streaming/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ add_library(${tgt}

target_include_directories(${tgt}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/logger>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/logger>
)

target_link_libraries(${tgt} PRIVATE
Expand All @@ -60,6 +60,6 @@ install(TARGETS ${tgt}
)

# Install public header files
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION include
)
4 changes: 2 additions & 2 deletions tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ foreach (name ${tests})
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
target_include_directories(${tgt} PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src/logger
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/src/logger
)
target_link_libraries(${tgt} PRIVATE
acquire-logger
Expand Down
6 changes: 3 additions & 3 deletions tests/unit-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ foreach (name ${tests})
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
target_include_directories(${tgt} PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src/logger
${CMAKE_SOURCE_DIR}/src/streaming
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/src/logger
${PROJECT_SOURCE_DIR}/src/streaming
)
target_link_libraries(${tgt} PRIVATE
acquire-logger
Expand Down

0 comments on commit eee52c1

Please sign in to comment.