CMakeLists.txt 1.74 KB
#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)


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)