CMakeLists.txt 1.1 KB

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