Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@ IF(NOT ITK_SOURCE_DIR)
FIND_PACKAGE(ITK REQUIRED)
LIST(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
INCLUDE(ITKModuleExternal)

OPTION(BUILD_EXAMPLES "Build the examples" OFF)
if(BUILD_EXAMPLES)
ADD_SUBDIRECTORY( examples )
ENDIF()

OPTION(BUILD_DOCUMENTATION "Generate documentation from LaTeX files, source code examples and result screenshots" OFF)
IF(BUILD_DOCUMENTATION)
ADD_SUBDIRECTORY( doc )
ENDIF()
ELSE()
itk_module_impl()
ENDIF()

CMAKE_DEPENDENT_OPTION(Module_${PCA}_BUILD_EXAMPLES "Build the examples" OFF "BUILD_EXAMPLES" OFF)
if(Module_${PCA}_BUILD_EXAMPLES)
ADD_SUBDIRECTORY( examples )
ENDIF()

CMAKE_DEPENDENT_OPTION(Module_${PCA}_BUILD_EXAMPLES "Build the examples" OFF "BUILD_EXAMPLES" OFF)
if(Module_${PCA}_BUILD_EXAMPLES)
ADD_SUBDIRECTORY( examples )
ENDIF()

CMAKE_DEPENDENT_OPTION(Module_${PCA}_BUILD_DOCUMENTATION "Generate documentation from LaTeX files, source code examples and result screenshots" OFF
"BUILD_DOCUMENTATION" OFF)
IF(Module_${PCA}_BUILD_DOCUMENTATION)
ADD_SUBDIRECTORY( doc )
CMAKE_DEPENDENT_OPTION(Module_${PCA}_BUILD_DOCUMENTATION "Generate documentation from LaTeX files, source code examples and result screenshots" OFF "BUILD_DOCUMENTATION" OFF)
IF(Module_${PCA}_BUILD_DOCUMENTATION)
ADD_SUBDIRECTORY( doc )
ENDIF()
ENDIF()
24 changes: 9 additions & 15 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@

#######################
#######################
#
# Define Executables
#
#######################
#######################

FIND_PACKAGE(ITK REQUIRED COMPONENTS PrincipalComponentsAnalysis)

include_directories( ${PrincipalComponentsAnalysis_SOURCE_DIR}/Source )

ADD_EXECUTABLE(VectorKernelPCA VectorKernelPCA.cxx )
TARGET_LINK_LIBRARIES(VectorKernelPCA ${ITK_LIBRARIES})
if(NOT ITK_SOURCE_DIR)
find_package(ITK REQUIRED COMPONENTS PrincipalComponentsAnalysis)
include(${ITK_USE_FILE})
else()
itk_module_impl()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea:

Instead of

itk_module_impl()
itk_module_test()
set(ITK_LIBRARIES ${${PCA}-Test_LIBRARIES})

(untested)

endif()

ADD_EXECUTABLE(VectorKernelPCA VectorKernelPCA.cxx)
TARGET_LINK_LIBRARIES(VectorKernelPCA ${ITK_LIBRARIES})