From eaac3429f0f88686c7da0630bcdb9d1aea94c4f0 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Fri, 10 May 2019 10:39:27 -0700 Subject: [PATCH] Re-worked the CMakeLists.txt install section --- CMakeLists.txt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a67292..549318a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -505,18 +505,12 @@ endif () # | INSTALL | # ----------------------------------------------------------------------------- -set(PUBLIC_ZT_HEADERS +set (PUBLIC_ZT_HEADERS ${PROJECT_SOURCE_DIR}/include/ZeroTier.h ${PROJECT_SOURCE_DIR}/include/ZeroTierConstants.h) -set(PUBLIC_ZTCORE_HEADERS - ${PROJECT_SOURCE_DIR}/ext/ZeroTierOne/include/ZeroTierOne.h) - -set(include_dest "include") -set(main_lib_dest "lib") -set(lib_dest "${main_lib_dest}/${CMAKE_BUILD_TYPE}") -install(TARGETS ${STATIC_LIB_NAME} EXPORT ${STATIC_LIB_NAME} DESTINATION "${lib_dest}") -install(TARGETS ${DYNAMIC_LIB_NAME} EXPORT ${DYNAMIC_LIB_NAME} DESTINATION "${lib_dest}") -install(FILES ${PUBLIC_ZT_HEADERS} DESTINATION "${include_dest}") -install(FILES ${PUBLIC_ZTCORE_HEADERS} DESTINATION "${include_dest}") -install(EXPORT ${STATIC_LIB_NAME} DESTINATION "${lib_dest}") +set_target_properties(${STATIC_LIB_NAME} PROPERTIES PUBLIC_HEADER "${PUBLIC_ZT_HEADERS}") +install (TARGETS ${STATIC_LIB_NAME} + LIBRARY DESTINATION "lib" + PUBLIC_HEADER DESTINATION "include" +)