Skip to content

Commit

Permalink
Add public include directory for cmake module
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Mar 20, 2020
1 parent a3a9175 commit fd1851d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions include/include.macro.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# =========== include - macro ===========
set (PROJECT_LIBCOPP_ROOT_INC_DIR ${CMAKE_CURRENT_LIST_DIR})

include_directories(${PROJECT_LIBCOPP_ROOT_INC_DIR})
6 changes: 6 additions & 0 deletions src/libcopp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ else ()
)
endif()

target_include_directories(${PROJECT_LIBCOPP_LIB_LINK}
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_LIBCOPP_ROOT_INC_DIR}>"
"$<INSTALL_INTERFACE:include>"
)

install(TARGETS ${PROJECT_LIBCOPP_LIB_LINK}
EXPORT ${PROJECT_LIBCOPP_EXPORT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
4 changes: 1 addition & 3 deletions src/libcotask/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ else ()
)
endif()

if (BUILD_SHARED_LIBS)
target_link_libraries(${PROJECT_LIBCOTASK_LIB_LINK} ${PROJECT_LIBCOPP_LIB_LINK})
endif ()
target_link_libraries(${PROJECT_LIBCOTASK_LIB_LINK} PUBLIC ${PROJECT_LIBCOPP_LIB_LINK})

install(TARGETS ${PROJECT_LIBCOTASK_LIB_LINK}
EXPORT ${PROJECT_LIBCOTASK_EXPORT_NAME}
Expand Down

0 comments on commit fd1851d

Please sign in to comment.