cmake: add install interface include directory

This commit is contained in:
Anonymous Maarten 2021-08-01 20:56:40 +02:00
parent 0afbdcf3e6
commit 5c2053950e
1 changed files with 2 additions and 0 deletions

View File

@ -97,12 +97,14 @@ else()
add_library(openjp2_static STATIC ${OPENJPEG_SRCS}) add_library(openjp2_static STATIC ${OPENJPEG_SRCS})
set_target_properties(openjp2_static PROPERTIES OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME}) set_target_properties(openjp2_static PROPERTIES OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME} openjp2_static) set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME} openjp2_static)
target_include_directories(openjp2_static PUBLIC $<INSTALL_INTERFACE:${OPENJPEG_INSTALL_INCLUDE_DIR}>)
else() else()
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS}) add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME}) set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
endif() endif()
endif() endif()
target_include_directories(${OPENJPEG_LIBRARY_NAME} PUBLIC $<INSTALL_INTERFACE:${OPENJPEG_INSTALL_INCLUDE_DIR}>)
if(UNIX) if(UNIX)
target_link_libraries(${OPENJPEG_LIBRARY_NAME} m) target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)
endif() endif()