Regression/CMakeLists.txt
2020-11-18 16:24:12 +01:00

58 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 3.10)
project(Regression)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS include/ui)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
file(GLOB_RECURSE source_files
"src/*.cpp"
)
file(GLOB_RECURSE include_files
"include/*.hpp"
)
file(GLOB_RECURSE ui_files
"include/ui/*.ui"
)
qt5_wrap_ui(target_ui_files ${ui_files})
add_executable(regression
${include_files}
${source_files}
${target_ui_files}
)
target_include_directories(regression PRIVATE
"include"
"vendor/csv"
${Qt5_INCLUDE_DIRS}
)
target_link_libraries(regression PRIVATE
Qt5::Widgets
)
if(WIN32)
add_custom_command(TARGET regression POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:Qt5::Widgets> $<TARGET_FILE_DIR:regression>
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:Qt5::Gui> $<TARGET_FILE_DIR:regression>
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:Qt5::Core> $<TARGET_FILE_DIR:regression>
# This is garbage, remove this, Qt just sucks
COMMAND ${CMAKE_COMMAND} -E copy ${Qt5_DIR}/../../../plugins/platforms/qwindowsd.dll $<TARGET_FILE_DIR:regression>
COMMAND ${CMAKE_COMMAND} -E copy ${Qt5_DIR}/../../../plugins/platforms/qwindows.dll $<TARGET_FILE_DIR:regression>
)
endif()
add_custom_command(TARGET regression POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/resources $<TARGET_FILE_DIR:regression>/resources
)