cmake_minimum_required(VERSION 3.4) project(MyApp) add_definitions(-D_AFXDLL) set(CMAKE_MFC_FLAG 1) set(MyApp_SRCS class1.h class1.cpp class2.h class2.cpp class3.h class3.cpp class4.h class4.cpp class5.h class5.cpp MainFrm.h MainFrm.cpp resource.h MyApp.h MyApp.cpp MyApp.rc MyAppDoc.h MyAppDoc.cpp MyAppView.h MyAppView.cpp stdafx.h stdafx.cpp ) add_subdirectory(hlp) add_subdirectory(res) if(WIN32) link_libraries(wsock32) endif(WIN32) find_package(ITK) if(ITK_FOUND) include(${ITK_USE_FILE}) else(ITK_FOUND) message(FATAL_ERROR "Cannot build without ITK. Please set ITK_DIR.") endif(ITK_FOUND) find_package(VTK) if (VTK_FOUND) include(${VTK_USE_FILE}) else(VTK_FOUND) message(FATAL_ERROR "Cannot build without VTK. Please set VTK_DIR.") endif(VTK_FOUND) add_executable(MyApp WIN32 ${MyApp_SRCS}) install_targets(/bin MyApp) target_link_libraries(MyApp ${ITK_LIBRARIES}) target_link_libraries(MyApp ${VTK_LIBRARIES})