summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api_test/CMakeLists.txt4
-rw-r--r--src/CMakeLists.txt8
2 files changed, 8 insertions, 4 deletions
diff --git a/api_test/CMakeLists.txt b/api_test/CMakeLists.txt
index b1c8499..f868d01 100644
--- a/api_test/CMakeLists.txt
+++ b/api_test/CMakeLists.txt
@@ -4,10 +4,6 @@ add_executable(api_test
harness.h
main.c
)
-include_directories(
- ${PROJECT_SOURCE_DIR}/src
- ${PROJECT_BINARY_DIR}/src
-)
if(CMARK_SHARED)
target_link_libraries(api_test libcmark)
else()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 257fbe0..c315bca 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -72,6 +72,10 @@ if (CMARK_SHARED)
# Include minor version and patch level in soname for now.
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
VERSION ${PROJECT_VERSION})
+ target_include_directories(${LIBRARY} INTERFACE
+ $<INSTALL_INTERFACE:include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
generate_export_header(${LIBRARY}
BASE_NAME ${PROJECT_NAME})
@@ -86,6 +90,10 @@ if (CMARK_STATIC)
OUTPUT_NAME "cmark$<$<BOOL:MSVC>:_static>"
POSITION_INDEPENDENT_CODE ON
VERSION ${PROJECT_VERSION})
+ target_include_directories(${STATICLIBRARY} INTERFACE
+ $<INSTALL_INTERFACE:include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
if (NOT CMARK_SHARED)
generate_export_header(${STATICLIBRARY}