Blame view

CMakeLists.txt 1.82 KB
adeae3a0   David Mayerich   Initial commit, s...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  #Specify the version being used aswell as the language
  cmake_minimum_required(VERSION 2.8.11)
  
  #Name your project here
  project(hsiview)
  
  #set up qt5
  #------------------------------------------
  #set the module directory
  set(CMAKE_AUTOMOC ON)
  
  # As moc files are generated in the binary dir, tell CMake
    # to always look for includes there:
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
  #get Qt5
  find_package(Qt5Core)
  find_package(Qt5Widgets)
  find_package(Qt5PrintSupport)
  
  
  #-------------------------------------------
  
  #set the module directory
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
  
  #find the pthreads package
  find_package(Threads)
  
  #find the X11 package
  find_package(X11)
  
  #find the STIM library
  find_package(STIM REQUIRED)
  
  #find the libjpeg library
  #find_package(JPEG)
  
  #if the JPEG library is available, image.h can be compiled with JPEG support
  if(JPEG_FOUND)
  	add_definitions(-DJPEG_FOUND)
  endif(JPEG_FOUND)
  
69e88826   David Mayerich   removed the depen...
44
45
46
  #set C++11 flags (needed for multi-threading)
  #set(CMAKE_CXX_FLAGS "-lqcustomplot")
  
adeae3a0   David Mayerich   Initial commit, s...
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  
  include_directories(
  					${STIM_INCLUDE_DIRS}
  					${JPEG_INCLUDE_DIR}
  					)
  
  #Assign source files to the appropriate variables
  file(GLOB SRC_CPP "*.cpp")
  file(GLOB SRC_H "*.h")
  file(GLOB SRC_UI "*.ui")
  
  #determine which source files have to be moc'd
  Qt5_wrap_cpp(UI_MOC ${SRC_H})
  Qt5_wrap_ui(UI_H ${SRC_UI})
  Qt5_add_resources(ALL_RCC ${ALL_QRC})
  
  #create an executable file
  add_executable(hsiview
  					${SRC_H} 
  					${SRC_CPP} 
  					${UI_H}
  					)
  
  #set the link libraries
  target_link_libraries(hsiview 
  		  ${CMAKE_THREAD_LIBS_INIT}
  		  ${X11_LIBRARIES}
  		  ${JPEG_LIBRARY}
  		  Qt5::Widgets
  		  Qt5::Core
  		  Qt5::PrintSupport
  		  )
  
  #copy data files to the build directory
  #set up copying data files
  configure_file(data/breast-resection breast-resection COPYONLY)
  configure_file(data/breast-resection.hdr breast-resection.hdr COPYONLY)