~gary-wzl77/+junk/newproperty

« back to all changes in this revision

Viewing changes to src/CMakeLists.txt

  • Committer: Gary.Wzl
  • Date: 2015-08-31 09:23:43 UTC
  • Revision ID: gary.wang@canonical.com-20150831092343-x7coc5ukz9yelqjn
Init repo

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Put the ini file in the build directory next to the scope
 
3
# .so file so test tools can find both easily.
 
4
intltool_merge_translations(
 
5
  "${CMAKE_SOURCE_DIR}/data/${SCOPE_NAME}.ini.in"
 
6
  "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini"
 
7
  ALL
 
8
  UTF8
 
9
)
 
10
 
 
11
# Install the scope ini file
 
12
install(
 
13
  FILES "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini"
 
14
  DESTINATION ${SCOPE_INSTALL_DIR}
 
15
)
 
16
 
 
17
configure_file(
 
18
  "${CMAKE_SOURCE_DIR}/data/logo.png"
 
19
  "${CMAKE_CURRENT_BINARY_DIR}/logo.png"
 
20
  @ONLY
 
21
  COPYONLY
 
22
)
 
23
 
 
24
# The sources to build the scope
 
25
set(SCOPE_SOURCES
 
26
  api/client.cpp
 
27
  scope/preview.cpp
 
28
  scope/query.cpp
 
29
  scope/scope.cpp
 
30
)
 
31
 
 
32
# Find all the headers
 
33
file(GLOB_RECURSE
 
34
  SCOPE_HEADERS
 
35
  "${CMAKE_SOURCE_DIR}/include/*.h" 
 
36
)
 
37
 
 
38
# Build an object library for the scope code
 
39
add_library(
 
40
  scope-static OBJECT
 
41
  ${SCOPE_SOURCES}
 
42
  ${SCOPE_HEADERS}
 
43
)
 
44
 
 
45
# Ensure we export all the symbols
 
46
set_target_properties(
 
47
  scope-static
 
48
  PROPERTIES
 
49
    LINK_FLAGS "-Wl,--export-all-symbols"
 
50
)
 
51
 
 
52
# Build a shared library containing our scope code.
 
53
# This will be the actual plugin that is loaded.
 
54
add_library(
 
55
  scope SHARED
 
56
  $<TARGET_OBJECTS:scope-static>
 
57
)
 
58
 
 
59
# Link against the object library and our external library dependencies
 
60
target_link_libraries(
 
61
  scope
 
62
  ${SCOPE_LDFLAGS}
 
63
  ${Boost_LIBRARIES}
 
64
)
 
65
 
 
66
qt5_use_modules(
 
67
  scope
 
68
  Core
 
69
)
 
70
 
 
71
# Set the correct library output name to conform to the securiry policy 
 
72
set_target_properties(
 
73
  scope
 
74
  PROPERTIES
 
75
    OUTPUT_NAME "${SCOPE_NAME}"
 
76
)
 
77
 
 
78
# Install the scope shared library
 
79
install(
 
80
  TARGETS scope
 
81
  LIBRARY DESTINATION ${SCOPE_INSTALL_DIR}
 
82
)
 
83