From f9ff4ec8bdf6e72ed766cb8f11ff3d352aa7f15a Mon Sep 17 00:00:00 2001 From: Mudream Date: Tue, 9 Mar 2021 00:10:00 +0800 Subject: [PATCH 1/3] Win10 works --- CMakeLists.txt | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0578f67..6f8d4f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,11 +69,12 @@ target_link_libraries(cablin # Installation install(TARGETS cablin - LIBRARY - DESTINATION lib) + DESTINATION lib + COMPONENT cablin_runtime) install(DIRECTORY include/mukyu/cablin - DESTINATION include/mukyu/cablin) + DESTINATION include/mukyu/cablin + COMPONENT cablin_dev) # ---------- # Interpreter @@ -89,3 +90,22 @@ add_subdirectory(example) # Unit Test add_subdirectory(tests) + +# ---------- +# Packaging support +# ref: https://cliutils.gitlab.io/modern-cmake/chapters/install/packaging.html + +set(CPACK_PACKAGE_VENDOR "Cablin") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cablin") +set(CPACK_PACKAGE_VERSION_MAJOR 0) +set(CPACK_PACKAGE_VERSION_MINOR 1) +set(CPACK_PACKAGE_VERSION_PATCH 0) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") + +set(CPACK_COMPONENTS_ALL cablin_runtime cablin_dev) + +set(CPACK_SOURCE_GENERATOR "ZIP") +set(CPACK_SOURCE_IGNORE_FILES ${CMAKE_SOURCE_DIR}/.git) + +include(CPack) From 401aa5a4abbab4b43da489110949c5ccee91ca20 Mon Sep 17 00:00:00 2001 From: Mudream Date: Tue, 9 Mar 2021 21:10:36 +0800 Subject: [PATCH 2/3] Fix --- CMakeLists.txt | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f8d4f5..d6d86fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,11 +70,11 @@ target_link_libraries(cablin install(TARGETS cablin DESTINATION lib - COMPONENT cablin_runtime) + COMPONENT cablin) -install(DIRECTORY include/mukyu/cablin - DESTINATION include/mukyu/cablin - COMPONENT cablin_dev) +install(DIRECTORY include/mukyu + DESTINATION include + COMPONENT cablin) # ---------- # Interpreter @@ -93,19 +93,16 @@ add_subdirectory(tests) # ---------- # Packaging support -# ref: https://cliutils.gitlab.io/modern-cmake/chapters/install/packaging.html -set(CPACK_PACKAGE_VENDOR "Cablin") +set(CPACK_PACKAGE_VENDOR "Mukyu") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cablin") -set(CPACK_PACKAGE_VERSION_MAJOR 0) -set(CPACK_PACKAGE_VERSION_MINOR 1) -set(CPACK_PACKAGE_VERSION_PATCH 0) -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") -set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -set(CPACK_COMPONENTS_ALL cablin_runtime cablin_dev) +set(CPACK_ARCHIVE_COMPONENT_INSTALL 1) +set(CPACK_COMPONENTS_ALL cablin) -set(CPACK_SOURCE_GENERATOR "ZIP") -set(CPACK_SOURCE_IGNORE_FILES ${CMAKE_SOURCE_DIR}/.git) +set(CPACK_GENERATOR "ZIP") include(CPack) From 48f50cefa9837bec0f5ff742e1bef6c2d00fc931 Mon Sep 17 00:00:00 2001 From: Mudream Date: Tue, 9 Mar 2021 21:31:07 +0800 Subject: [PATCH 3/3] Just remove versioning --- CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6d86fe..cb08c55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,14 +92,9 @@ add_subdirectory(example) add_subdirectory(tests) # ---------- -# Packaging support - -set(CPACK_PACKAGE_VENDOR "Mukyu") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cablin") -set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +# Archive support +set(CPACK_ARCHIVE_FILE_NAME "mukyu-cablin") set(CPACK_ARCHIVE_COMPONENT_INSTALL 1) set(CPACK_COMPONENTS_ALL cablin)