From 101d13f85618ebd9e2f0a7e64542b5e2d8797707 Mon Sep 17 00:00:00 2001 From: bruneton Date: Tue, 22 Oct 2013 13:54:46 +0000 Subject: [PATCH] CMake: bug fix. Ensure proper build order (.hh from IDL should be generated early enough). --- CMakeLists.txt | 17 +++++++++++++++-- idl/wrap.cmake | 1 - src/VTKWrapping/CMakeLists.txt | 18 ++---------------- src/VTKWrapping/GenerateWrapList.cmake | 3 +++ 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4b92a77..8ae43981 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,14 +191,27 @@ MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTH MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED) MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC SALOME_PARAVIS_INSTALL_RES_DATA) +## Generation of the list of VTK classes (to be wrapped into IDLs) +## ===================================== +IF(NOT SALOME_LIGHT_ONLY) + # TODO: the below requires ParaView in the PYTHONPATH ... not so nice: + MESSAGE(STATUS "Generating list of wrapped VTK classes ...") + LIST(GET PARAVIEW_INCLUDE_DIRS 0 PARAVIEW_INCLUDE_DIR0) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/VTKWrapping/getwrapclasses.py ${PARAVIEW_INCLUDE_DIR0} + RESULT_VARIABLE _res) + IF(NOT _res EQUAL 0) + MESSAGE(FATAL_ERROR "Unable to run the Python script retrieving the list of VTK classes.") + ENDIF() +ENDIF() + + # Sources # ======== -ADD_SUBDIRECTORY(src) - IF(NOT SALOME_LIGHT_ONLY) ADD_SUBDIRECTORY(idl) # Order matters when using the wrapping - to be added AFTER src ENDIF() +ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(adm_local) ADD_SUBDIRECTORY(resources) diff --git a/idl/wrap.cmake b/idl/wrap.cmake index 64063d43..401463f4 100755 --- a/idl/wrap.cmake +++ b/idl/wrap.cmake @@ -82,4 +82,3 @@ ENDIF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) ADD_CUSTOM_TARGET(generate_txt DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt vtkWrapIDL.h hints) ADD_CUSTOM_TARGET(generate_idl ALL DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt vtkWrapIDL.h hints ${WRAP_IDL}) - diff --git a/src/VTKWrapping/CMakeLists.txt b/src/VTKWrapping/CMakeLists.txt index ca407da1..202f09ea 100644 --- a/src/VTKWrapping/CMakeLists.txt +++ b/src/VTKWrapping/CMakeLists.txt @@ -17,22 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - -## Generation of the list of VTK classes (to be wrapped into IDLs) -## ===================================== -IF(NOT SALOME_LIGHT_ONLY) - # TODO: the below requires ParaView in the PYTHONPATH ... not so nice: - MESSAGE(STATUS "Generating list of wrapped VTK classes ...") - LIST(GET PARAVIEW_INCLUDE_DIRS 0 PARAVIEW_INCLUDE_DIR0) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIR0} - RESULT_VARIABLE _res) - IF(NOT _res EQUAL 0) - MESSAGE(FATAL_ERROR "Unable to run the Python script retrieving the list of VTK classes.") - ENDIF() -ENDIF() - -INCLUDE(GenerateWrapList.cmake) - ## Parser for VTK header files ## =========================== ## @@ -107,6 +91,8 @@ INCLUDE(wrap.cmake) ## SET(CMAKE_POSITION_INDEPENDENT_CODE ON) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") ADD_LIBRARY(VTK_IDL_Impl OBJECT ${WRAP_IDL_I_CC}) +# Ensure .hh files corresponding to IDL have been generated first: +ADD_DEPENDENCIES(VTK_IDL_Impl omniorb_module_SalomeIDLPARAVIS) # Make the list of wrapped files visible from the top directory (will be used in PVGUI and idl): SET(WRAP_IDL_I_HH "${WRAP_IDL_I_HH}" PARENT_SCOPE) diff --git a/src/VTKWrapping/GenerateWrapList.cmake b/src/VTKWrapping/GenerateWrapList.cmake index c884b5b5..7cf8c488 100644 --- a/src/VTKWrapping/GenerateWrapList.cmake +++ b/src/VTKWrapping/GenerateWrapList.cmake @@ -17,6 +17,9 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +##### +# NOT USED ANYMORE ... to be deleted +#### ADD_CUSTOM_COMMAND( OUTPUT ${PROJECT_BINARY_DIR}/wrapfiles.txt COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/getwrapclasses.py -- 2.39.2