CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. project(vcmieditor)
  2. cmake_minimum_required(VERSION 2.8.7)
  3. include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/include ${CMAKE_CURRENT_SOURCE_DIR})
  4. include_directories(${Qt5Widgets_INCLUDE_DIRS})
  5. set(maped_SRCS
  6. StdInc.cpp
  7. Editor.cpp
  8. Main.cpp
  9. )
  10. set(maped_MOC_HEADERS
  11. Editor.h
  12. )
  13. set(maped_FORMS
  14. editor.ui
  15. )
  16. # Tell CMake to run moc when necessary:
  17. set(CMAKE_AUTOMOC ON)
  18. # As moc files are generated in the binary dir, tell CMake
  19. # to always look for includes there:
  20. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  21. # We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
  22. add_definitions(${Qt5Widgets_DEFINITIONS})
  23. # Executables fail to build with Qt 5 in the default configuration
  24. # without -fPIE. We add that here.
  25. set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} ${CMAKE_CXX_FLAGS}")
  26. qt5_wrap_ui(maped_FORMS_OUT ${maped_FORMS})
  27. add_executable(vcmieditor ${maped_SRCS} ${maped_FORMS_OUT})
  28. # The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
  29. target_link_libraries(vcmieditor vcmi ${Qt5Widgets_LIBRARIES})
  30. set_target_properties(vcmieditor PROPERTIES ${PCH_PROPERTIES})
  31. cotire(vcmieditor)
  32. if (NOT APPLE) # Already inside bundle
  33. install(TARGETS vcmieditor DESTINATION ${BIN_DIR})
  34. endif()