diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index 8c09bb5..d7e32cd 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -62,9 +62,17 @@ add_definitions(-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_INSTALL_RPATH ${QT_LIB_PATH}) -SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +if(APPLE) + set(CMAKE_MACOSX_RPATH ON) + set(CMAKE_SKIP_BUILD_RPATH FALSE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + set(CMAKE_INSTALL_RPATH ${QT_LIB_PATH}) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${QT_LIB_PATH}" isSystemDir) + if("${isSystemDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${QT_LIB_PATH}") + endif() +endif() include_directories(include)