gravatar
ladanyi@tmit.bme.hu
ladanyi@tmit.bme.hu
Generate and install LEMONConfig.cmake
0 2 1
default
3 files changed with 39 insertions and 3 deletions:
↑ Collapse diff ↑
Ignore white space 192 line context
1
SET(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory")
2
SET(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}")
3

	
4
IF(UNIX)
5
  SET(LEMON_LIB_NAME "libemon.a")
6
ELSEIF(WIN32)
7
  SET(LEMON_LIB_NAME "lemon.lib")
8
ENDIF(UNIX)
9

	
10
SET(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library")
11
SET(LEMON_LIBRARIES "${LEMON_LIBRARY}")
12

	
13
MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR)
Ignore white space 6 line context
1 1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 2

	
3 3
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
4 4
  INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
5 5
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
6 6
  SET(PROJECT_NAME "LEMON")
7 7
  SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.")
8 8
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
9 9

	
10 10
PROJECT(${PROJECT_NAME})
11 11

	
12 12
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
13 13

	
14 14
INCLUDE(FindDoxygen)
15 15
INCLUDE(FindGhostscript)
16 16
FIND_PACKAGE(GLPK 4.33)
17 17
FIND_PACKAGE(CPLEX)
18 18
FIND_PACKAGE(COIN)
19 19

	
20 20
INCLUDE(CheckTypeSize)
21 21
CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
22 22

	
23 23
ENABLE_TESTING()
24 24

	
25 25
ADD_SUBDIRECTORY(lemon)
26 26
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
27 27
  ADD_SUBDIRECTORY(demo)
28 28
  ADD_SUBDIRECTORY(tools)
29 29
  ADD_SUBDIRECTORY(doc)
30 30
  ADD_SUBDIRECTORY(test)
31 31
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
32 32

	
33
CONFIGURE_FILE(
34
  ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
35
  ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
36
  @ONLY
37
)
38
IF(UNIX)
39
  INSTALL(
40
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
41
    DESTINATION share/lemon/cmake
42
  )
43
ELSEIF(WIN32)
44
  INSTALL(
45
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
46
    DESTINATION cmake
47
  )
48
ENDIF(UNIX)
49

	
33 50
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
34 51
  IF(WIN32)
35 52
    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
36 53
    SET(CPACK_PACKAGE_VENDOR "EGRES")
37 54
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
38 55
      "LEMON - Library for Efficient Modeling and Optimization in Networks")
39 56
    SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
40 57

	
41 58
    SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
42 59

	
43 60
    SET(CPACK_PACKAGE_INSTALL_DIRECTORY
44 61
      "${PROJECT_NAME} ${PROJECT_VERSION}")
45 62
    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
46 63
      "${PROJECT_NAME} ${PROJECT_VERSION}")
47 64

	
48 65
    SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
49 66

	
50 67
    SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
51 68
    SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
52 69
    SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
53 70
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
54 71

	
55 72
    SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
56 73
      "C++ header files")
57 74
    SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
58 75
      "DLL and import library")
59 76
    SET(CPACK_COMPONENT_BIN_DESCRIPTION
60 77
      "Command line utilities")
61 78
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
62 79
      "Doxygen generated documentation")
63 80

	
64 81
    SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
65 82

	
66 83
    SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
67 84
    SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
68 85
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
69 86

	
70 87
    SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
71 88
      "Components needed to develop software using LEMON")
72 89
    SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
73 90
      "Documentation of LEMON")
74 91

	
75 92
    SET(CPACK_ALL_INSTALL_TYPES Full Developer)
76 93

	
77 94
    SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
78 95
    SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
79 96
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
80 97

	
81 98
    SET(CPACK_GENERATOR "NSIS")
82 99
    SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
83 100
    SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
84 101
    #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
85 102
    SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
86 103
    SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
87 104
    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
88 105
    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
89 106
    SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
90 107
    SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
91 108
      CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
92 109
      ")
93 110
    SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
94 111
      !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
95 112
      Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
96 113
      ")
97 114

	
98 115
    INCLUDE(CPack)
99 116
  ENDIF(WIN32)
100 117
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
Ignore white space 6 line context
1 1
INCLUDE_DIRECTORIES(
2 2
  ${PROJECT_SOURCE_DIR}
3 3
  ${PROJECT_BINARY_DIR}
4 4
)
5 5

	
6 6
CONFIGURE_FILE(
7 7
  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
8 8
  ${CMAKE_CURRENT_BINARY_DIR}/config.h
9 9
)
10 10

	
11 11
SET(LEMON_SOURCES
12 12
  arg_parser.cc
13 13
  base.cc
14 14
  color.cc
15 15
  lp_base.cc
16 16
  lp_skeleton.cc
17 17
  random.cc
18 18
  bits/windows.cc
19 19
)
20 20

	
21 21
IF(LEMON_HAVE_GLPK)
22 22
  SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
23 23
  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
24 24
  IF(WIN32)
25 25
    INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
26 26
    INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
27 27
    INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
28 28
  ENDIF(WIN32)
29 29
ENDIF(LEMON_HAVE_GLPK)
30 30

	
31 31
IF(LEMON_HAVE_CPLEX)
32 32
  SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
33 33
  INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
34 34
ENDIF(LEMON_HAVE_CPLEX)
35 35

	
36 36
IF(LEMON_HAVE_CLP)
37 37
  SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
38 38
  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
39 39
ENDIF(LEMON_HAVE_CLP)
40 40

	
41 41
IF(LEMON_HAVE_CBC)
42 42
  SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
43 43
  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
44 44
ENDIF(LEMON_HAVE_CBC)
45 45

	
46 46
ADD_LIBRARY(lemon ${LEMON_SOURCES})
47
IF(UNIX)
48
  SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon)
49
ENDIF(UNIX)
47 50

	
48 51
INSTALL(
49 52
  TARGETS lemon
50 53
  ARCHIVE DESTINATION lib
51
  COMPONENT library)
54
  COMPONENT library
55
)
52 56

	
53 57
INSTALL(
54 58
  DIRECTORY . bits concepts
55 59
  DESTINATION include/lemon
56 60
  COMPONENT headers
57
  FILES_MATCHING PATTERN "*.h")
61
  FILES_MATCHING PATTERN "*.h"
62
)
58 63

	
59 64
INSTALL(
60 65
  FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
61 66
  DESTINATION include/lemon
62
  COMPONENT headers)
67
  COMPONENT headers
68
)
0 comments (0 inline)