On 05/31/2012 01:07 PM, Williams, Norman K wrote: > As a proof of concept
Did you publish anything we can see anywhere or is this still in early development form locally? > 1. If I move all the external project implementation into > ITK/Modules/ThirdParty/DCMTK, I don't know how to make the Module (I.e. > the ITKDCMTK Module) depend on running the ExternalProject build for > DCMTK. Which is to say, if the ExternalProject macro call is there in > ITK/Modules/ThirdParty/DCMTK/CMakeList, DCMTK will get built eventually, > but I'm not sure that the chain of dependency is there such that it will > get built before the ITKIODCMTK module. For now you can special case it with the same add_dependencies(ITKIODCMTK dcmtk) as before. It doesn't matter where the dcmtk target is added. The dependency will still work. Ideally we would create IMPORTED library targets for the libraries built by the external project and that themselves "depend" on the external project build target. Even though CMake imported targets do not actually build, CMake does propagate their "dependencies" through to any other real targets that depend on the imported libraries. Then you can simply list the imported library targets as the libraries provided by the module and dependencies will hook up nicely. The problem is that IMPORTED targets are visible only in the directory that defines them and below. Therefore targets created in Modules/ThirdParty/DCMTK would not be visible to the other modules as imported targets. CMake 2.8.8 has a new feature added here: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca39c5cd http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f9c1c622 that could be used to avoid the problem if we could depend on it. However, I think we can get away without it anyway. Here is a sketch of how the imported target might work: # Modules/ThirdParty/DCMTK/itk-module-init.cmake add_library(itkdcmtk STATIC IMPORTED) set_property(TARGET itkdcmtk PROPERTY IMPORTED_LOCATION ${somewhere_that_dcmtk_builds}/lib/libdcmtk.a) # Modules/ThirdParty/DCMTK/CMakeLists.txt set(ITKDCMTK_LIBRARIES itkdcmtk) ExternalProject_Add(dcmtk_build ...) add_dependencies(itkdcmtk dcmtk_build) By defining the imported target in itk-module-init.cmake it will be loaded by the top-level CMakeLists.txt and so will be visible everywhere even without CMake 2.8.8. Once the dependency is added on dcmtk_build CMake will guarantee that any targets that link to itkdcmtk will depend on dcmtk_build. Note that the IMPORTED_LOCATION property of the imported target will need to be filled with platform-specific names computed by logic conditioned on the platform and build tools. This is inevitable no matter the approach because CMake must process and configure ITK before the external project source even downloads. The code will just have to know where the library files will be built. > 2. how would I get the list of DCMTK libraries to be installed once DCMTK > is built? Right now, the include directories, library list, and the lib > directory get suck into the proper lists, but in the case of actually > installing ITK, none of them would get added to the installation. Let's see if you can get past the first part above before we worry about this. -Brad K _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://www.itk.org/mailman/listinfo/insight-developers
