git-svn-id: svn://db.shs.com.ru/pip@289 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2016-11-30 16:18:16 +00:00
parent f6b0660aa2
commit 27daa6db8f

View File

@@ -3,9 +3,9 @@ macro (PIP_EXTRACT_OPTIONS _pip_files _pip_options)
set(${_pip_options}) set(${_pip_options})
set(_PIP_DOING_OPTIONS FALSE) set(_PIP_DOING_OPTIONS FALSE)
foreach(_currentArg ${ARGN}) foreach(_currentArg ${ARGN})
if ("x${_currentArg}" STREQUAL "xOPTIONS") if("x${_currentArg}" STREQUAL "xOPTIONS")
set(_PIP_DOING_OPTIONS TRUE) set(_PIP_DOING_OPTIONS TRUE)
else () else()
if(_PIP_DOING_OPTIONS) if(_PIP_DOING_OPTIONS)
list(APPEND ${_pip_options} "${_currentArg}") list(APPEND ${_pip_options} "${_currentArg}")
else() else()
@@ -19,22 +19,26 @@ macro (pip_code_model RESULT)
PIP_EXTRACT_OPTIONS(CCM_SRC OPTS ${ARGN}) PIP_EXTRACT_OPTIONS(CCM_SRC OPTS ${ARGN})
set(CCM_OPTS) set(CCM_OPTS)
foreach (it ${OPTS}) foreach (it ${OPTS})
if(CCM_OPTS)
set(CCM_OPTS "${CCM_OPTS} ${it}") set(CCM_OPTS "${CCM_OPTS} ${it}")
else()
set(CCM_OPTS "${it}")
endif()
endforeach() endforeach()
message(STATUS "src = ${CCM_SRC}") message(STATUS "src = ${CCM_SRC}")
#message(STATUS "result = ${RESULT}") #message(STATUS "result = ${RESULT}")
message(STATUS "options = ${CCM_OPTS}") message(STATUS "options = ${CCM_OPTS}")
set(CCM_OUT ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm.cpp) set(CCM_OUT ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm.cpp)
set(${RESULT} ${${RESULT}} ${CCM_OUT}) set(${RESULT} ${${RESULT}} ${CCM_OUT})
message(STATUS "CCM = ${CCM_OUT}") message(STATUS "CCM = ${RESULT}")
add_custom_command(OUTPUT ${CCM_OUT} add_custom_command(OUTPUT ${CCM_OUT}
COMMAND ${PIP_CMG} COMMAND ${PIP_CMG}
ARGS -qP ${CCM_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/${CCM_SRC} ARGS -P ${CCM_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/${CCM_SRC}
DEPENDS ${CCM_SRC} MAIN_DEPENDENCY ${CCM_SRC})
VERBATIM) #VERBATIM)
#message(STATUS "Creating code model based on \"${CCM_SRC}\", please wait ... ") #message(STATUS "Creating code model based on \"${CCM_SRC}\", please wait ... ")
#message(STATUS "exec \"-qP ${CCM_OPTS} -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CCM_SRC}\"") #message(STATUS "exec \"-qP ${CCM_OPTS} -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CCM_SRC}\"")
message(STATUS "exec ${PIP_CMG} -qP ${CCM_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/${CCM_SRC}") message(STATUS "exec ${PIP_CMG} -P ${CCM_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/${CCM_SRC}")
#execute_process(OUTPUT_VARIABLE CMG_OUT COMMAND ${PIP_CMG} -qP ${CCM_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/${CCM_SRC}) #execute_process(OUTPUT_VARIABLE CMG_OUT COMMAND ${PIP_CMG} -qP ${CCM_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/${CCM_SRC})
#message(STATUS "Creating code model done, to use it include \"${PROJECT_NAME}_ccm.h\"") #message(STATUS "Creating code model done, to use it include \"${PROJECT_NAME}_ccm.h\"")
#message(STATUS ${CMG_OUT}) #message(STATUS ${CMG_OUT})