Commit 64ea42ec authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

chnage python path (module -> lib/pythonX.Y/site-packages)

parent fab1d78d
......@@ -25,6 +25,8 @@ if(DTK_WRAPPING_PYTHON)
find_package(PythonLibs QUIET)
if(PYTHONLIBS_FOUND)
set(DTK_PYTHON_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" CACHE PATH "install subdirectory for python modules" )
include_directories(${PYTHON_INCLUDE_DIRS})
get_filename_component(PYTHON_PATH ${PYTHON_LIBRARIES} PATH)
link_directories(${PYTHON_PATH})
......
......@@ -212,25 +212,25 @@ set(${PROJECT_NAME}_MODULES)
if(DTK_BUILD_WRAPPERS AND SIP_FOUND)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${CMAKE_SOURCE_DIR}/sip/${PROJECT_NAME}/${PROJECT_NAME}mod.sip
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
if(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${CMAKE_SOURCE_DIR}/sip/${PROJECT_NAME}/${PROJECT_NAME}mod.sip
COMMAND ln -sf ../lib/lib${PROJECT_NAME}.dylib ${PROJECT_NAME}.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -sf ../../lib${PROJECT_NAME}.dylib ${PROJECT_NAME}.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/${PROJECT_NAME}.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/${PROJECT_NAME}.so)
endif(APPLE)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${CMAKE_SOURCE_DIR}/sip/${PROJECT_NAME}/${PROJECT_NAME}mod.sip
COMMAND ln -fs ../${CMAKE_INSTALL_LIBDIR}/lib${PROJECT_NAME}.so ${PROJECT_NAME}.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -fs ../../lib${PROJECT_NAME}.so ${PROJECT_NAME}.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/${PROJECT_NAME}.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/${PROJECT_NAME}.so)
endif(UNIX AND NOT APPLE)
endif(DTK_BUILD_WRAPPERS AND SIP_FOUND)
......@@ -241,28 +241,28 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCore.i
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/modules
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtkcore.py ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtkcore.py ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/dtkcore.py)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/dtkcore.py)
if(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCore.i
COMMAND ln -sf ../lib/libdtkCore.dylib _dtkcore.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -sf ../../libdtkCore.dylib _dtkcore.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtkcore.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtkcore.so)
endif(APPLE)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCore.i
COMMAND ln -fs ../${CMAKE_INSTALL_LIBDIR}/libdtkCore.so _dtkcore.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -fs ../../libdtkCore.so _dtkcore.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtkcore.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtkcore.so)
endif(UNIX AND NOT APPLE)
endif(DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND )
......@@ -274,8 +274,8 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
foreach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCore.i
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
endforeach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
endif (DTK_WRAPPING_CSHARP)
......@@ -304,7 +304,7 @@ install(TARGETS ${PROJECT_NAME}
if(SWIG_FOUND)
if (DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION modules)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION ${DTK_PYTHON_INSTALL_PATH})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dtkCore.i DESTINATION wrp/dtkCore/)
endif()
endif()
......
......@@ -187,28 +187,28 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCoreSupport.i
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/modules
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtkcoresupport.py ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtkcoresupport.py ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
set(${PROJECT_NAME}_MODULES ${CMAKE_BINARY_DIR}/modules/dtkcoresupport.py)
set(${PROJECT_NAME}_MODULES ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/dtkcoresupport.py)
if(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCoreSupport.i
COMMAND ln -sf ../lib/libdtkCoreSupport.dylib _dtkcoresupport.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -sf ../../libdtkCoreSupport.dylib _dtkcoresupport.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtkcoresupport.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtkcoresupport.so)
endif(APPLE)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCoreSupport.i
COMMAND ln -fs ../${CMAKE_INSTALL_LIBDIR}/libdtkCoreSupport.so _dtkcoresupport.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -fs ../../libdtkCoreSupport.so _dtkcoresupport.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtkcoresupport.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtkcoresupport.so)
endif(UNIX AND NOT APPLE)
endif(DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND )
......@@ -220,8 +220,8 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
foreach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkCoreSupport.i
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
endforeach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
endif (DTK_WRAPPING_CSHARP)
......@@ -238,7 +238,7 @@ endforeach(header)
install(FILES ${${PROJECT_NAME}_HEADERS} DESTINATION include/${PROJECT_NAME})
install(FILES ${${PROJECT_NAME}_HEADERS_QTS} DESTINATION include/${PROJECT_NAME})
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION modules)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION ${DTK_PYTHON_INSTALL_PATH})
install(TARGETS ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}
......
......@@ -128,28 +128,28 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkLog.i
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/modules
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtklog.py ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtklog.py ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
set(${PROJECT_NAME}_MODULES ${CMAKE_BINARY_DIR}/modules/dtklog.py)
set(${PROJECT_NAME}_MODULES ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/dtklog.py)
if(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkLog.i
COMMAND ln -sf ../lib/libdtkLog.dylib _dtklog.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -sf ../../libdtkLog.dylib _dtklog.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtklog.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtklog.so)
endif(APPLE)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkLog.i
COMMAND ln -fs ../${CMAKE_INSTALL_LIBDIR}/libdtkLog.so _dtklog.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -fs ../../libdtkLog.so _dtklog.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtklog.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtklog.so)
endif(UNIX AND NOT APPLE)
endif(DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND )
......@@ -161,8 +161,8 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
foreach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkLog.i
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
endforeach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
endif (DTK_WRAPPING_CSHARP)
......@@ -191,7 +191,7 @@ install(TARGETS ${PROJECT_NAME}
if(SWIG_FOUND)
if (DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION modules)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION ${DTK_PYTHON_INSTALL_PATH})
install(FILES ${CMAKE_BINARY_DIR}/dtkLog.i DESTINATION wrp/dtkLog)
endif()
endif()
......
......@@ -232,25 +232,25 @@ set(${PROJECT_NAME}_MODULES)
if(DTK_BUILD_WRAPPERS AND SIP_FOUND)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkWidgets.i
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
if(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkWidgets.i
COMMAND ln -sf ../lib/libdtkWidgets.dylib dtkWidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -sf ../../libdtkWidgets.dylib dtkWidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/dtkWidgets.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/dtkWidgets.so)
endif(APPLE)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkWidgets.i
COMMAND ln -fs ../${CMAKE_INSTALL_LIBDIR}/libdtkWidgets.so dtkWidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -fs ../../libdtkWidgets.so dtkWidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/dtkWidgets.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/dtkWidgets.so)
endif(UNIX AND NOT APPLE)
endif(DTK_BUILD_WRAPPERS AND SIP_FOUND)
......@@ -261,28 +261,28 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkWidgets.i
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/modules
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtkwidgets.py ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${${PROJECT_NAME}_BINARY_DIR}/dtkwidgets.py ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving python modules to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/dtkwidgets.py)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/dtkwidgets.py)
if(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkWidgets.i
COMMAND ln -sf ../lib/libdtkWidgets.dylib _dtkwidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -sf ../../libdtkWidgets.dylib _dtkwidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtkwidgets.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtkwidgets.so)
endif(APPLE)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkWidgets.i
COMMAND ln -fs ../${CMAKE_INSTALL_LIBDIR}/libdtkWidgets.so _dtkwidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
COMMAND ln -fs ../../libdtkWidgets.so _dtkwidgets.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH})
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/modules/_dtkwidgets.so)
set(${PROJECT_NAME}_MODULES ${${PROJECT_NAME}_MODULES} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}/_dtkwidgets.so)
endif(UNIX AND NOT APPLE)
endif(DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND )
......@@ -294,8 +294,8 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
foreach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${PROJECT_SOURCE_DIR}/dtkWidgets.i
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/modules
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/modules")
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${DTK_CSHARP_SOURCE} ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}
COMMENT "-- Moving csharp ${DTK_CSHARP_SOURCE} source to ${CMAKE_BINARY_DIR}/${DTK_PYTHON_INSTALL_PATH}")
endforeach(DTK_CSHARP_SOURCE ${DTK_CSHARP_SOURCES})
endif (DTK_WRAPPING_CSHARP)
......@@ -324,7 +324,7 @@ install(TARGETS ${PROJECT_NAME}
if(SWIG_FOUND)
if (DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION modules)
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION ${DTK_PYTHON_INSTALL_PATH})
install(FILES ${CMAKE_BINARY_DIR}/dtkWidgets.i DESTINATION wrp/dtkWidgets)
endif()
endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment