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\")
380
380
381
381
set (CMAKE_INSTALL_MESSAGE "NEVER" )
382
382
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
+
383
389
# Install all files from binary distribution
384
390
file (GLOB_RECURSE binary_distribution_files
385
391
LIST_DIRECTORIES FALSE
386
- ${CMakeProject_BINARY_DISTRIBUTION_DIR } /*
392
+ ${distribution_root } /*
387
393
)
388
394
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
+
389
412
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} )
391
414
set (type FILES )
392
415
if (relative_directory STREQUAL "bin" )
393
416
set (type PROGRAMS )
394
417
endif ()
395
- # Skip symlinks like "CMake.app/Contents/Frameworks/QtWidgets.framework/Versions/Current"
396
- if (IS_SYMLINK ${file} )
397
- continue ()
398
- endif ()
399
418
set (_permissions )
400
419
get_filename_component (filename ${file} NAME )
401
420
if (filename MATCHES "ccmake|cmake|cmake-gui|cpack|ctest" )
Original file line number Diff line number Diff line change 30
30
if os .path .exists (_cmake_data ):
31
31
CMAKE_DATA = _cmake_data
32
32
33
- if sys .platform .startswith ("darwin" ):
34
- CMAKE_DATA = os .path .join (CMAKE_DATA , 'CMake.app' , 'Contents' )
35
-
36
33
CMAKE_BIN_DIR = os .path .join (CMAKE_DATA , 'bin' )
37
34
CMAKE_DOC_DIR = os .path .join (CMAKE_DATA , 'doc' )
38
35
CMAKE_SHARE_DIR = os .path .join (CMAKE_DATA , 'share' )
You can’t perform that action at this time.
0 commit comments