CMakeLists.txt 458 B

1234567891011121314
  1. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  2. set(CMAKE_AUTOMOC ON)
  3. # Object library a defined in a subdirectory
  4. add_subdirectory(a)
  5. # Object library b defined locally
  6. include_directories(b)
  7. add_library(b OBJECT b/classb.cpp)
  8. target_compile_features(b PRIVATE ${QT_COMPILE_FEATURES})
  9. # Executable with OBJECT library generator expressions
  10. add_executable(someProgram main.cpp $<TARGET_OBJECTS:a> $<TARGET_OBJECTS:b>)
  11. target_link_libraries(someProgram ${QT_LIBRARIES})