CMakeLists.txt 2.46 KB
#Specify the version being used aswell as the language
cmake_minimum_required(VERSION 2.8.9)
#Name your project here
project(imie)

#set (CMAKE_PREFIX_PATH "${QTDIR}; ${WINSDK_LIB}")

#set the module directory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
set(CMAKE_AUTMOC ON)
#find the Qt5
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5OpenGL REQUIRED)
include_directories(${QT_INCLUDE_DIRECTORY})

#set up CUDA
find_package(CUDA)

#find OpenGL
find_package(OpenGL REQUIRED)

#find GLUT
#set(GLUT_ROOT_PATH $ENV{GLUT_ROOT_PATH})
#find_package(GLUT REQUIRED)

#find GLEW
find_package(GLEW REQUIRED)

#add Qt OpenGL stuff
#set(QT_USE_QTOPENGL TRUE)

#ask the user for the RTS location
set(RTS_ROOT_PATH $ENV{RTS_ROOT_PATH})
find_package(RTS REQUIRED)

#set the include directories
include_directories(
	${CMAKE_CURRENT_BINARY_DIR}
	${Qt5Widgets_INCLUDES}
	${Qt5Core_INCLUDES}
	${Qt5Gui_INCLUDES}
	${Qt5OpenGL_INCLUDES}
#	${QT_QTOPENGL_INCLUDE_DIR}
	${OPENGL_INCLUDE_DIR}
	${GLEW_INCLUDE_PATH}
#	${GLUT_INCLUDE_DIR}
	${RTS_INCLUDE_DIR}
)

#enable warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
	add_definitions(-Wall)
endif()

#Assign source files to the appropriate variables
file(GLOB SRC_CPP "*.cpp")
file(GLOB SRC_H "*.h")
file(GLOB SRC_UI "*.ui")
file(GLOB SRC_QRC "*.qrc")
file(GLOB SRC_CU "*.cu")

#set up copying data files
configure_file(etaPolystyrene.txt ${CMAKE_CURRENT_BINARY_DIR}/etaPolystyrene.txt @ONLY)
configure_file(etaPMMA.txt ${CMAKE_CURRENT_BINARY_DIR}/etaPMMA.txt @ONLY)
configure_file(source_midIR.txt ${CMAKE_CURRENT_BINARY_DIR}/source_midIR.txt @ONLY)

#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})

#moc the necessary files
#Qt5_automoc(${ALL_CPP})

source_group(QtMoc FILES ${UI_MOC})
source_group(QtUI FILES ${SRC_UI})

#create an executable
cuda_add_executable(imie ${SRC_CPP} ${SRC_H} ${UI_H} ${UI_MOC} ${ALL_RCC} ${SRC_CU})

#specify which qt5 modules to use
qt5_use_modules(imie Core Widgets OpenGL Gui)

#set the link libraries
target_link_libraries(imie
					${Qt5Widgets_LIBRARIES}
					${Qt5Core_LIBRARIES}
					${Qt5Gui_LIBRARIES}
					${Qt5OpenGL_LIBRARIES}
					#${QT_QTOPENGL_LIBRARY}
					${OPENGL_gl_LIBRARY}
					${OPENGL_glu_LIBRARY}
					${GLEW_LIBRARY}
					#${QWT_LIBRARY}
					)