CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. project(Framework)
  2. add_library(foo SHARED
  3. foo.cxx
  4. foo.h
  5. foo2.h
  6. fooPublic.h
  7. fooPrivate.h
  8. fooNeither.h
  9. fooBoth.h
  10. test.lua
  11. )
  12. set_target_properties(foo PROPERTIES
  13. FRAMEWORK TRUE
  14. FRAMEWORK_VERSION ver3
  15. )
  16. # fooNeither.h is marked neither public nor private...
  17. # fooBoth.h is marked both public and private... (private wins...)
  18. set_source_files_properties(foo.h foo2.h fooPublic.h fooBoth.h PROPERTIES
  19. FRAMEWORK_PUBLIC_HEADER TRUE
  20. )
  21. set_source_files_properties(fooPrivate.h fooBoth.h PROPERTIES
  22. FRAMEWORK_PRIVATE_HEADER TRUE
  23. )
  24. set_source_files_properties(test.lua PROPERTIES
  25. FRAMEWORK_RESOURCE TRUE
  26. )
  27. add_executable(bar bar.cxx)
  28. target_link_libraries(bar foo)
  29. # Make a static library and apply the framework properties to it to verify
  30. # that everything still builds correctly, but it will not actually produce
  31. # a framework... The framework properties only apply when the library type
  32. # is SHARED.
  33. #
  34. add_library(fooStatic STATIC
  35. foo.cxx
  36. foo.h
  37. foo2.h
  38. fooPublic.h
  39. fooPrivate.h
  40. fooNeither.h
  41. fooBoth.h
  42. test.lua
  43. )
  44. set_target_properties(fooStatic PROPERTIES
  45. FRAMEWORK TRUE
  46. FRAMEWORK_VERSION none
  47. )
  48. add_executable(barStatic bar.cxx)
  49. target_link_libraries(barStatic fooStatic)