diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-18 18:18:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-23 16:27:16 +0300 |
commit | afb74149c16ab0bb43b157db170ef2e48f7f8558 (patch) | |
tree | d1b2345a5dd3edf3f6cd2f11e68d156e89fd37e0 | |
parent | ddad2f8672598c591267a77d76138ca6d820cd7c (diff) |
Cleanup: consistent variable names for install target directories
-rw-r--r-- | source/creator/CMakeLists.txt | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 5b01280c1c2..6d217b54488 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -301,47 +301,46 @@ set(BLENDER_TEXT_FILES # ----------------------------------------------------------------------------- -# Platform Specific Var: TARGETDIR_VER +# Platform specific target destinations for version dir, libs, bpy, text files. if(UNIX AND NOT APPLE) if(WITH_PYTHON_MODULE) if(WITH_INSTALL_PORTABLE) + set(TARGETDIR_BPY .) set(TARGETDIR_VER ${BLENDER_VERSION}) else() + set(TARGETDIR_BPY ${PYTHON_SITE_PACKAGES}) set(TARGETDIR_VER ${PYTHON_SITE_PACKAGES}/${BLENDER_VERSION}) endif() else() if(WITH_INSTALL_PORTABLE) set(TARGETDIR_VER ${BLENDER_VERSION}) + set(TARGETDIR_TEXT .) else() set(TARGETDIR_VER share/blender/${BLENDER_VERSION}) + set(TARGETDIR_TEXT share/doc/blender) endif() endif() elseif(WIN32) set(TARGETDIR_VER ${BLENDER_VERSION}) + set(TARGETDIR_TEXT .) elseif(APPLE) if(WITH_PYTHON_MODULE) if(WITH_INSTALL_PORTABLE) - set(BPY_INSTALL_DIR) set(TARGETDIR_VER $<TARGET_FILE_DIR:blender>/../Resources/${BLENDER_VERSION}) - # Keep the `BLENDER_VERSION` folder and bpy.so in the build folder. - set(INSTALL_BPY_TO_SITE_PACKAGES OFF) else() - # Parent directory of bpy.so for installation. - set(BPY_INSTALL_DIR ${PYTHON_LIBPATH}/site-packages) - # Defined in terms of site-packages since the site-packages + # Paths defined in terms of site-packages since the site-packages # directory can be a symlink (brew for example). - set(TARGETDIR_VER "${BPY_INSTALL_DIR}/../Resources/${BLENDER_VERSION}") - set(INSTALL_BPY_TO_SITE_PACKAGES ON) + set(TARGETDIR_BPY ${PYTHON_LIBPATH}/site-packages) + set(TARGETDIR_VER ${TARGETDIR_BPY}/../Resources/${BLENDER_VERSION}) endif() else() set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION}) + set(TARGETDIR_TEXT Blender.app/Contents/Resources/text) endif() - # License, copyright, readme files. - set(BLENDER_TEXT_FILES_DESTINATION "${TARGETDIR_VER}/../text") - set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib") + # Skip relinking on cpack / install set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true) endif() @@ -480,12 +479,12 @@ if(UNIX AND NOT APPLE) if(WITH_INSTALL_PORTABLE) install( TARGETS blender - DESTINATION "." + DESTINATION ${TARGETDIR_BPY} ) else() install( TARGETS blender - LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES} + LIBRARY DESTINATION ${TARGETDIR_BPY} ) endif() # none of the other files are needed currently @@ -525,8 +524,6 @@ if(UNIX AND NOT APPLE) DESTINATION "." ) endif() - - set(BLENDER_TEXT_FILES_DESTINATION ".") else() # main blender binary install( @@ -560,7 +557,6 @@ if(UNIX AND NOT APPLE) DESTINATION bin ) endif() - set(BLENDER_TEXT_FILES_DESTINATION share/doc/blender) endif() if(WITH_PYTHON) @@ -720,9 +716,6 @@ if(UNIX AND NOT APPLE) ) endif() elseif(WIN32) - - set(BLENDER_TEXT_FILES_DESTINATION ".") - install( FILES ${LIBDIR}/epoxy/bin/epoxy-0.dll DESTINATION "." @@ -1114,6 +1107,7 @@ elseif(APPLE) ${TARGETDIR_VER}/python/lib ) + # Install Python executable. install( PROGRAMS ${PYTHON_EXECUTABLE} DESTINATION ${TARGETDIR_VER}/python/bin @@ -1129,13 +1123,11 @@ elseif(APPLE) unset(_py_inc_suffix) endif() - if(WITH_PYTHON_MODULE) - if(INSTALL_BPY_TO_SITE_PACKAGES) - install( - TARGETS blender - LIBRARY DESTINATION ${BPY_INSTALL_DIR} - ) - endif() + if(WITH_PYTHON_MODULE AND TARGETDIR_BPY) + install( + TARGETS blender + LIBRARY DESTINATION ${TARGETDIR_BPY} + ) endif() if(WITH_DRACO) @@ -1149,7 +1141,7 @@ endif() # ----------------------------------------------------------------------------- # Generic Install, for all targets -if(DEFINED BLENDER_TEXT_FILES_DESTINATION) +if(DEFINED TARGETDIR_TEXT) configure_file( ${CMAKE_SOURCE_DIR}/release/text/readme.html @@ -1162,13 +1154,13 @@ if(DEFINED BLENDER_TEXT_FILES_DESTINATION) install( FILES ${BLENDER_TEXT_FILES} - DESTINATION "${BLENDER_TEXT_FILES_DESTINATION}" + DESTINATION "${TARGETDIR_TEXT}" ) install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/license - DESTINATION "${BLENDER_TEXT_FILES_DESTINATION}" + DESTINATION "${TARGETDIR_TEXT}" ) endif() @@ -1176,7 +1168,7 @@ endif() delayed_do_install(${TARGETDIR_VER}) unset(BLENDER_TEXT_FILES) -unset(BLENDER_TEXT_FILES_DESTINATION) +unset(TARGETDIR_TEXT) # ----------------------------------------------------------------------------- |