ITK/Examples/CMake/CheckForModule
From KitwarePublic
< ITK | Examples
Jump to navigationJump to search
Revision as of 15:21, 20 October 2012 by Daviddoria (talk | contribs) (Created page with "==CheckForModule.cxx== <source lang="cpp"> #include "itkImage.h" #include <iostream> int main(int argc, char *argv[]) { return 0; } </source> <source lang="cmake"> cmake_mi...")
CheckForModule.cxx
<source lang="cpp">
- include "itkImage.h"
- include <iostream>
int main(int argc, char *argv[]) {
return 0;
} </source>
<source lang="cmake"> cmake_minimum_required(VERSION 2.6)
PROJECT(CheckForModule)
FIND_PACKAGE(ITK REQUIRED ITKCommon) INCLUDE(${ITK_USE_FILE})
- This should fail
if(NOT ITKTesting_LOADED)
message(FATAL_ERROR "Testing module is required but not available.")
endif()
- This should pass
if(NOT ITKCommon_LOADED)
message(FATAL_ERROR "Common module is required but not available.")
endif()
ADD_EXECUTABLE(CheckForModule CheckForModule.cxx) TARGET_LINK_LIBRARIES(CheckForModule ${ITK_LIBRARIES})
</source>