[Insight-developers] strange error with export list on modular ITK
Alexandre GOUAILLARD
agouaillard at gmail.com
Tue Dec 20 21:30:07 EST 2011
hi steve,
I extended the patch to include the install directories.
I also cleaned a copy paste left over.
here is the patch:
diff --git a/CMake/KitCommonBlock.cmake b/CMake/KitCommonBlock.cmake
index 72a500b..fd6c3f5 100644
--- a/CMake/KitCommonBlock.cmake
+++ b/CMake/KitCommonBlock.cmake
@@ -4,7 +4,9 @@ ADD_LIBRARY(${KIT} STATIC ${Kit_SRCS} ${Kit_EXTRA_SRCS})
TARGET_LINK_LIBRARIES(${KIT} ${KIT_LIBS} ${KIT_EXTRA_LIBS})
INSTALL(TARGETS ${KIT}
- DESTINATION ${DCMTK_INSTALL_LIB_DIR} COMPONENT Development
+ EXPORT ${DCMTK_TARGETS_NAME}
+ DESTINATION ${DCMTK_INSTALL_LIB_DIR}
+ COMPONENT Development
)
# End of common section
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87326d8..df95f1f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,9 +10,21 @@ SET(DCMTK_PACKAGE_DATE "20100226")
SET(DCMTK_DEFAULT_CONFIGURATION_DIR "")
SET(DCMTK_DEFAULT_SUPPORT_DATA_DIR "")
-SET(DCMTK_INSTALL_INCLUDE_DIR "include")
-SET(DCMTK_INSTALL_LIB_DIR "lib")
-SET(DCMTK_INSTALL_BIN_DIR "bin")
+IF(NOT DCMTK_INSTALL_INCLUDE_DIR)
+ SET(DCMTK_INSTALL_INCLUDE_DIR "include")
+ENDIF()
+IF(NOT DCMTK_INSTALL_LIB_DIR)
+ SET(DCMTK_INSTALL_LIB_DIR "lib")
+ENDIF()
+IF(NOT DCMTK_INSTALL_BIN_DIR)
+ SET(DCMTK_INSTALL_BIN_DIR "bin")
+ENDIF()
+
+# to be able to "redirect" export
+# to external projects that embbed DCMTK (ITK)
+IF(NOT DCMTK_TARGETS_NAME)
+ SET(DCMTK_TARGETS_NAME DCMTKTargets)
+ENDIF(NOT DCMTK_TARGETS_NAME)
#-----------------------------------------------------------------------------
# Output directories.
@@ -24,8 +36,6 @@ IF(NOT EXECUTABLE_OUTPUT_PATH)
ENDIF(NOT EXECUTABLE_OUTPUT_PATH)
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
-SET(ITK_LIBRARY_PATH "${LIBRARY_OUTPUT_PATH}")
-SET(ITK_EXECUTABLE_PATH "${EXECUTABLE_OUTPUT_PATH}")
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
@@ -216,3 +226,4 @@ FOREACH(lib_include_subdir ${lib_include_subdirs})
DESTINATION
${DCMTK_INSTALL_INCLUDE_DIR}/dcmtk/${lib}/${lib_include_subdir}
COMPONENT Deve
)
ENDFOREACH()
More information about the Insight-developers
mailing list