Merge pull request #305 from warmwaffles/master

Allow install targets to be optionally defined
This commit is contained in:
Petri Lehtinen 2016-09-12 07:46:52 +03:00 committed by GitHub
commit f9e7aa5eeb

View File

@ -655,6 +655,8 @@ set_target_properties(jansson PROPERTIES PUBLIC_HEADER "${JANSSON_HDR_PUBLIC}")
# #
# Install targets. # Install targets.
# #
option(JANSSON_INSTALL "Generate installation target" ON)
if (JANSSON_INSTALL)
install(TARGETS jansson install(TARGETS jansson
EXPORT JanssonTargets EXPORT JanssonTargets
LIBRARY DESTINATION "${JANSSON_INSTALL_LIB_DIR}" COMPONENT lib LIBRARY DESTINATION "${JANSSON_INSTALL_LIB_DIR}" COMPONENT lib
@ -676,6 +678,7 @@ install(FILES
# Install exports for the install-tree. # Install exports for the install-tree.
install(EXPORT JanssonTargets install(EXPORT JanssonTargets
DESTINATION "${JANSSON_INSTALL_CMAKE_DIR}" COMPONENT dev) DESTINATION "${JANSSON_INSTALL_CMAKE_DIR}" COMPONENT dev)
endif()
# For use when simply using add_library from a parent project to build jansson. # For use when simply using add_library from a parent project to build jansson.
set(JANSSON_LIBRARIES jansson CACHE STRING "Jansson libraries") set(JANSSON_LIBRARIES jansson CACHE STRING "Jansson libraries")