Permalink
Browse files

fix misconfigured destination. add support for symlinked sources

  • Loading branch information...
1 parent 533786b commit ce212ef596bca6a9bca205eefb49b8d793951b8f @zaufi committed Jun 10, 2012
Showing with 19 additions and 7 deletions.
  1. +11 −6 CMakeLists.txt
  2. +8 −1 cmake/PythonMacros.cmake
View
@@ -25,11 +25,16 @@ python_install(${CMAKE_INSTALL_PREFIX}/${LIBKATEPATE_DIR} ${LIBKATEPATE_SOURCES}
set(PLUGIN_SOURCES format.py block.py commentar.py expand/expand.py)
python_install(${CMAKE_INSTALL_PREFIX} ${PLUGIN_SOURCES})
-set(EXPAND_DIR libkatepate)
-set(EXPAND_SOURCES expand/text_x-c++src.expand)
+set(EXPAND_DIR expand)
+set(
+ EXPAND_SOURCES
+ expand/text_x-c++src.expand
+ expand/text_x-c++hdr.expand
+ expand/text_x-chdr.expand
+ )
python_install(${CMAKE_INSTALL_PREFIX}/${EXPAND_DIR} ${EXPAND_SOURCES})
-install(
- FILES expand/text_x-c++hdr.expand expand/text_x-chdr.expand
- DESTINATION ${CMAKE_INSTALL_PREFIX}/${EXPAND_DIR}
- )
+# install(
+# FILES expand/text_x-c++hdr.expand expand/text_x-chdr.expand
+# DESTINATION ${CMAKE_INSTALL_PREFIX}/${EXPAND_DIR}
+# )
View
@@ -17,6 +17,8 @@
# Mon Jun 11 02:49:02 MSK 2012, by Alex Turbov
# Refactoring to support variadic number of source files
# Prevent excecution w/ incorrect arguments count
+# Support for symlinked source files has been added
+# Generalise work w/ file extensions
#
get_filename_component(PYTHON_MACROS_MODULE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
@@ -57,9 +59,14 @@ macro(python_install DESINATION_DIR)
COMMENT "Byte-compiling ${_py_file}"
)
else()
+ if(IS_SYMLINK ${_absfilename})
+ set(_copy_cmd ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py})
+ else()
+ set(_copy_cmd ${CMAKE_COMMAND} -E create_symlink ${_absfilename} ${_bin_py})
+ endif()
add_custom_command(
TARGET compile_python_files
- COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py}
+ COMMAND ${_copy_cmd}
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_MACROS_MODULE_PATH}/PythonCompile.py ${_bin_py}
DEPENDS ${_absfilename}
COMMENT "Byte-compiling ${_py_file}"

0 comments on commit ce212ef

Please sign in to comment.