File: CMakeLists.txt

package info (click to toggle)
cb2bib 1.4.9-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,500 kB
  • ctags: 2,613
  • sloc: cpp: 26,112; sh: 481; makefile: 17
file content (135 lines) | stat: -rw-r--r-- 6,995 bytes parent folder | download | duplicates (2)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#-------------------------------------------------------------------------------
#  cb2bib cmake build script
#-------------------------------------------------------------------------------
include(cmake/modules/c2bUtilities.cmake)

#-------------------------------------------------------------------------------
#  cb2bib cmake options and defaults
#-------------------------------------------------------------------------------
project(cb2bib)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  if(WIN32)
    set(CMAKE_INSTALL_PREFIX "C:\Program Files" CACHE PATH "Default install path prefix" FORCE)
  elseif(APPLE)
    set(CMAKE_INSTALL_PREFIX "/Applications" CACHE PATH "Default install path prefix" FORCE)
  else()
    set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Default install path prefix" FORCE)
  endif()
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if(CMAKE_BUILD_TYPE STREQUAL "")
  set(CMAKE_BUILD_TYPE Release)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  add_definitions(-DC2B_DEBUG)
endif()

option(C2B_USE_WEBKIT "Link cb2bib against QtWebKit library." ON)
option(C2B_USE_LZO "Link cb2bib against lzo2 library." ON)
if(UNIX AND NOT APPLE)
  option(C2B_USE_CBPOLL "Use clipboardPoll." ON)
  path_option(C2B_INSTALL_BIN_DIR "Executables installation directory [default: CMAKE_INSTALL_PREFIX/bin]." "${CMAKE_INSTALL_PREFIX}/bin")
  path_option(C2B_INSTALL_DATA_DIR "Data installation directory [default: CMAKE_INSTALL_PREFIX/share/cb2bib]." "${CMAKE_INSTALL_PREFIX}/share/cb2bib")
  path_option(C2B_INSTALL_DESKTOP_DIR "Desktop file installation directory [default: CMAKE_INSTALL_PREFIX/share/applications]." "${CMAKE_INSTALL_PREFIX}/share/applications")
  path_option(C2B_INSTALL_ICON_DIR "Icon file directory [default: CMAKE_INSTALL_PREFIX/share/pixmaps]." "${CMAKE_INSTALL_PREFIX}/share/pixmaps")
endif(UNIX AND NOT APPLE)
if(APPLE)
  set(C2B_USE_CBPOLL OFF)
  path_option(C2B_INSTALL_BIN_DIR "Executables installation directory [default: CMAKE_INSTALL_PREFIX/cb2bib.app/Contents/MacOS]." "${CMAKE_INSTALL_PREFIX}/cb2bib.app/Contents/MacOS")
  path_option(C2B_INSTALL_DATA_DIR "Data installation directory [default: CMAKE_INSTALL_PREFIX/cb2bib.app/Contents/Resources]." "${CMAKE_INSTALL_PREFIX}/cb2bib.app/Contents/Resources")
endif(APPLE)
if(WIN32)
  set(C2B_USE_CBPOLL OFF)
  path_option(C2B_INSTALL_BIN_DIR "Executables installation directory [default: CMAKE_INSTALL_PREFIX\cb2bib]." "${CMAKE_INSTALL_PREFIX}\cb2bib")
endif(WIN32)

if(C2B_USE_LZO)
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
  find_package(LZO REQUIRED)
  include_directories(${LZO_INCLUDE_DIR})
  add_definitions(-DC2B_USE_LZO)
endif(C2B_USE_LZO)
message("-- cb2bib uses QtWebKit library: ${C2B_USE_WEBKIT}")
message("-- cb2bib uses lzo2 library: ${C2B_USE_LZO}")
message("-- cb2bib executables installation directory: ${C2B_INSTALL_BIN_DIR}")
message("-- cb2bib data installation directory: ${C2B_INSTALL_DATA_DIR}")
if(UNIX AND NOT APPLE)
  message("-- cb2bib desktop file installation directory: ${C2B_INSTALL_DESKTOP_DIR}")
  message("-- cb2bib icon file installation directory: ${C2B_INSTALL_ICON_DIR}")
