Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake install target and package config #195

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ set(SOURCES
QZXing_global.h
)

SET(INSTALL_HEADERS
QZXing.h
QZXing_global.h
)

if(QZXING_MULTIMEDIA)

LIST(APPEND SOURCES QZXingFilter.cpp QZXingFilter.h)
LIST(APPEND INSTALL_HEADERS QZXingFilter.h)
add_definitions(-DQZXING_MULTIMEDIA)

SET(QZXING_USE_QML ON)
Expand All @@ -35,6 +41,7 @@ endif(QZXING_MULTIMEDIA)

if(QZXING_USE_QML)
LIST(APPEND SOURCES QZXingImageProvider.cpp QZXingImageProvider.h)
LIST(APPEND INSTALL_HEADERS QZXingImageProvider.h)
add_definitions(-DQZXING_QML)
endif(QZXING_USE_QML)

Expand Down Expand Up @@ -85,3 +92,7 @@ target_include_directories(qzxing
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

# Install files
install(TARGETS qzxing EXPORT qzxing-config DESTINATION lib)
install(FILES ${INSTALL_HEADERS} DESTINATION include/qzxing)
install(EXPORT qzxing-config DESTINATION lib/cmake/qzxing)