[Kde-bindings] Fwd: KDE/kdelibs/cmake/modules
Michael Jansen
kde at michael-jansen.biz
Fri Jul 23 16:33:53 UTC 2010
SVN commit 1153601 by mjansen:
Make
ADD_SIP_PYTHON_MODULE(
test
example.sip
...)
work. Notice that there is no directory part before example.sip. This
should have no impact
on existing code.
CCMAIL: kde-bindings at kde-org
M +10 -3 SIPMacros.cmake
---
trunk/KDE/kdelibs/cmake/modules/SIPMacros.cmake #1153600:1153601
@@ -50,6 +50,13 @@
GET_FILENAME_COMPONENT(_child_module_name ${_x} NAME)
GET_FILENAME_COMPONENT(_module_path
${MODULE_SIP} PATH)
+
+ if(_module_path STREQUAL "")
+ set(CMAKE_CURRENT_SIP_OUTPUT_DIR
"${CMAKE_CURRENT_BINARY_DIR}")
+ else(_module_path STREQUAL "")
+
set(CMAKE_CURRENT_SIP_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${_module_path}")
+
endif(_module_path STREQUAL "")
+
GET_FILENAME_COMPONENT(_abs_module_sip ${MODULE_SIP}
ABSOLUTE)
# We give this target a long logical target name.
@@ -59,7 +66,7 @@
STRING(REPLACE "." "_" _logical_name ${MODULE_NAME})
SET(_logical_name
"python_module_${_logical_name}")
- FILE(MAKE_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/${_module_path}) # Output goes in this dir.
+
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_SIP_OUTPUT_DIR}) # Output goes in this dir.
SET(_sip_includes)
FOREACH (_inc ${SIP_INCLUDES})
@@ -81,7 +88,7 @@
SET(_sip_output_files)
FOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )
IF(
${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
- SET(_sip_output_files ${_sip_output_files}
${CMAKE_CURRENT_BINARY_DIR}/${_module_path}/sip${_child_module_name}part${CONCAT_NUM}.cpp )
+
SET(_sip_output_files ${_sip_output_files}
${CMAKE_CURRENT_SIP_OUTPUT_DIR}/sip${_child_module_name}part${CONCAT_NUM}.cpp )
ENDIF(
${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
ENDFOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )
@@ -99,7 +106,7 @@
OUTPUT ${_sip_output_files}
COMMAND ${CMAKE_COMMAND} -E
echo ${message}
COMMAND ${TOUCH_COMMAND} ${_sip_output_files}
- COMMAND
${SIP_EXECUTABLE} ${_sip_tags} ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c
${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip}
+ COMMAND
${SIP_EXECUTABLE} ${_sip_tags} ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c
${CMAKE_CURRENT_SIP_OUTPUT_DIR} ${_sip_includes} ${_abs_module_sip}
DEPENDS
${_abs_module_sip} ${SIP_EXTRA_FILES_DEPEND}
)
# not sure if type MODULE could be uses
anywhere, limit to cygwin for now
-----------------------------------------
More information about the Kde-bindings
mailing list