endif(UNIX AND NOT APPLE)
message("-- Build type: ${CMAKE_BUILD_TYPE}")

configure_file(${CMAKE_SOURCE_DIR}/src/c2b/cb2bib_conf_parameters.h.in ${CMAKE_CURRENT_BINARY_DIR}/cb2bib_conf_parameters.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

#-------------------------------------------------------------------------------
#  general settings
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.6)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CB2BIB_MINIMUM_REQUIRED_QT "4.4.0")

#-------------------------------------------------------------------------------
#  build tree structure
#-------------------------------------------------------------------------------
if(WIN32)
  subdirs(src/c2b src src/win)
else()
  subdirs(src/c2b src)
endif()

#-------------------------------------------------------------------------------
#  installs
#-------------------------------------------------------------------------------
if(UNIX AND NOT APPLE)
  install(PROGRAMS c2bscripts/c2bciter DESTINATION ${C2B_INSTALL_BIN_DIR})
  install(PROGRAMS c2bscripts/c2bimport DESTINATION ${C2B_INSTALL_BIN_DIR})
  install(FILES AUTHORS COPYRIGHT LICENSE CHANGELOG DESTINATION ${C2B_INSTALL_DATA_DIR})
  install(DIRECTORY data c2btools testPDFImport DESTINATION ${C2B_INSTALL_DATA_DIR})
  install(FILES c2bscripts/cb2bib.desktop c2bscripts/c2bciter.desktop c2bscripts/c2bimport.desktop DESTINATION ${C2B_INSTALL_DESKTOP_DIR})
  install(FILES src/icons/cb2bib.png DESTINATION ${C2B_INSTALL_ICON_DIR})
endif(UNIX AND NOT APPLE)
if(APPLE)
  install(PROGRAMS ./c2bscripts/c2bciter DESTINATION ${C2B_INSTALL_BIN_DIR})
  install(PROGRAMS ./c2bscripts/c2bimport DESTINATION ${C2B_INSTALL_BIN_DIR})
  install(FILES AUTHORS COPYRIGHT LICENSE CHANGELOG DESTINATION ${C2B_INSTALL_DATA_DIR})
  install(DIRECTORY data c2btools testPDFImport DESTINATION ${C2B_INSTALL_DATA_DIR})

  set(MACOSX_BUNDLE_BUNDLE_NAME cb2bib)
  set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.MOLspaces.cb2Bib")
  set(MACOSX_BUNDLE_ICON_FILE src/icons/cb2bib.icns)
  set(MACOSX_BUNDLE_INFO_STRING "A tool for rapidly extracting unformatted bibliographic references")
  set(MACOSX_BUNDLE_SHORT_VERSION_STRING "1.4")
  set(MACOSX_BUNDLE_LONG_VERSION_STRING "1.4.2")
  set(MACOSX_BUNDLE_BUNDLE_VERSION "1.4.2")
  set(MACOSX_BUNDLE_COPYRIGHT "(C) 2004-2012 Pere Constans")

###  ??
###  set_source_files_properties(${ProjectName_RESOURCES} ${ProjectName_TRANSLATIONS} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
##
### According to http://cmake.org/Wiki/CMake:Bundles_And_Frameworks, appl1_aux1 and appl1_aux2 would be c2bciter and c2bimport
###/Applications/
###             appl1.app/
###                      Contents/
###                              Info.plist
###                              MacOS/
###                                   appl1 -> appl1-1
###                                   appl1-1
###                                   appl1_aux1
###                                   appl1_aux2
###                              Resources/
###                                   appl1_res1
###                                   appl1_res2
##
##  # are they set as executable ? how if orig files were executable already ? are they seen as execs from the gui ?
##  set_source_files_properties(c2bscripts/c2bciter c2bscripts/c2bimport PROPERTIES MACOSX_PACKAGE_LOCATION MacOS)
##  # is this correct ? how about data c2btools testPDFImport directories ?
##  set_source_files_properties(AUTHORS COPYRIGHT LICENSE CHANGELOG PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
##  # need this to copy icon ?
##  set_source_files_properties(MACOSX_BUNDLE_ICON_FILE PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

endif(APPLE)
if(WIN32)
endif(WIN32)

#-------------------------------------------------------------------------------