diff options
author | Josh Blum | 2011-08-03 20:17:48 -0700 |
---|---|---|
committer | Josh Blum | 2011-08-03 20:17:48 -0700 |
commit | 2a134bd58fa95c2bee43611b86a3e479a3f989cf (patch) | |
tree | b5f1f41eff392c8c1d0855046076705af5816608 /cmake | |
parent | 1c595293862954149f5815d77347bd9b5e62289c (diff) | |
download | gnuradio-2a134bd58fa95c2bee43611b86a3e479a3f989cf.tar.gz gnuradio-2a134bd58fa95c2bee43611b86a3e479a3f989cf.tar.bz2 gnuradio-2a134bd58fa95c2bee43611b86a3e479a3f989cf.zip |
cmake: moved unique target macro into python where its used
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/GrMiscUtils.cmake | 14 | ||||
-rw-r--r-- | cmake/Modules/GrPython.cmake | 18 |
2 files changed, 13 insertions, 19 deletions
diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake index a7e20124f..c36c509b5 100644 --- a/cmake/Modules/GrMiscUtils.cmake +++ b/cmake/Modules/GrMiscUtils.cmake @@ -84,17 +84,3 @@ MACRO(GR_INCLUDE_SUBDIRECTORY subdir) LIST(REMOVE_AT _cmake_source_dirs 0) LIST(REMOVE_AT _cmake_binary_dirs 0) ENDMACRO(GR_INCLUDE_SUBDIRECTORY) - -######################################################################## -# Create an always-built target with a unique name -# Usage: GR_UNIQUE_TARGET(<description> <dependencies list>) -######################################################################## -FUNCTION(GR_UNIQUE_TARGET desc) - INCLUDE(GrPython) - FILE(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib -unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] -print re.sub('\\W', '_', '${desc} ${reldir} ' + unique)" - OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) - ADD_CUSTOM_TARGET(${_target} ALL DEPENDS ${ARGN}) -ENDFUNCTION(GR_UNIQUE_TARGET) diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake index 8cffd7a01..f54dbc9ba 100644 --- a/cmake/Modules/GrPython.cmake +++ b/cmake/Modules/GrPython.cmake @@ -51,10 +51,6 @@ ENDIF(PYTHON_EXECUTABLE) #make the path to the executable appear in the cmake gui SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") -IF(NOT PYTHONINTERP_FOUND) - MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.") -ENDIF(NOT PYTHONINTERP_FOUND) - ######################################################################## # Check for the existence of a python module: # - desc a string description of the check @@ -95,6 +91,19 @@ print sysconfig.get_python_lib(plat_specific=True, prefix='') FILE(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR) ######################################################################## +# Create an always-built target with a unique name +# Usage: GR_UNIQUE_TARGET(<description> <dependencies list>) +######################################################################## +FUNCTION(GR_UNIQUE_TARGET desc) + FILE(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib +unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] +print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" + OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) + ADD_CUSTOM_TARGET(${_target} ALL DEPENDS ${ARGN}) +ENDFUNCTION(GR_UNIQUE_TARGET) + +######################################################################## # Install python sources (also builds and installs byte-compiled python) ######################################################################## FUNCTION(GR_PYTHON_INSTALL) @@ -163,7 +172,6 @@ FUNCTION(GR_PYTHON_INSTALL) ENDIF() - INCLUDE(GrMiscUtils) #unique target GR_UNIQUE_TARGET("pygen" ${python_install_gen_targets}) ENDFUNCTION(GR_PYTHON_INSTALL) |