CMakeLists.txt 931 B

12345678910111213141516171819202122232425262728293031
  1. # Test AUTOMOC and AUTORCC on source files with the same name
  2. # but in different subdirectories
  3. add_executable(sameName
  4. aaa/bbb/item.cpp
  5. aaa/bbb/data.qrc
  6. aaa/item.cpp
  7. aaa/data.qrc
  8. bbb/aaa/item.cpp
  9. bbb/aaa/data.qrc
  10. bbb/item.cpp
  11. bbb/data.qrc
  12. ccc/item.cpp
  13. ccc/data.qrc
  14. item.cpp
  15. data.qrc
  16. main.cpp
  17. )
  18. target_link_libraries(sameName ${QT_LIBRARIES})
  19. set_target_properties(sameName PROPERTIES AUTOMOC TRUE AUTORCC TRUE)
  20. # Set different compression levels
  21. if (QT_TEST_VERSION STREQUAL 4)
  22. set(rccCompress "-compress")
  23. else()
  24. set(rccCompress "--compress")
  25. endif()
  26. set_target_properties(sameName PROPERTIES AUTORCC_OPTIONS "${rccCompress};0" )
  27. set_source_files_properties(aaa/data.qrc PROPERTIES AUTORCC_OPTIONS "${rccCompress};1" )
  28. set_source_files_properties(bbb/data.qrc PROPERTIES AUTORCC_OPTIONS "${rccCompress};2" )
  29. set_source_files_properties(ccc/data.qrc PROPERTIES AUTORCC_OPTIONS "${rccCompress};3" )