Added export/install section to CMakeLists.txt

This commit is contained in:
Joseph Henry
2019-04-18 11:45:28 -07:00
parent 54c6003fce
commit b51efe44c4

View File

@@ -98,6 +98,8 @@ set (SILENCE "${SILENCE} -Wno-sign-compare")
set (SILENCE "${SILENCE} -Wno-unused-variable")
set (SILENCE "${SILENCE} -Wno-missing-field-initializers")
set (SILENCE "${SILENCE} -Wno-unused-parameter")
#set (SILENCE "${SILENCE} -Wno-nullability-completeness")
#set (SILENCE "${SILENCE} -Wno-expansion-to-defined")
set (ZT_FLAGS "${ZT_FLAGS} -DZT_USE_MINIUPNPC=1")
set (ZT_FLAGS "${ZT_FLAGS} -DZT_SOFTWARE_UPDATE_DEFAULT=0")
@@ -497,4 +499,16 @@ if (SHOULD_BUILD_TESTS)
# Simple Example
#add_executable (simple ${PROJ_DIR}/test/simple.cpp)
#target_link_libraries(simple ${STATIC_LIB_NAME})
endif ()
endif ()
# -----------------------------------------------------------------------------
# | INSTALL |
# -----------------------------------------------------------------------------
set(include_dest "include/zt")
set(main_lib_dest "lib/zt")
set(lib_dest "${main_lib_dest}/${CMAKE_BUILD_TYPE}")
install(TARGETS ${STATIC_LIB_NAME} EXPORT ${STATIC_LIB_NAME} DESTINATION "${lib_dest}")
install(TARGETS ${STATIC_LIB_NAME} DESTINATION "${main_lib_dest}")
install(FILES ${PUBLIC_ZT_HEADERS} DESTINATION "${include_dest}")
install(EXPORT ${STATIC_LIB_NAME} DESTINATION "${lib_dest}")