Skip to content

Commit

Permalink
fix: Set INTERFACE_INCLUDE_DIRECTORIES in CMake config (#379)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Arnold Loubriat <datatriny@gmail.com>
  • Loading branch information
mwcampbell and DataTriny committed Apr 14, 2024
1 parent 0efcfb1 commit 2b52701
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 0 additions & 6 deletions bindings/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ You can then require AccessKit as a dependency by adding this to your `CMakeList
find_package(ACCESSKIT REQUIRED)
```

The headers can be added like so:

```cmake
include_directories(YourProject ${ACCESSKIT_INCLUDE_DIR})
```

Finally, link the library to your executable:

```cmake
Expand Down
8 changes: 8 additions & 0 deletions bindings/c/accesskit-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ set_property(
TARGET accesskit-static
PROPERTY IMPORTED_LOCATION "${_accesskit_static_lib}"
)
set_property(
TARGET accesskit-static
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${ACCESSKIT_INCLUDE_DIR}"
)
if (_accesskit_os STREQUAL "macos")
target_link_libraries(accesskit-static INTERFACE "-framework AppKit" "-framework Foundation" "-framework CoreFoundation" objc c++)
elseif (_accesskit_os STREQUAL "linux")
Expand Down Expand Up @@ -35,6 +39,10 @@ set_property(
TARGET accesskit-shared
PROPERTY IMPORTED_LOCATION "${ACCESSKIT_LIBRARIES_DIR}/shared/${_accesskit_shared_lib}"
)
set_property(
TARGET accesskit-shared
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${ACCESSKIT_INCLUDE_DIR}"
)

if (BUILD_SHARED_LIBS)
target_link_libraries(accesskit INTERFACE accesskit-shared)
Expand Down
1 change: 0 additions & 1 deletion bindings/c/examples/sdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ project(sdl_example)
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
find_package(ACCESSKIT REQUIRED)
include_directories(windows_example ${ACCESSKIT_INCLUDE_DIR})

add_executable(hello_world hello_world.c)
target_link_libraries(hello_world PUBLIC ${SDL2_LIBRARIES})
Expand Down
1 change: 0 additions & 1 deletion bindings/c/examples/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.20)
project(windows_example)

find_package(ACCESSKIT REQUIRED)
include_directories(windows_example ${ACCESSKIT_INCLUDE_DIR})

add_executable(hello_world hello_world.c)
target_link_libraries(hello_world PUBLIC accesskit)
Expand Down

0 comments on commit 2b52701

Please sign in to comment.