File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -380,22 +380,41 @@ include\(\"${CMakeProject_BINARY_DIR}/cmake_install.cmake\")
380380
381381 set (CMAKE_INSTALL_MESSAGE "NEVER" )
382382
383+ if (APPLE )
384+ set (distribution_root "${CMakeProject_BINARY_DISTRIBUTION_DIR} /CMake.app/Contents" )
385+ else ()
386+ set (distribution_root "${CMakeProject_BINARY_DISTRIBUTION_DIR} " )
387+ endif ()
388+
383389 # Install all files from binary distribution
384390 file (GLOB_RECURSE binary_distribution_files
385391 LIST_DIRECTORIES FALSE
386- ${CMakeProject_BINARY_DISTRIBUTION_DIR } /*
392+ ${distribution_root } /*
387393 )
388394 foreach (file IN LISTS binary_distribution_files)
395+ # Skip symlinks like "CMake.app/Contents/Frameworks/QtWidgets.framework/Versions/Current"
396+ if (IS_SYMLINK ${file} )
397+ continue ()
398+ endif ()
399+
400+ # skip some mac app bundle files
401+ set (find_index -1)
402+ foreach (name IN ITEMS CodeResources Info.plist Frameworks _CodeSignature MacOS PlugIns Resources doc /cmake/html man)
403+ string (FIND "${file} " "${distribution_root} /${name} " find_index)
404+ if ("${find_index} " EQUAL 0)
405+ break ()
406+ endif ()
407+ endforeach ()
408+ if ("${find_index} " EQUAL 0)
409+ continue ()
410+ endif ()
411+
389412 get_filename_component (directory ${file} DIRECTORY )
390- file (RELATIVE_PATH relative_directory ${CMakeProject_BINARY_DISTRIBUTION_DIR } ${directory} )
413+ file (RELATIVE_PATH relative_directory ${distribution_root } ${directory} )
391414 set (type FILES )
392415 if (relative_directory STREQUAL "bin" )
393416 set (type PROGRAMS)
394417 endif ()
395- # Skip symlinks like "CMake.app/Contents/Frameworks/QtWidgets.framework/Versions/Current"
396- if (IS_SYMLINK ${file} )
397- continue ()
398- endif ()
399418 set (_permissions)
400419 get_filename_component (filename ${file} NAME )
401420 if (filename MATCHES "ccmake|cmake|cmake-gui|cpack|ctest" )
Original file line number Diff line number Diff line change 3030 if os .path .exists (_cmake_data ):
3131 CMAKE_DATA = _cmake_data
3232
33- if sys .platform .startswith ("darwin" ):
34- CMAKE_DATA = os .path .join (CMAKE_DATA , 'CMake.app' , 'Contents' )
35-
3633CMAKE_BIN_DIR = os .path .join (CMAKE_DATA , 'bin' )
3734CMAKE_DOC_DIR = os .path .join (CMAKE_DATA , 'doc' )
3835CMAKE_SHARE_DIR = os .path .join (CMAKE_DATA , 'share' )
You can’t perform that action at this time.
0 commit comments