forked from rpavlik/cmake-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindJtTk.stampkey.cmake.in
50 lines (41 loc) · 1.54 KB
/
FindJtTk.stampkey.cmake.in
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Small script to stamp the JtTk license key on an executable
#
# Original Author:
# 2009-2010 Rylie Pavlik <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright 2009-2010, Iowa State University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0
set(ENV{JTTK_DEV_PLATFORM} @BITS@)
set(ENV{JTTK_DEV_PATH} @JTTK_DEV_PATH@)
set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:@JTTK_LIBRARY_DIR@")
set(ENV{PATH} "$ENV{PATH}:@JTTK_DEV_PATH@/../bin/")
message(STATUS "The stamp commands are being run with these environment variables:")
execute_process(COMMAND ${CMAKE_COMMAND} -E environment)
set(JTTK_KEYS @JTTK_KEYS@)
foreach(_key ${JTTK_KEYS})
execute_process(COMMAND ${_command} @JTTK_STAMP_COMMAND@ ${_key} @_binary@
RESULT_VARIABLE _result)
if(NOT "${_result}" EQUAL "0")
message(STATUS "Failed (error ${_result}) running stamp command:
@JTTK_STAMP_COMMAND@ ${_key} @_binary@")
else()
message(STATUS "Succeeded running stamp command:
@JTTK_STAMP_COMMAND@ ${_key} @_binary@")
endif()
execute_process(COMMAND @JTTK_STAMP_PLATFORM_COMMAND@ ${_key} @_binary@
RESULT_VARIABLE _result)
if(NOT "${_result}" EQUAL "0")
message(STATUS "Failed (error ${_result}) running stamp command:
@JTTK_STAMP_PLATFORM_COMMAND@ ${_key} @_binary@")
else()
message(STATUS "Succeeded running stamp command:
@JTTK_STAMP_PLATFORM_COMMAND@ ${_key} @_binary@")
endif()
endforeach()