-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
36 lines (33 loc) · 1.08 KB
/
CMakeLists.txt
File metadata and controls
36 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Copyright (c) 2023 Intercreate, Inc.
# SPDX-License-Identifier: Apache-2.0
#
# Authors: J.P. Hutchins <[email protected]>
cmake_minimum_required(VERSION 3.20)
project(ic_cmake)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# We're in the root, define additional targets for developers.
# generate a package for distribution
# reference: https://www.foonathan.net/2022/06/cmake-fetchcontent/
set(package_files
ic.cmake
LICENSE
src/ic_bundle.cmake
src/ic_c_flags.cmake
src/ic_c_warnings.cmake
src/ic_project.cmake
src/ic_set_cmake_options.cmake
src/ic_utils.cmake
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.zip
COMMAND ${CMAKE_COMMAND} -E tar
c ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.zip
--format=zip
-- ${package_files}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${package_files}
)
add_custom_target(package
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.zip
)
endif()