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