summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-04 21:44:10 -0700
committerJosh Blum <josh@joshknows.com>2011-11-04 21:44:10 -0700
commit0b3a4a2c43e9fd4e3cc03c694b408034954c9d74 (patch)
tree3c49d2ec6ab91a3b43ad8015c069a55d82cffb70 /cmake
parent56fcd5f9b22af33976f9413d3a9d0aec41a7b556 (diff)
cmake: fixed up swig deps properly for make -j*
Also took the time to fix up the swig index file generation. This may have not-been auto-regenerating before as well.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/GrSwig.cmake13
1 files changed, 9 insertions, 4 deletions
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
index d554f78d16..f8f339f1bd 100644
--- a/cmake/Modules/GrSwig.cmake
+++ b/cmake/Modules/GrSwig.cmake
@@ -47,9 +47,17 @@ macro(GR_SWIG_MAKE name)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
+ #create a dummy target that depend on other targets
+ set(tag_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.tag)
+ add_custom_command(
+ OUTPUT ${tag_file}
+ DEPENDS ${GR_SWIG_TARGET_DEPS}
+ COMMAND ${CMAKE_COMMAND} -E touch ${tag_file}
+ )
+
#append the specified include directories
include_directories(${GR_SWIG_INCLUDE_DIRS})
- list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${GR_SWIG_SOURCE_DEPS})
+ list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${GR_SWIG_SOURCE_DEPS} ${tag_file})
find_package(PythonLibs)
include_directories(${PYTHON_INCLUDE_DIRS})
@@ -67,9 +75,6 @@ macro(GR_SWIG_MAKE name)
include(UseSWIG)
SWIG_ADD_MODULE(${name} python ${ifiles})
SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES})
- if(GR_SWIG_TARGET_DEPS)
- add_dependencies(${SWIG_MODULE_${name}_REAL_NAME} ${GR_SWIG_TARGET_DEPS})
- endif(GR_SWIG_TARGET_DEPS)
endmacro(GR_SWIG_MAKE)