Skip to content

Commit

Permalink
Add CMakeLists & gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
romavis committed Nov 9, 2020
1 parent 77ab19d commit 7d42cd3
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default CMake buildroot
build/
# VSCode files
.vscode/
67 changes: 67 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
cmake_minimum_required(VERSION 3.13)
project(WinNWT5 C CXX)


#set(CMAKE_AUTOMOC ON)
# Find Qt5 libs
find_package(Qt5 COMPONENTS Widgets LinguistTools PrintSupport SerialPort REQUIRED)
# List of sources
set(NWT_SOURCES
main.cpp
mainwindow.cpp
nwt7mainclass.cpp
sweepcurvewidget.cpp
optiondlg.cpp
profildlg.cpp
fmarkedlg.cpp
configfile.cpp
markersdlg.cpp
probedlg.cpp
firmwaredlg.cpp
Attenuator.cpp
)
# List of headers (needed for MOC)
set(NWT_HEADERS
constdef.h
mainwindow.h
nwt7mainclass.h
sweepcurvewidget.h
optiondlg.h
profildlg.h
fmarkedlg.h
configfile.h
markersdlg.h
probedlg.h
firmwaredlg.h
BugReport.h
Attenuator.h
build.h
modem.hpp
)
# Modem implementation
if(WIN32)
list(APPEND NWT_SOURCES modem_win.cpp)
elseif(UNIX)
list(APPEND NWT_SOURCES modem_lin.cpp)
else()
message(FATAL_ERROR "OS ${CMAKE_SYSTEM_NAME} not supported")
endif()
# Resources
qt5_add_resources(NWT_SOURCES icon.qrc)
# Translations
set(TS_FILES
app_cn.ts
app_de.ts
app_ea.ts
app_es.ts
app_hu.ts
app_nl.ts
app_pl.ts
app_ru.ts
)
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "l10n")
qt5_add_translation(qmFiles ${TS_FILES})
# A final executable
QT5_WRAP_CPP(MOC_FILES ${NWT_HEADERS})
add_executable(winnwt5 ${NWT_SOURCES} ${MOC_FILES})
target_link_libraries(winnwt5 PRIVATE Qt5::Core Qt5::Widgets Qt5::PrintSupport Qt5::SerialPort)

0 comments on commit 7d42cd3

Please sign in to comment.