# Description: Build configuration for the GeoDMA Executable
#
#  Author: Raian Vargas Maretto <raian@dpi.inpe.br>
#          Thales Sehn Korting <tkorting@dpi.inpe.br>
#          Emiliano Ferreira Castejon <castejon@dpi.inpe.br>
#

# Includes
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${terralib_INCLUDE_DIRS})
#include_directories(${terralib_DIR})
include_directories(${Qt5_INCLUDE_DIRS})

#Set include directories location
#include_directories(${GEODMA_SRC_DIR}/geodmalib/featureextraction
#                   ${GEODMA_SRC_DIR}/geodmalib/common
#                   ${GEODMA_SRC_DIR}/geodmalib/datamanager
#)
include_directories(${GEODMA_SRC_DIR})

file(GLOB GEODMA_EXEC_SRCS ${GEODMA_SRC_DIR}/executable/*.cpp)

# Setting Dependencies
set(GEODMA_EXEC_DEPENDENCIES geodma_mod_featextraction
                             geodma_mod_common
                             geodma_mod_datamanager
                             geodma_mod_guicomponents
                             ${Boost_FILESYSTEM_LIBRARY}
)

add_executable(geodma ${GEODMA_EXEC_SRCS})

target_link_libraries(geodma ${GEODMA_EXEC_DEPENDENCIES})

if(GEODMA_SOURCE_VERIFY_ENABLED)
    add_style_check_target(geodma "${GEODMA_EXEC_SRCS}")
endif()


set_target_properties(geodma
                      PROPERTIES VERSION ${GEODMA_VERSION_MAJOR}.${GEODMA_VERSION_MINOR}
                                 SOVERSION ${GEODMA_VERSION_MAJOR}.${GEODMA_VERSION_MINOR})
#                                 INSTALL_NAME_DIR "@executable_path/../lib")

install(TARGETS geodma
        EXPORT geodma-targets
        RUNTIME DESTINATION ${GEODMA_DESTINATION_RUNTIME} COMPONENT runtime
        LIBRARY DESTINATION ${GEODMA_DESTINATION_LIBRARY} COMPONENT runtime
        ARCHIVE DESTINATION ${GEODMA_DESTINATION_ARCHIVE} COMPONENT runtime
        BUNDLE DESTINATION . COMPONENT runtime)