summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-qt.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-09 19:14:48 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-10 03:18:58 +0100
commit6388d767f4510a3771909a91ad72ad4963d029db (patch)
tree3cda0b925d1115873179d32be3a4ca72139cc54a /cmake/opentrack-qt.cmake
parent7d101a1c2827b5e7a373fb0d0a68099fb692e55a (diff)
cmake: cleanup, decruft, probably fix mingw
Diffstat (limited to 'cmake/opentrack-qt.cmake')
-rw-r--r--cmake/opentrack-qt.cmake41
1 files changed, 13 insertions, 28 deletions
diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake
index f297f482..bb0ea4a3 100644
--- a/cmake/opentrack-qt.cmake
+++ b/cmake/opentrack-qt.cmake
@@ -15,7 +15,7 @@ if(WIN32)
message(FATAL_ERROR "${i} ${path}")
endif()
install(FILES "${path}" DESTINATION .)
- if(NOT MSVC AND opentrack_install-debug-info AND EXISTS "${path}.pdb")
+ if(MSVC AND opentrack_install-debug-info AND EXISTS "${path}.pdb")
install(FILES "${path}.pdb" DESTINATION "${opentrack-hier-debug}")
endif()
endforeach()
@@ -24,32 +24,17 @@ if(WIN32)
install(FILES "${qwindows-dll}" DESTINATION "./platforms")
endif()
-function(is_msvc_sln_generator var)
- string(FIND "${CMAKE_GENERATOR}" "Visual Studio " is-msvc)
- if(is-msvc EQUAL 0)
- set(${var} TRUE PARENT_SCOPE)
- else()
- set(${var} FALSE PARENT_SCOPE)
- endif()
-endfunction()
-
-if(MSVC AND FALSE)
- # on .sln generator we have no editbin in path
- is_msvc_sln_generator(is-msvc)
- if(is-msvc)
- # this is bad but what can we do? searching for vcvarsall.bat
- # would be easier, but then we'd have to differentiate x86/amd64
- # cross tools, etc. which is a can of worms and if/else branches.
- get_filename_component(linker-dir "${CMAKE_LINKER}" DIRECTORY)
- find_file(editbin-executable-filepath "editbin.exe" "${linker-dir}" "${linker-dir}/.." "${linker-dir}/../..")
- otr_escape_string("${editbin-executable-filepath}" editbin-executable)
- else()
- set(editbin-executable "editbin")
+function(otr_qt n)
+ if(".${${n}-hh}" STREQUAL ".")
+ message(FATAL_ERROR "project ${n} not globbed")
endif()
+ qt5_wrap_cpp(${n}-moc ${${n}-hh} OPTIONS --no-notes)
+ qt5_wrap_ui(${n}-uih ${${n}-ui})
+ qt5_add_resources(${n}-rcc ${${n}-rc})
- install(CODE "
- foreach(i Qt5Core Qt5Gui Qt5Network Qt5SerialPort Qt5Widgets platforms/qwindows)
- execute_process(COMMAND \"${editbin-executable}\" -nologo -SUBSYSTEM:WINDOWS,5.01 -OSVERSION:5.1 \"\${i}.dll\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}\")
- endforeach()
- ")
-endif()
+ foreach(i moc uih rcc)
+ set(${n}-${i} "${${n}-${i}}" PARENT_SCOPE)
+ list(APPEND ${n}-all ${${n}-${i}})
+ endforeach()
+ set(${n}-all "${${n}-all}" PARENT_SCOPE)
+endfunction()