Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,22 +380,41 @@ include\(\"${CMakeProject_BINARY_DIR}/cmake_install.cmake\")

set(CMAKE_INSTALL_MESSAGE "NEVER")

if(APPLE)
set(distribution_root "${CMakeProject_BINARY_DISTRIBUTION_DIR}/CMake.app/Contents")
else()
set(distribution_root "${CMakeProject_BINARY_DISTRIBUTION_DIR}")
endif()

# Install all files from binary distribution
file(GLOB_RECURSE binary_distribution_files
LIST_DIRECTORIES FALSE
${CMakeProject_BINARY_DISTRIBUTION_DIR}/*
${distribution_root}/*
)
foreach(file IN LISTS binary_distribution_files)
# Skip symlinks like "CMake.app/Contents/Frameworks/QtWidgets.framework/Versions/Current"
if(IS_SYMLINK ${file})
continue()
endif()

# skip some mac app bundle files
set(find_index -1)
foreach(name IN ITEMS CodeResources Info.plist Frameworks _CodeSignature MacOS PlugIns Resources doc/cmake/html man)
string(FIND "${file}" "${distribution_root}/${name}" find_index)
if("${find_index}" EQUAL 0)
break()
endif()
endforeach()
if("${find_index}" EQUAL 0)
continue()
endif()

get_filename_component(directory ${file} DIRECTORY)
file(RELATIVE_PATH relative_directory ${CMakeProject_BINARY_DISTRIBUTION_DIR} ${directory})
file(RELATIVE_PATH relative_directory ${distribution_root} ${directory})
set(type FILES)
if(relative_directory STREQUAL "bin")
set(type PROGRAMS)
endif()
# Skip symlinks like "CMake.app/Contents/Frameworks/QtWidgets.framework/Versions/Current"
if(IS_SYMLINK ${file})
continue()
endif()
set(_permissions)
get_filename_component(filename ${file} NAME)
if(filename MATCHES "ccmake|cmake|cmake-gui|cpack|ctest")
Expand Down
3 changes: 0 additions & 3 deletions src/cmake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
if os.path.exists(_cmake_data):
CMAKE_DATA = _cmake_data

if sys.platform.startswith("darwin"):
CMAKE_DATA = os.path.join(CMAKE_DATA, 'CMake.app', 'Contents')

CMAKE_BIN_DIR = os.path.join(CMAKE_DATA, 'bin')
CMAKE_DOC_DIR = os.path.join(CMAKE_DATA, 'doc')
CMAKE_SHARE_DIR = os.path.join(CMAKE_DATA, 'share')
Expand Down