Skip to content

Commit 3f9dd73

Browse files
committed
Add cpack
1 parent 9981428 commit 3f9dd73

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

CMakeLists.txt

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.22)
22

33
project(jsonata
4-
VERSION 1.0.0
4+
VERSION 0.1.0
55
DESCRIPTION "JSONata for C++"
66
LANGUAGES CXX
77
)
@@ -260,3 +260,49 @@ if(JSONATA_BUILD_TESTS)
260260
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
261261
)
262262
endif()
263+
264+
# ----------------------------------------------------------------------------
265+
# Source packaging (CPack)
266+
# ----------------------------------------------------------------------------
267+
268+
# Basic package metadata
269+
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
270+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
271+
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
272+
273+
# Create a source tar.gz suitable for GitHub Releases and FetchContent_Declare
274+
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
275+
set(CPACK_SOURCE_PACKAGE_FILE_NAME "v${PROJECT_VERSION}")
276+
set(CPACK_SOURCE_TOPLEVEL_TAG OFF)
277+
278+
# Ignore typical build and VCS artifacts in the source package
279+
set(CPACK_SOURCE_IGNORE_FILES
280+
# VCS / tooling
281+
"/\\.git/"
282+
"/\\.github/"
283+
"/\\.idea/"
284+
"/\\.vscode/"
285+
"\\.DS_Store$"
286+
"~$"
287+
"\\.swp$"
288+
"\\.swo$"
289+
"\\.tmp$"
290+
291+
# CMake/build outputs
292+
"/_CPack_Packages/"
293+
"/\\.cache/"
294+
"/build/"
295+
"/build-.*?/"
296+
"/CMakeFiles/"
297+
"/CMakeFiles$"
298+
"/CMakeCache\\.txt$"
299+
"/cmake_install\\.cmake$"
300+
"/Makefile$"
301+
"/Testing/"
302+
"/install_manifest\\.txt$"
303+
304+
# Generated tests
305+
"/test/gen/"
306+
)
307+
308+
include(CPack)

0 commit comments

Comments
 (0)