summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJosh Blum2011-11-05 13:54:35 -0700
committerJosh Blum2011-11-05 13:54:35 -0700
commit81dbc190bebe6f623aa5603394dcc691110f55fb (patch)
treeb45e75f7ca1b8537274711ab4cf2618d292b1b04 /cmake
parent2a0d169a5cc3856f77091cb755770b0e42d9fbd9 (diff)
downloadgnuradio-81dbc190bebe6f623aa5603394dcc691110f55fb.tar.gz
gnuradio-81dbc190bebe6f623aa5603394dcc691110f55fb.tar.bz2
gnuradio-81dbc190bebe6f623aa5603394dcc691110f55fb.zip
cmake: tweaks to swig gen and updated howto modules
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/GrMiscUtils.cmake17
-rw-r--r--cmake/Modules/GrSwig.cmake2
2 files changed, 13 insertions, 6 deletions
diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake
index de2683d9c..540b97b93 100644
--- a/cmake/Modules/GrMiscUtils.cmake
+++ b/cmake/Modules/GrMiscUtils.cmake
@@ -187,11 +187,18 @@ endfunction(GR_LIBRARY_FOO)
# and executables can depend on targets. So this is the process:
########################################################################
function(GR_GEN_TARGET_DEPS name var)
- set(_dummy_target _${name}_dummy_target)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_dummy_target}.cpp "int main(void){return 0;}\n")
- add_executable(${_dummy_target} ${CMAKE_CURRENT_BINARY_DIR}/${_dummy_target}.cpp)
+ file(
+ WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
+ "int main(void){return 0;}\n"
+ )
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp
+ )
+ add_executable(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp)
if(ARGN)
- add_dependencies(${_dummy_target} ${ARGN})
+ add_dependencies(${name} ${ARGN})
endif(ARGN)
- set(${var} "DEPENDS;${_dummy_target};COMMAND;${_dummy_target}" PARENT_SCOPE)
+ set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE)
endfunction(GR_GEN_TARGET_DEPS)
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
index 1dfd62af2..4be583aa1 100644
--- a/cmake/Modules/GrSwig.cmake
+++ b/cmake/Modules/GrSwig.cmake
@@ -49,7 +49,7 @@ macro(GR_SWIG_MAKE name)
#Create a dummy custom command that depends on other targets
include(GrMiscUtils)
- GR_GEN_TARGET_DEPS(${name} tag_deps ${GR_SWIG_TARGET_DEPS})
+ GR_GEN_TARGET_DEPS(_${name}_swig_tag tag_deps ${GR_SWIG_TARGET_DEPS})
set(tag_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.tag)
add_custom_command(
OUTPUT ${tag_file}