diff options
author | Tom Rondeau | 2011-11-12 18:30:13 -0500 |
---|---|---|
committer | Tom Rondeau | 2011-11-12 18:30:13 -0500 |
commit | 0e7c799e4ef7a392a8ffe47170666908bfcb183f (patch) | |
tree | deb32d3810b4cb636ecfa24ff613a1aad1fd409c /gr-howto-write-a-block-cmake | |
parent | c9c20b9051b997ab53a27869094648f15e0dccae (diff) | |
parent | 9a25332b706b1ffadf8cdf9b405e89c37a1e2278 (diff) | |
download | gnuradio-0e7c799e4ef7a392a8ffe47170666908bfcb183f.tar.gz gnuradio-0e7c799e4ef7a392a8ffe47170666908bfcb183f.tar.bz2 gnuradio-0e7c799e4ef7a392a8ffe47170666908bfcb183f.zip |
Merge branch 'master' of gnuradio.org:gnuradio
Diffstat (limited to 'gr-howto-write-a-block-cmake')
-rw-r--r-- | gr-howto-write-a-block-cmake/cmake/Modules/GrMiscUtils.cmake | 8 | ||||
-rw-r--r-- | gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake | 15 |
2 files changed, 17 insertions, 6 deletions
diff --git a/gr-howto-write-a-block-cmake/cmake/Modules/GrMiscUtils.cmake b/gr-howto-write-a-block-cmake/cmake/Modules/GrMiscUtils.cmake index 540b97b93..0e1f40027 100644 --- a/gr-howto-write-a-block-cmake/cmake/Modules/GrMiscUtils.cmake +++ b/gr-howto-write-a-block-cmake/cmake/Modules/GrMiscUtils.cmake @@ -164,6 +164,7 @@ function(GR_LIBRARY_FOO target) POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0 + COMMAND ${CMAKE_COMMAND} -E touch ${target_name} #so the symlinks point to something valid so cmake 2.6 will install ) #and install the extra symlinks @@ -200,5 +201,10 @@ function(GR_GEN_TARGET_DEPS name var) if(ARGN) add_dependencies(${name} ${ARGN}) endif(ARGN) - set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE) + + if(CMAKE_CROSSCOMPILING) + set(${var} "DEPENDS;${name}" PARENT_SCOPE) #cant call command when cross + else() + set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE) + endif() endfunction(GR_GEN_TARGET_DEPS) diff --git a/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake b/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake index 4be583aa1..51d9203dd 100644 --- a/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake +++ b/gr-howto-write-a-block-cmake/cmake/Modules/GrSwig.cmake @@ -38,10 +38,18 @@ include(GrPython) macro(GR_SWIG_MAKE name) set(ifiles ${ARGN}) + #append additional include directories + find_package(PythonLibs) + list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) #deprecated name (now dirs) + list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}) + list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) + list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}) + #determine include dependencies for swig file execute_process( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/get_swig_deps.py - "${ifiles}" "${GR_SWIG_INCLUDE_DIRS}" + COMMAND ${PYTHON_EXECUTABLE} + ${CMAKE_BINARY_DIR}/get_swig_deps.py + "${ifiles}" "${GR_SWIG_INCLUDE_DIRS}" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE SWIG_MODULE_${name}_EXTRA_DEPS WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -61,9 +69,6 @@ macro(GR_SWIG_MAKE name) include_directories(${GR_SWIG_INCLUDE_DIRS}) list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file}) - find_package(PythonLibs) - include_directories(${PYTHON_INCLUDE_DIRS}) - #setup the swig flags with flags and include directories set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS}) foreach(dir ${GR_SWIG_INCLUDE_DIRS}) |