#################################################
#   ___________    ____ ______  __ __  _____    #
#   \____ \__  \ _/ ___\\____ \|  |  \/  ___/   #
#   |  |_> > __ \\  \___|  |_> >  |  /\___ \    #
#   |   __(____  /\___  >   __/|____//____  >   #
#   |__|       \/     \/|__|              \/    #
#                                               #
#################################################
project(PacpusDBCDecriptor)

# ========================================
# Compiler definitions
# ========================================
add_definitions(${QT_DEFINITIONS})

# ========================================
# Include directories
# ========================================
include_directories(
    ${CMAKE_BINARY_DIR}/DBITEPlayer
    ${QT_INCLUDE_DIR}
)

# ========================================
# Link directories
# ========================================
link_directories(
    ${PROJECT_BINARY_DIR}/../PacpusLib
    ${PROJECT_BINARY_DIR}/../FileLib
    ${PROJECT_BINARY_DIR}/../DBITEPlayerLib
	${PROJECT_BINARY_DIR}/../PacpusTools
	${PROJECT_BINARY_DIR}/../RoadTime
)

# ========================================
# List of sources
# ========================================
set(PROJECT_HDRS

)
set(PROJECT_SRCS
    src/mainwindow.cpp
    src/main.cpp
    src/mainwindow.h
    src/structure.h
    ../ico/heudiasycIco.rc
)

# ========================================
# Files to MOC
# ========================================
SET(
    FILES_TO_MOC
    src/mainwindow.h
)

SET(
    UI_FILES
    src/mainwindow.ui    
)

# ========================================
# Call MOC
# ========================================
QT_WRAP_CPP(
    PROJECT_MOC_SRCS
    ${FILES_TO_MOC}
)

QT_WRAP_UI(
    PROJECT_UI_SRCS
    ${UI_FILES}
)

# ========================================
# Build an executable
# ========================================
pacpus_add_executable(
    ${PROJECT_NAME}
    ${GUI_TYPE} 
    ${PROJECT_SRCS} 
    ${PROJECT_MOC_SRCS} 
    ${PROJECT_UI_SRCS}

)

# ========================================
# Libraries & Dependencies
# ========================================

set(OPT_LIBRARIES
    optimized dbiteplayerlib debug dbiteplayerlib_d
    optimized FileLib debug FileLib_d
    optimized PacpusLib debug PacpusLib_d
)

# Windows platform
if(WIN32)
    LIST(APPEND OPT_LIBRARIES
        optimized ROAD_TIME debug ROAD_TIME_d
        Winmm
    )
endif()

if(UNIX)
    LIST(APPEND OPT_LIBRARIES
        pthread
    )
endif()

# All the platform
target_link_libraries(
    ${PROJECT_NAME}
    ${QT_LIBRARIES}
    ${OPT_LIBRARIES}
    ${PACPUS_DEPENDENCIES_LIB}
)

# ========================================
# Install
# ========================================
pacpus_install(${PROJECT_NAME})

# ========================================
# Folder
# ========================================
pacpus_folder(${PROJECT_NAME} "tools")
