From 72ec37b54877720cfbbaaeb58c8c799017012bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Tue, 28 Mar 2017 11:47:01 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@324 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- PIPMacros.cmake | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/PIPMacros.cmake b/PIPMacros.cmake index 77a3d4c7..ba1f1728 100644 --- a/PIPMacros.cmake +++ b/PIPMacros.cmake @@ -1,22 +1,26 @@ -macro(PIP_EXTRACT_OPTIONS _pip_files _pip_options) +macro(PIP_EXTRACT_OPTIONS _pip_files _pip_options _abs) set(${_pip_files}) set(${_pip_options}) set(_PIP_DOING_OPTIONS FALSE) foreach(_currentArg ${ARGN}) - if("x${_currentArg}" STREQUAL "xOPTIONS") - set(_PIP_DOING_OPTIONS TRUE) + if("x${_currentArg}" STREQUAL "xABSOLUTE") + set(${_abs} TRUE) else() - if(_PIP_DOING_OPTIONS) - list(APPEND ${_pip_options} "${_currentArg}") + if("x${_currentArg}" STREQUAL "xOPTIONS") + set(_PIP_DOING_OPTIONS TRUE) else() - list(APPEND ${_pip_files} "${_currentArg}") + if(_PIP_DOING_OPTIONS) + list(APPEND ${_pip_options} "${_currentArg}") + else() + list(APPEND ${_pip_files} "${_currentArg}") + endif() endif() endif() endforeach() endmacro() macro(pip_code_model RESULT) - PIP_EXTRACT_OPTIONS(CCM_SRC OPTS ${ARGN}) + PIP_EXTRACT_OPTIONS(CCM_SRC OPTS ABS ${ARGN}) #message(STATUS "src = ${CCM_SRC}") #message(STATUS "result = ${RESULT}") #message(STATUS "options = \"${CCM_OPTS}\"") @@ -27,9 +31,15 @@ macro(pip_code_model RESULT) set(CCM_OUT ${CMAKE_CURRENT_BINARY_DIR}/ccm_${PROJECT_NAME}.cpp) set(${RESULT} ${${RESULT}} ${CCM_OUT}) set(CCM_FILES) - foreach(csrc ${CCM_SRC}) - list(APPEND CCM_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${csrc}") - endforeach() + if (ABS) + foreach(csrc ${CCM_SRC}) + list(APPEND CCM_FILES "${csrc}") + endforeach() + else() + foreach(csrc ${CCM_SRC}) + list(APPEND CCM_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${csrc}") + endforeach() + endif() #message(STATUS "CCM = ${RESULT}") if(NOT DEFINED PIP_DLL_DIR) set(PIP_DLL_DIR ${CMAKE_CURRENT_BINARY_DIR})