CMakeLists.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. project(alsoft-config)
  2. option(ALSOFT_NO_QT5 "Use Qt4 instead of Qt5 for alsoft-config" FALSE)
  3. include_directories("${alsoft-config_BINARY_DIR}")
  4. set(alsoft-config_SRCS main.cpp
  5. mainwindow.cpp
  6. )
  7. set(alsoft-config_UIS mainwindow.ui)
  8. set(alsoft-config_MOCS mainwindow.h)
  9. find_package(Qt5Widgets)
  10. if(Qt5Widgets_FOUND AND NOT ALSOFT_NO_QT5)
  11. qt5_wrap_ui(UIS ${alsoft-config_UIS})
  12. qt5_wrap_cpp(MOCS ${alsoft-config_MOCS})
  13. add_executable(alsoft-config ${alsoft-config_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS})
  14. target_link_libraries(alsoft-config Qt5::Widgets)
  15. set_property(TARGET alsoft-config APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
  16. set_target_properties(alsoft-config PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OpenAL_BINARY_DIR})
  17. if(TARGET build_version)
  18. add_dependencies(alsoft-config build_version)
  19. endif()
  20. install(TARGETS alsoft-config
  21. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  22. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  23. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  24. )
  25. else()
  26. # Need Qt 4.8.0 or newer for the iconset theme attribute to work
  27. find_package(Qt4 4.8.0 COMPONENTS QtCore QtGui)
  28. if(QT4_FOUND)
  29. include(${QT_USE_FILE})
  30. qt4_wrap_ui(UIS ${alsoft-config_UIS})
  31. qt4_wrap_cpp(MOCS ${alsoft-config_MOCS})
  32. add_executable(alsoft-config ${alsoft-config_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS})
  33. target_link_libraries(alsoft-config ${QT_LIBRARIES})
  34. set_property(TARGET alsoft-config APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
  35. set_target_properties(alsoft-config PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OpenAL_BINARY_DIR})
  36. if(TARGET build_version)
  37. add_dependencies(alsoft-config build_version)
  38. endif()
  39. install(TARGETS alsoft-config
  40. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  41. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  42. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  43. )
  44. endif()
  45. endif()