[cmake] Build qttxf tool

pull/3/head
Hleb Valoshka 2019-04-05 13:33:58 +03:00
parent 1d07836fa4
commit 870f2feebd
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,4 @@
add_subdirectory(cmod)
add_subdirectory(qttxf)
add_subdirectory(stardb)
add_subdirectory(xyzv2bin)

View File

@ -0,0 +1,23 @@
if(NOT ENABLE_QT)
message("Qt frontend is disabled, not building qttxf.")
return()
endif()
if(APPLE AND EXISTS /usr/local/opt/qt5)
# Homebrew installs Qt5 (up to at least 5.9.1) in
# /usr/local/qt5, ensure it can be found by CMake since
# it is not in the default /usr/local prefix.
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
endif()
set(QT_LIBS Widgets)
find_package(Qt5 COMPONENTS ${QT_LIBS} CONFIG REQUIRED)
# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(qttxf WIN32 main.cpp mainwindow.cpp)
install(TARGETS qttxf RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
qt5_use_modules(qttxf ${QT_LIBS})