Commit bf1f2b97 authored by barre's avatar barre
Browse files

ENH: make sure all sub-project in Libs/ can be built in a standalone fashion...

ENH: make sure all sub-project in Libs/ can be built in a standalone fashion (remove 99% of the refs to Slicer3, macros, etc). Make sure all external toolkits are properly included, and fix some issues in MRML with respect to TEEM/vtkTeem.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@6803 3bd1e089-480b-0410-8dfb-8563597acbee
parent e8fc1085
......@@ -147,7 +147,7 @@ include(${KWWidgets_USE_FILE})
## Teem
find_package(TEEM REQUIRED)
if(NOT TEEM_FOUND)
message(FATAL_ERROR "Need TEEMK to build")
message(FATAL_ERROR "Need TEEM to build")
endif(NOT TEEM_FOUND)
include(${TEEM_USE_FILE})
......
PROJECT( SlicerLibs )
## GenerateGLP needs to be compiled first.
SUBDIRS(
tclap
ModuleDescriptionParser
GenerateCLP
LoadableModule
)
project(SlicerLibs)
set(dirs
tclap
ModuleDescriptionParser
GenerateCLP
LoadableModule
)
# Note: Order of of SUBDIRS is important if your projects depend
# on code in other projects (put dependent project later).
IF( TEEM_FOUND )
SUBDIRS(
vtkTeem
if(TEEM_FOUND)
set(dirs ${dirs} vtkTeem)
endif(TEEM_FOUND)
set(dirs ${dirs}
vtkITK
FreeSurfer
Qdec
MRML
GenerateLM
SlicerIO
ITKCommandIO
MRMLIDImageIO
MGHImageIO
IGT
RemoteIO
#SIGN
)
ENDIF( TEEM_FOUND )
SUBDIRS(
vtkITK
FreeSurfer
Qdec
MRML
GenerateLM
SlicerIO
ITKCommandIO
MRMLIDImageIO
MGHImageIO
IGT
RemoteIO
#SIGN
)
set(include_dirs)
set(libs)
set(ModuleDescriptionParser_USE_PYTHON ${Slicer3_USE_PYTHON})
set(LoadableModule_USE_PYTHON ${Slicer3_USE_PYTHON})
set(IGT_USE_IGSTK ${Slicer3_USE_IGSTK})
set(IGT_USE_NAVITRACK ${Slicer3_USE_NAVITRACK})
set(ITKCommandIO_INSTALL_ITKFACTORIES_DIR ${Slicer3_INSTALL_ITKFACTORIES_DIR})
set(MGHImageIO_INSTALL_ITKFACTORIES_DIR ${Slicer3_INSTALL_ITKFACTORIES_DIR})
set(MRMLIDImageIO_INSTALL_ITKFACTORIES_DIR ${Slicer3_INSTALL_ITKFACTORIES_DIR})
foreach(dir ${dirs})
set(include_dirs ${include_dirs}
${CMAKE_CURRENT_SOURCE_DIR}/${dir}
${CMAKE_CURRENT_BINARY_DIR}/${dir}
)
set(libs ${libs} ${dir})
endforeach(dir)
slicer3_get_persistent_property(Slicer3_Libs_INCLUDE_DIRS tmp)
slicer3_set_persistent_property(Slicer3_Libs_INCLUDE_DIRS ${tmp} ${include_dirs})
# Inconsistent library name vs. project/dir name :(
string(REPLACE ITKCommandIO CommandIO libs "${libs}")
string(REPLACE SlicerIO slicerio libs "${libs}")
string(REPLACE MGHImageIO MGHIO libs "${libs}")
string(REPLACE MRMLIDImageIO MRMLIDIO libs "${libs}")
# Those are not libs
list(REMOVE_ITEM libs tclap GenerateCLP GenerateLM)
slicer3_get_persistent_property(Slicer3_Libs_LIBRARIES tmp)
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES ${tmp} ${libs})
subdirs(${dirs})
......@@ -5,6 +5,13 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
# --------------------------------------------------------------------------
# Include dirs
......@@ -15,9 +22,6 @@ set(include_dirs
include_directories(${include_dirs})
slicer3_get_persistent_property(Slicer3_Libs_INCLUDE_DIRS tmp)
slicer3_set_persistent_property(Slicer3_Libs_INCLUDE_DIRS ${tmp} ${include_dirs})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/FreeSurferConfigure.h.in
${CMAKE_CURRENT_BINARY_DIR}/FreeSurferConfigure.h
......@@ -64,9 +68,6 @@ target_link_libraries(${lib_name}
vtkIOTCL
)
slicer3_get_persistent_property(Slicer3_Libs_LIBRARIES tmp)
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES ${tmp} ${lib_name})
install(TARGETS ${lib_name}
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/${PROJECT_NAME} COMPONENT RuntimeLibraries
......@@ -87,7 +88,7 @@ set(RESFILES
foreach(file ${RESFILES})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${file}
${Slicer3_BINARY_DIR}/share/${PROJECT_NAME}/${file}
${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/${file}
COPYONLY
)
endforeach(file)
......
......@@ -7,13 +7,6 @@
#pragma warning ( disable : 4275 )
#endif
#cmakedefine CMAKE_WORDS_BIGENDIAN
#ifdef CMAKE_WORDS_BIGENDIAN
#define WORDS_BIGENDIAN
#else
#define WORDS_LITTLEENDIAN
#endif
#cmakedefine BUILD_SHARED_LIBS
#ifndef BUILD_SHARED_LIBS
#define FreeSurfer_STATIC
......
......@@ -21,6 +21,10 @@ if(ITK_FOUND)
include(${ITK_USE_FILE})
endif(ITK_FOUND)
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
set(GENERATECLP_SOURCE GenerateCLP.cxx)
add_executable(GenerateCLP ${GENERATECLP_SOURCE})
get_target_property(GenerateCLP_EXE_PATH GenerateCLP LOCATION)
......
......@@ -21,6 +21,15 @@ if(ITK_FOUND)
include(${ITK_USE_FILE})
endif(ITK_FOUND)
find_package(VTK REQUIRED)
if(VTK_FOUND)
include(${VTK_USE_FILE})
endif(VTK_FOUND)
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
set(GENERATELM_SOURCE GenerateLM.cxx)
generateclp(GENERATELM_SOURCE GenerateLM.xml)
add_executable(GenerateLM ${GENERATELM_SOURCE})
......
......@@ -5,20 +5,44 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
find_package(KWWidgets REQUIRED)
include(${KWWidgets_USE_FILE})
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
# --------------------------------------------------------------------------
# Include dirs
set(include_dirs
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${MRML_BINARY_DIR}
${MRML_SOURCE_DIR}
)
include_directories(${include_dirs})
foreach(package
MRML
)
# This is mostly to test building this lib as standalone outside Slicer3
if(NOT DEFINED ${package}_SOURCE_DIR)
set(${package}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${package}")
endif(NOT DEFINED ${package}_SOURCE_DIR)
if(NOT DEFINED ${package}_BINARY_DIR)
string(REPLACE ${PROJECT_NAME} ${package}
${package}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
link_directories(${${package}_BINARY_DIR})
endif(NOT DEFINED ${package}_BINARY_DIR)
set(include_dirs ${include_dirs}
${${package}_SOURCE_DIR}
${${package}_BINARY_DIR}
)
endforeach(package)
slicer3_get_persistent_property(Slicer3_Libs_INCLUDE_DIRS tmp)
slicer3_set_persistent_property(Slicer3_Libs_INCLUDE_DIRS ${tmp} ${include_dirs})
include_directories(${include_dirs})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/vtkIGTConfigure.h.in
......@@ -46,7 +70,7 @@ set(TRACKING_INTERFACE_LIBRARY "")
#--- NH took out the following section in an effot to remove Navitrak
#--- 10/16/07
#IF(Slicer3_USE_NAVITRACK)
#IF(IGT_USE_NAVITRACK)
# SET(IGT_SRCS
# vtkIGTDataManager.cxx
# vtkIGTDataStream.cxx
......@@ -60,9 +84,9 @@ set(TRACKING_INTERFACE_LIBRARY "")
# SET(TRACKING_INTERFACE_LIB
# ${NAVITRACK_LIB}
# )
#ENDIF(Slicer3_USE_NAVITRACK)
#ENDIF(IGT_USE_NAVITRACK)
if(Slicer3_USE_IGSTK)
if(IGT_USE_IGSTK)
set(IGT_SRCS
vtkIGTDataManager.cxx
vtkIGTDataStream.cxx
......@@ -76,7 +100,7 @@ if(Slicer3_USE_IGSTK)
set(TRACKING_INTERFACE_LIB
${IGSTK_LIBRARIES}
)
endif(Slicer3_USE_IGSTK)
endif(IGT_USE_IGSTK)
# --------------------------------------------------------------------------
# Wrapping
......@@ -115,9 +139,6 @@ target_link_libraries(${lib_name}
${TRACKING_INTERFACE_LIB}
)
slicer3_get_persistent_property(Slicer3_Libs_LIBRARIES tmp)
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES ${tmp} ${lib_name})
install(TARGETS ${lib_name}
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/${PROJECT_NAME} COMPONENT RuntimeLibraries
......
......@@ -7,21 +7,14 @@
#pragma warning ( disable : 4275 )
#endif
#cmakedefine CMAKE_WORDS_BIGENDIAN
#ifdef CMAKE_WORDS_BIGENDIAN
#define WORDS_BIGENDIAN
#else
#define WORDS_LITTLEENDIAN
#endif
#cmakedefine BUILD_SHARED_LIBS
#ifndef BUILD_SHARED_LIBS
#define VTKIGT_STATIC
#endif
#cmakedefine Slicer3_USE_NAVITRACK
#cmakedefine Slicer3_USE_IGSTK
#ifdef Slicer3_USE_IGSTK
#cmakedefine IGT_USE_NAVITRACK
#cmakedefine IGT_USE_IGSTK
#ifdef IGT_USE_IGSTK
#define EXECUTABLE_OUTPUT_PATH "@EXECUTABLE_OUTPUT_PATH@"
#endif
......@@ -5,6 +5,13 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
# --------------------------------------------------------------------------
# Include dirs
......@@ -13,10 +20,26 @@ set(include_dirs
${CMAKE_CURRENT_BINARY_DIR}
)
include_directories(${include_dirs})
foreach(package
SlicerIO
)
# This is mostly to test building this lib as standalone outside Slicer3
if(NOT DEFINED ${package}_SOURCE_DIR)
set(${package}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${package}")
endif(NOT DEFINED ${package}_SOURCE_DIR)
if(NOT DEFINED ${package}_BINARY_DIR)
string(REPLACE ${PROJECT_NAME} ${package}
${package}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
link_directories(${${package}_BINARY_DIR})
endif(NOT DEFINED ${package}_BINARY_DIR)
set(include_dirs ${include_dirs}
${${package}_SOURCE_DIR}
${${package}_BINARY_DIR}
)
endforeach(package)
slicer3_get_persistent_property(Slicer3_Libs_INCLUDE_DIRS tmp)
slicer3_set_persistent_property(Slicer3_Libs_INCLUDE_DIRS ${tmp} ${include_dirs})
include_directories(${include_dirs})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/itkCommandIOConfigure.h.in
......@@ -48,9 +71,6 @@ target_link_libraries(${lib_name}
ITKIO
)
slicer3_get_persistent_property(Slicer3_Libs_LIBRARIES tmp)
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES ${tmp} ${lib_name})
install(TARGETS ${lib_name}
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/${PROJECT_NAME} COMPONENT RuntimeLibraries
......@@ -81,11 +101,15 @@ target_link_libraries(CommandIOPlugin
ITKNrrdIO
)
if(NOT DEFINED ITKCommandIO_INSTALL_ITKFACTORIES_DIR)
set(ITKCommandIO_INSTALL_ITKFACTORIES_DIR lib/ITKFactories)
endif(NOT DEFINED ITKCommandIO_INSTALL_ITKFACTORIES_DIR)
# We should switch to SET_TARGET_PROPERTIES() with LIBRARY_OUTPUT_DIRECTORY
# once CMake 2.6 is released. Until then, we need to hack a solution with
# ADD_CUSTOM_COMMAND()
#SET_TARGET_PROPERTIES(CommandIOPlugin PROPERTIES
# LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}")
# LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ITKCommandIO_INSTALL_ITKFACTORIES_DIR}")
get_target_property(LIBFULLNAME CommandIOPlugin LOCATION)
get_filename_component(LIBNAME ${LIBFULLNAME} NAME)
......@@ -93,13 +117,13 @@ get_filename_component(LIBNAME ${LIBFULLNAME} NAME)
add_custom_command(TARGET CommandIOPlugin
DEPENDS ${LIB_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${LIBFULLNAME} ${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}/${CMAKE_CFG_INTDIR}/${LIBNAME}
COMMAND ${CMAKE_COMMAND} -E copy ${LIBFULLNAME} ${CMAKE_BINARY_DIR}/${ITKCommandIO_INSTALL_ITKFACTORIES_DIR}/${CMAKE_CFG_INTDIR}/${LIBNAME}
)
# Note CommandIO and CommandIOPlugin are installed in different locations
install(TARGETS CommandIOPlugin
RUNTIME DESTINATION ${Slicer3_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${Slicer3_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
RUNTIME DESTINATION ${ITKCommandIO_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${ITKCommandIO_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/${PROJECT_NAME} COMPONENT Development
)
......@@ -109,10 +133,10 @@ install(TARGETS CommandIOPlugin
if(APPLE)
add_custom_command(
TARGET CommandIOPlugin
DEPENDS ${Slicer3_BINARY_DIR}/bin/libCommandIOPlugin.dylib
DEPENDS ${CMAKE_BINARY_DIR}/bin/libCommandIOPlugin.dylib
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}/libCommandIOPlugin.dylib
${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}/libCommandIOPlugin.so
${CMAKE_BINARY_DIR}/${ITKCommandIO_INSTALL_ITKFACTORIES_DIR}/libCommandIOPlugin.dylib
${CMAKE_BINARY_DIR}/${ITKCommandIO_INSTALL_ITKFACTORIES_DIR}/libCommandIOPlugin.so
)
endif(APPLE)
......@@ -20,13 +20,6 @@
#pragma warning ( disable : 4275 )
#endif
#cmakedefine CMAKE_WORDS_BIGENDIAN
#ifdef CMAKE_WORDS_BIGENDIAN
#define WORDS_BIGENDIAN
#else
#define WORDS_LITTLEENDIAN
#endif
#cmakedefine BUILD_SHARED_LIBS
#ifndef BUILD_SHARED_LIBS
#define ITKCOMMANDIO_STATIC
......
......@@ -10,10 +10,17 @@ endif(COMMAND cmake_policy)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
if(Slicer3_USE_PYTHON)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
if(LoadableModule_USE_PYTHON)
find_package(PythonLibs)
endif(Slicer3_USE_PYTHON)
endif(LoadableModule_USE_PYTHON)
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
# --------------------------------------------------------------------------
# Include dirs
......@@ -22,16 +29,13 @@ set(include_dirs
${CMAKE_CURRENT_SOURCE_DIR}
)
if(Slicer3_USE_PYTHON)
if(LoadableModule_USE_PYTHON)
# Python requires a pointer to the Slicer Application
set(include_dirs ${include_dirs} ${PYTHON_INCLUDE_PATH})
endif(Slicer3_USE_PYTHON)
endif(LoadableModule_USE_PYTHON)
include_directories(${include_dirs})
slicer3_get_persistent_property(Slicer3_Libs_INCLUDE_DIRS tmp)
slicer3_set_persistent_property(Slicer3_Libs_INCLUDE_DIRS ${tmp} ${include_dirs})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/LoadableModuleConfigure.h.in
${CMAKE_CURRENT_BINARY_DIR}/LoadableModuleConfigure.h
......@@ -97,9 +101,9 @@ set(link_libs
ITKEXPAT
itksys
)
if(Slicer3_USE_PYTHON)
if(LoadableModule_USE_PYTHON)
set(link_libs ${link_libs} ${PYTHON_LIBRARIES})
endif(Slicer3_USE_PYTHON)
endif(LoadableModule_USE_PYTHON)
if(NOT WIN32 AND NOT APPLE)
set(link_libs ${link_libs} util)
endif(NOT WIN32 AND NOT APPLE)
......@@ -109,9 +113,6 @@ endif(NOT WIN32 AND HAVE_BFD)
target_link_libraries(${lib_name} ${link_libs})
slicer3_get_persistent_property(Slicer3_Libs_LIBRARIES tmp)
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES ${tmp} ${lib_name})
install(TARGETS ${lib_name}
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/${PROJECT_NAME} COMPONENT RuntimeLibraries
......
......@@ -13,3 +13,4 @@
#endif
#cmakedefine HAVE_BFD
#cmakedefine LoadableModule_USE_PYTHON
......@@ -33,9 +33,7 @@
#include "BinaryFileDescriptor.h"
#endif
#include "vtkSlicerConfigure.h" /* Slicer3_USE_* */
#ifdef Slicer3_USE_PYTHON
#ifdef LoadableModule_USE_PYTHON
// If debug, Python wants pythonxx_d.lib, so fake it out
#ifdef _DEBUG
#undef _DEBUG
......
......@@ -5,6 +5,13 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
# --------------------------------------------------------------------------
# Include dirs
......@@ -20,9 +27,6 @@ set(include_dirs
include_directories(${include_dirs})
slicer3_get_persistent_property(Slicer3_Libs_INCLUDE_DIRS tmp)
slicer3_set_persistent_property(Slicer3_Libs_INCLUDE_DIRS ${tmp} ${include_dirs})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/itkMGHImageIOConfigure.h.in
${CMAKE_CURRENT_BINARY_DIR}/itkMGHImageIOConfigure.h
......@@ -53,12 +57,8 @@ add_library(${lib_name}
target_link_libraries(${lib_name}
ITKIO
MRML
)
slicer3_get_persistent_property(Slicer3_Libs_LIBRARIES tmp)
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES ${tmp} ${lib_name})
install(TARGETS ${lib_name}
RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
LIBRARY DESTINATION lib/${PROJECT_NAME} COMPONENT RuntimeLibraries
......@@ -78,11 +78,15 @@ target_link_libraries(MGHIOPlugin
${lib_name}
)
if(NOT DEFINED MGHImageIO_INSTALL_ITKFACTORIES_DIR)
set(MGHImageIO_INSTALL_ITKFACTORIES_DIR lib/ITKFactories)
endif(NOT DEFINED MGHImageIO_INSTALL_ITKFACTORIES_DIR)
# We should switch to SET_TARGET_PROPERTIES() with LIBRARY_OUTPUT_DIRECTORY
# once CMake 2.6 is released. Until then, we need to hack a solution with
# ADD_CUSTOM_COMMAND()
#SET_TARGET_PROPERTIES(MGHIOPlugin PROPERTIES
# LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}")
# LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${MGHImageIO_INSTALL_ITKFACTORIES_DIR}")
get_target_property(LIBFULLNAME MGHIOPlugin LOCATION)
get_filename_component(LIBNAME ${LIBFULLNAME} NAME)
......@@ -90,7 +94,7 @@ get_filename_component(LIBNAME ${LIBFULLNAME} NAME)
add_custom_command(TARGET MGHIOPlugin
DEPENDS ${LIB_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${LIBFULLNAME} ${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}/${CMAKE_CFG_INTDIR}/${LIBNAME})
COMMAND ${CMAKE_COMMAND} -E copy ${LIBFULLNAME} ${CMAKE_BINARY_DIR}/${MGHImageIO_INSTALL_ITKFACTORIES_DIR}/${CMAKE_CFG_INTDIR}/${LIBNAME})
# make a copy named '.so' for compatibility with the expectations
# of the ITK Factory mechanism on macs
......@@ -98,16 +102,16 @@ add_custom_command(TARGET MGHIOPlugin
if(APPLE)
add_custom_command(
TARGET MGHIOPlugin
DEPENDS ${Slicer3_BINARY_DIR}/bin/libMGHIOPlugin.dylib
DEPENDS ${MGHIO_BINARY_DIR}/bin/libMGHIOPlugin.dylib
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}/libMGHIOPlugin.dylib
${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_ITKFACTORIES_DIR}/libMGHIOPlugin.so
${CMAKE_BINARY_DIR}/${MGHImageIO_INSTALL_ITKFACTORIES_DIR}/libMGHIOPlugin.dylib
${CMAKE_BINARY_DIR}/${MGHImageIO_INSTALL_ITKFACTORIES_DIR}/libMGHIOPlugin.so
)
endif(APPLE)
install(TARGETS MGHIOPlugin
RUNTIME DESTINATION ${Slicer3_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${Slicer3_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
RUNTIME DESTINATION ${MGHImageIO_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${MGHImageIO_INSTALL_ITKFACTORIES_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION lib/${PROJECT_NAME} COMPONENT Development
)
......@@ -7,13 +7,6 @@
#pragma warning ( disable : 4275 )
#endif
#cmakedefine CMAKE_WORDS_BIGENDIAN
#ifdef CMAKE_WORDS_BIGENDIAN
#define WORDS_BIGENDIAN
#else
#define WORDS_LITTLEENDIAN
#endif
#cmakedefine BUILD_SHARED_LIBS
#ifndef BUILD_SHARED_LIBS
#define MGHIO_STATIC
......
......@@ -5,24 +5,64 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
option(MRML_USE_TEEM "Build MRML with TEEM support." ON)
mark_as_advanced(MRML_USE_TEEM)
if(MRML_USE_TEEM)
find_package(TEEM REQUIRED)
include(${TEEM_USE_FILE})
option(MRML_USE_vtkTeem "Build MRML with vtkTeem support." ON)
mark_as_advanced(MRML_USE_vtkTeem)
endif(MRML_USE_TEEM)
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
# --------------------------------------------------------------------------
# Include dirs
set(include_dirs
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${vtkITK_SOURCE_DIR}
${vtkITK_BINARY_DIR}
${vtkTeem_SOURCE_DIR}
${vtkTeem_BINARY_DIR}
${FreeSurfer_SOURCE_DIR}