CMakeLists.txt 654 B

1234567891011121314151617181920212223
  1. cmake_minimum_required(VERSION 2.8)
  2. project(QtAutomoc)
  3. find_package(Qt4 REQUIRED)
  4. include(UseQt4)
  5. include_directories(${CMAKE_CURRENT_BINARY_DIR})
  6. add_definitions(-DFOO -DSomeDefine="Barx")
  7. # enable relaxed mode so automoc can handle all the special cases:
  8. set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
  9. # create an executable and a library target, both requiring automoc:
  10. add_library(codeeditorLib STATIC codeeditor.cpp)
  11. add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp private_slot.cpp)
  12. set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE)
  13. target_link_libraries(foo codeeditorLib ${QT_LIBRARIES} )