#########################################################################
# Set target name und set path to data folder of the target
#########################################################################

SET(TARGETNAME myApplication)
# data path not needed yet
SET(TARGET_DATA_PATH "${DATA_PATH}/${TARGETNAME}")


#########################################################################
# Do necessary checking stuff (check for QT and other libraries to link against ...)
#########################################################################

# find osg
INCLUDE(Findosg)
INCLUDE(FindosgUtil)
INCLUDE(FindOpenThreads)
INCLUDE(FindosgViewer)
INCLUDE(FindosgGA)
INCLUDE(FindosgDB)


#########################################################################
# Set basic include directories
#########################################################################

# set include dirs
SET(HEADER_PATH ${DemoApp_SOURCE_DIR}/applications/${TARGETNAME}/include)
INCLUDE_DIRECTORIES(
    ${HEADER_PATH}
    ${OSG_INCLUDE_DIR}
)


#########################################################################
# Collect header and source files and process QT macros (rcc, ui, moc)
#########################################################################

# collect all headers
SET(TARGET_H
	# list your header files here e.g. ${HEADER_PATH}/Box.h
)

# collect the sources
SET(TARGET_SRC
	main.cpp
)


#########################################################################
# Setup groups (mainly for MSVC project folders)
#########################################################################

# do the headers group manually (especially for files with no extension)
SET(HEADERS_GROUP "Header Files")

SOURCE_GROUP(
    ${HEADERS_GROUP}
    FILES ${TARGET_H}     
)

#########################################################################
# Setup groups for resources (mainly for MSVC project folders)
#########################################################################

# First: collect the necessary files which were not collected up to now
# Therefore, fill the following variables: 
# MY_CUDA_SOURCE_FILES - MY_ICE_FILES - MY_MODEL_FILES - MY_SHADER_FILES - MY_UI_FILES - MY_XML_FILES

# add cuda-files to MY_CUDA_SOURCE_FILES: already done with MY_CUDA_SOURCE_FILES

# collect shader files
SET(MY_SHADER_FILES
  # nothing yet
)

# finally, use module to build groups
INCLUDE(GroupInstall)


# now set up the ADDITIONAL_FILES variable to ensure that the files will be visible in the project
SET(ADDITIONAL_FILES
	#${MY_SHADER_FILES}
)


#########################################################################
# Setup libraries to link against
#########################################################################

# put here own project libraries, for example. (Attention: you do not have
# to differentiate between debug and optimized: this is done automatically by cmake
SET(TARGET_ADDITIONAL_LIBRARIES
    # nothing yet...
)


# put here the libraries which are collected in a variable (i.e. most of the FindXXX scrips)
# the macro (LINK_WITH_VARIABLES) ensures that also the ${varname}_DEBUG names will resolved correctly
SET(TARGET_VARS_LIBRARIES 	
	OPENTHREADS_LIBRARY
	OSG_LIBRARY
	OSGUTIL_LIBRARY
	OSGVIEWER_LIBRARY
	OSGGA_LIBRARY
	OSGDB_LIBRARY
)
	

#########################################################################
# Example setup and install
#########################################################################

# this is a user definded macro which does all the work for us
# it also takes into account the variables TARGET_SRC,
# TARGET_H and TARGET_ADDITIONAL_LIBRARIES and TARGET_VARS_LIBRARIES and ADDITIONAL_FILES
SETUP_APPLICATION_WITH_OPENGL_LINKING(${TARGETNAME})
