Skip to content

Commit 97e71e2

Browse files
committed
Cannot sign RubyAPI files from top level CMakeLists
The order in which CPack does stuff is weird as hell when subdirectories are involved, but basically It adds the install(CODE ) commands from the top level CMakeLists, which includes calling the install_codesign_script.cmake Then it includes the specific subdirectories 's cmake_install.cmake which means it'll try to sign something that wasn't installed (copied) yet!
1 parent 088e796 commit 97e71e2

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

CMake/install_codesign_script.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,6 @@ if(CMAKE_INSTALL_COMPONENT STREQUAL "CLI" OR NOT CMAKE_INSTALL_COMPONENT)
307307
)
308308
endif()
309309

310-
if(CMAKE_INSTALL_COMPONENT STREQUAL "RubyAPI" OR NOT CMAKE_INSTALL_COMPONENT)
311-
list(APPEND FILES_TO_SIGN
312-
Ruby/openstudio_modeleditor.bundle
313-
Ruby/platforms/libqcocoa.dylib
314-
)
315-
endif()
316-
317310
if(NOT FILES_TO_SIGN)
318311
message(AUTHOR_WARNING "FILES_TO_SIGN is empty")
319312
else()

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,11 @@ cpack_add_component(Python
10001000
DESCRIPTION "Support for Python Measures"
10011001
)
10021002

1003+
cpack_add_component(RubyAPI
1004+
DISPLAY_NAME "Ruby API"
1005+
DESCRIPTION "The Ruby openstudio modeleditor for Sketchup"
1006+
)
1007+
10031008
add_custom_target(PACKAGE_DEBUG
10041009
COMMAND ${CMAKE_CPACK_COMMAND} --debug --verbose --config CPackConfig.cmake
10051010
COMMENTS "Build package with debug and verbose output"

ruby/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,21 @@ if(APPLE)
101101
install(FILES $<TARGET_FILE_DIR:openstudio_modeleditor_rb>/QtWidgets.framework DESTINATION Ruby COMPONENT "RubyAPI")
102102
install(FILES $<TARGET_FILE_DIR:openstudio_modeleditor_rb>/QtXml.framework DESTINATION Ruby COMPONENT "RubyAPI")
103103
# install(FILES $<TARGET_FILE_DIR:openstudio_modeleditor_rb>/$<TARGET_FILE_NAME:openstudio::openstudiolib> DESTINATION Ruby COMPONENT "RubyAPI")
104+
105+
if(CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION)
106+
107+
set(FILES_TO_SIGN
108+
Ruby/openstudio_modeleditor.bundle
109+
Ruby/platforms/libqcocoa.dylib
110+
)
111+
112+
# Codesign inner binaries and libraries, in the CPack staging area for the current project & component
113+
# Define some required variables for the script in the scope of the install(SCRIPT) first
114+
install(CODE "set(CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION \"${CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION}\")" COMPONENT "RubyAPI")
115+
install(CODE "set(CPACK_CODESIGNING_MACOS_IDENTIFIER \"${CPACK_CODESIGNING_MACOS_IDENTIFIER}\")" COMPONENT "RubyAPI")
116+
install(CODE "set(FILES_TO_SIGN \"${FILES_TO_SIGN}\")" COMPONENT "RubyAPI")
117+
install(SCRIPT "${CMAKE_CURRENT_LIST_DIR}/../CMake/install_codesign_script.cmake" COMPONENT "RubyAPI")
118+
endif()
104119
endif()
105120

106121
###############################################################################

0 commit comments

Comments
 (0)