|
@@ -60,7 +60,11 @@ macro(ctkMacroCompilePythonScript)
|
|
set(file "${file}.py")
|
|
set(file "${file}.py")
|
|
endif()
|
|
endif()
|
|
|
|
|
|
- set(src "${MY_SOURCE_DIR}/${file}")
|
|
|
|
|
|
+ if(NOT IS_ABSOLUTE ${file})
|
|
|
|
+ set(src "${MY_SOURCE_DIR}/${file}")
|
|
|
|
+ else()
|
|
|
|
+ set(src "${file}")
|
|
|
|
+ endif()
|
|
set(tgt_file ${file})
|
|
set(tgt_file ${file})
|
|
if(IS_ABSOLUTE ${file})
|
|
if(IS_ABSOLUTE ${file})
|
|
set(src ${file})
|
|
set(src ${file})
|
|
@@ -73,7 +77,11 @@ macro(ctkMacroCompilePythonScript)
|
|
if(DEFINED MY_RESOURCES)
|
|
if(DEFINED MY_RESOURCES)
|
|
set(resource_input_files)
|
|
set(resource_input_files)
|
|
foreach(file ${MY_RESOURCES})
|
|
foreach(file ${MY_RESOURCES})
|
|
- set(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
|
|
|
|
|
+ if(NOT IS_ABSOLUTE ${file})
|
|
|
|
+ set(src "${MY_SOURCE_DIR}/${file}")
|
|
|
|
+ else()
|
|
|
|
+ set(src "${file}")
|
|
|
|
+ endif()
|
|
set_property(GLOBAL APPEND PROPERTY
|
|
set_property(GLOBAL APPEND PROPERTY
|
|
_CTK_${target}_PYTHON_RESOURCES "${src}|${file}|${MY_DESTINATION_DIR}")
|
|
_CTK_${target}_PYTHON_RESOURCES "${src}|${file}|${MY_DESTINATION_DIR}")
|
|
endforeach()
|
|
endforeach()
|
|
@@ -117,10 +125,7 @@ function(_ctk_add_copy_python_files_target target type)
|
|
list(APPEND copied_files ${tgt})
|
|
list(APPEND copied_files ${tgt})
|
|
endforeach()
|
|
endforeach()
|
|
if(entries)
|
|
if(entries)
|
|
- add_custom_target(${target_name} ALL
|
|
|
|
- DEPENDS
|
|
|
|
- ${copied_files}
|
|
|
|
- )
|
|
|
|
|
|
+ add_custom_target(${target_name} ALL DEPENDS ${copied_files} ${ARGN})
|
|
endif()
|
|
endif()
|
|
endif()
|
|
endif()
|
|
endfunction()
|
|
endfunction()
|
|
@@ -173,8 +178,8 @@ function(_ctk_add_compile_python_directories_target target)
|
|
endfunction()
|
|
endfunction()
|
|
|
|
|
|
function(ctkFunctionAddCompilePythonScriptTargets target)
|
|
function(ctkFunctionAddCompilePythonScriptTargets target)
|
|
- _ctk_add_copy_python_files_target(${target} Script)
|
|
|
|
- _ctk_add_copy_python_files_target(${target} Resource)
|
|
|
|
|
|
+ _ctk_add_copy_python_files_target(${target} Script ${ARGN})
|
|
|
|
+ _ctk_add_copy_python_files_target(${target} Resource ${ARGN})
|
|
_ctk_add_compile_python_directories_target(${target})
|
|
_ctk_add_compile_python_directories_target(${target})
|
|
endfunction()
|
|
endfunction()
|
|
|
|
|