File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0
33#
44# Authors: J.P. Hutchins <jp@intercreate.io>
5+
6+ cmake_minimum_required (VERSION 3.20 )
7+ project (ic_cmake)
8+
9+ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
10+ # We're in the root, define additional targets for developers.
11+
12+ # generate a package for distribution
13+ # reference: https://www.foonathan.net/2022/06/cmake-fetchcontent/
14+ set (package_files
15+ ic.cmake
16+ LICENSE
17+ dependencies/fetch_test_cmake.cmake
18+ src/ic_bundle.cmake
19+ src/ic_project.cmake
20+ src/ic_utils.cmake
21+ )
22+ add_custom_command (
23+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}.zip
24+ COMMAND ${CMAKE_COMMAND} -E tar
25+ c ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}.zip
26+ --format=zip
27+ -- ${package_files}
28+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
29+ DEPENDS ${package_files}
30+ )
31+ add_custom_target (package
32+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}.zip
33+ )
34+ endif ()
You can’t perform that action at this time.
0 commit comments