~euclide/euclide/bzr-plugin

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: xapantu
  • Date: 2011-08-02 10:56:50 UTC
  • Revision ID: xapantu@gmail.com-20110802105650-yq4ocibzkolo0ysi
New bzr plugin, it launches euclide-bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
project(EuclideSymbols)
 
2
cmake_minimum_required (VERSION 2.6)
 
3
cmake_policy(VERSION 2.6)
 
4
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala)
 
5
 
 
6
find_package(Vala REQUIRED)
 
7
include(ValaVersion)
 
8
ensure_vala_version("0.11.3" MINIMUM)
 
9
include(ValaPrecompile)
 
10
 
 
11
find_package(PkgConfig)
 
12
pkg_check_modules(DEPS REQUIRED gee-1.0 gtk+-3.0 gtksourceview-3.0 euclidecore libpeas-1.0 libpeas-gtk-1.0)
 
13
add_definitions(${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER})
 
14
link_directories(${DEPS_LIBRARY_DIRS})
 
15
vala_precompile(VALA_C
 
16
    bzr.vala
 
17
PACKAGES
 
18
    gtk+-3.0
 
19
    Peas-1.0
 
20
    PeasGtk-1.0
 
21
    euclidecore
 
22
    gee-1.0
 
23
)
 
24
add_library(euclidebzr MODULE ${VALA_C})
 
25
 
 
26
target_link_libraries(euclidebzr ${DEPS_LIBRARIES})
 
27
 
 
28
 MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
 
29
   GET_TARGET_PROPERTY (${_variable} ${_target} ${_property})
 
30
   IF (${_variable} MATCHES NOTFOUND)
 
31
     SET (${_variable} ${_default_value})
 
32
   ENDIF (${_variable} MATCHES NOTFOUND)
 
33
 ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT)
 
34
 
 
35
 MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
 
36
   GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
 
37
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "")
 
38
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "")
 
39
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 0)
 
40
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_age ${_target} LT_VERSION_AGE 0)
 
41
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_revision ${_target} LT_VERSION_REVISION 0)
 
42
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_installed ${_target} LT_INSTALLED yes)
 
43
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes)
 
44
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "")
 
45
   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "")
 
46
   GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
 
47
   GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
 
48
   SET(_laname ${PROJECT_BINARY_DIR}/${_laname}.la)
 
49
   FILE(WRITE ${_laname} "# ${_laname} - a libtool library file\n")
 
50
   FILE(WRITE ${_laname} "# Generated by CMake ${CMAKE_VERSION} (like GNU libtool)\n")
 
51
   FILE(WRITE ${_laname} "\n# Please DO NOT delete this file!\n# It is necessary for linking the library with libtool.\n\n" )
 
52
   FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n")
 
53
   FILE(APPEND ${_laname} "dlname='${_soname}'\n\n")
 
54
   FILE(APPEND ${_laname} "# Names of this library.\n")
 
55
   FILE(APPEND ${_laname} "library_names='${_soname}.${_target_current}.${_target_age}.${_target_revision} ${_soname}.${_target_current} ${_soname}'\n\n")
 
56
   FILE(APPEND ${_laname} "# The name of the static archive.\n")
 
57
   FILE(APPEND ${_laname} "old_library='${_target_static_lib}'\n\n")
 
58
   FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n")
 
59
   FILE(APPEND ${_laname} "dependency_libs='${_target_dependency _libs}'\n\n")
 
60
   FILE(APPEND ${_laname} "# Names of additional weak libraries provided by this library\n")
 
61
   FILE(APPEND ${_laname} "weak_library_names=\n\n")
 
62
   FILE(APPEND ${_laname} "# Version information for ${_laname}.\n")
 
63
   FILE(APPEND ${_laname} "current=${_target_current}\n")
 
64
   FILE(APPEND ${_laname} "age=${_target_age}\n")
 
65
   FILE(APPEND ${_laname} "revision=${_target_revision}\n\n")
 
66
   FILE(APPEND ${_laname} "# Is this an already installed library?\n")
 
67
   FILE(APPEND ${_laname} "installed=${_target_installed}\n\n")
 
68
   FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\n")
 
69
   FILE(APPEND ${_laname} "shouldnotlink=${_target_shouldnotlink}\n\n")
 
70
   FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\n")
 
71
   FILE(APPEND ${_laname} "dlopen='${_target_dlopen}'\n")
 
72
   FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n\n")
 
73
   FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
 
74
   FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}${_install_DIR}'\n")
 
75
   INSTALL( FILES ${_laname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
 
76
 ENDMACRO(CREATE_LIBTOOL_FILE)
 
77
 
 
78
 install(TARGETS euclidebzr DESTINATION share/euclide/plugins/euclidebzr/)
 
79
 install(FILES euclidebzr.plugin DESTINATION share/euclide/plugins/euclidebzr/)
 
80
 create_libtool_file(euclidebzr /share/euclide/plugins/euclidebzr)
 
81
 
 
82
 
 
83
 
 
84
 #install(FILES struct.png DESTINATION share/euclide/plugins/euclidebzr/)