CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Sun, 11 Dec 2011 18:43:33 +0100
changeset 13 0ab493e5250e
parent 9 7768d68909e8
permissions -rw-r--r--
Add build id field to running time logs

Configurable by BENCHMARK_BUILD_ID cmake variable,
which defaults to the last component of the build directory.
alpar@0
     1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
alpar@0
     2
alpar@2
     3
## Here comes the name of your project:
alpar@2
     4
alpar@0
     5
SET(PROJECT_NAME "LEMON-PROJECT-TEMPLATE")
alpar@2
     6
alpar@2
     7
## Change 'hg-tip' to the current version number of your project if you wish.
kpeter@3
     8
## Optionally, you can leave it as is and set PROJECT_VERSION from
kpeter@3
     9
## the cmake-gui when you make a release.
alpar@2
    10
## The last parameter is a help string displayed by CMAKE.
alpar@2
    11
alpar@0
    12
SET(PROJECT_VERSION "hg-tip"
kpeter@3
    13
    CACHE STRING "${PROJECT_NAME} version string")
alpar@0
    14
alpar@13
    15
GET_FILENAME_COMPONENT(BUILD_DIR_NAME ${CMAKE_BINARY_DIR} NAME)
alpar@13
    16
alpar@13
    17
SET(BENCHMARK_BUILD_ID ${BUILD_DIR_NAME} CACHE STRING "Benchmark build id")
alpar@13
    18
alpar@2
    19
## Do not edit this.
alpar@0
    20
PROJECT(${PROJECT_NAME})
alpar@0
    21
alpar@0
    22
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
alpar@0
    23
alpar@2
    24
## The next part looks for LEMON. Typically, you don't want to modify it.
alpar@2
    25
##
alpar@5
    26
## First, it tries to use LEMON as a CMAKE subproject by looking for
alpar@5
    27
## it in the 'lemon' or 'deps/lemon' subdirectories or in directory
alpar@5
    28
## given by the LEMON_SOURCE_ROOT_DIR variable.
alpar@5
    29
## If LEMON isn't there, then CMAKE will try to find an installed
alpar@5
    30
## version of LEMON. If it is installed at some non-standard place,
alpar@5
    31
## then you must tell its location in the LEMON_ROOT_DIR CMAKE config
alpar@5
    32
## variable. (Do not hard code it into your config! Others may keep
alpar@2
    33
## LEMON at different places.)
alpar@2
    34
alpar@5
    35
FIND_PATH(LEMON_SOURCE_ROOT_DIR CMakeLists.txt
alpar@5
    36
  PATHS ${CMAKE_SOURCE_DIR}/lemon ${CMAKE_SOURCE_DIR}/deps/lemon
alpar@5
    37
  NO_DEFAULT_PATH
alpar@5
    38
  DOC "Location of LEMON source as a CMAKE subproject")
alpar@5
    39
alpar@5
    40
IF(EXISTS ${LEMON_SOURCE_ROOT_DIR})
alpar@5
    41
  ADD_SUBDIRECTORY(${LEMON_SOURCE_ROOT_DIR} deps/lemon)
ladanyi@1
    42
  SET(LEMON_INCLUDE_DIRS
alpar@5
    43
    ${LEMON_SOURCE_ROOT_DIR}
alpar@5
    44
    ${CMAKE_BINARY_DIR}/deps/lemon
ladanyi@1
    45
  )
ladanyi@1
    46
  SET(LEMON_LIBRARIES lemon)
alpar@5
    47
  UNSET(LEMON_ROOT_DIR CACHE)
alpar@5
    48
  UNSET(LEMON_DIR CACHE)
alpar@5
    49
  UNSET(LEMON_INCLUDE_DIR CACHE)
alpar@5
    50
  UNSET(LEMON_LIBRARY CACHE)
ladanyi@1
    51
ELSE()
ladanyi@1
    52
  FIND_PACKAGE(LEMON QUIET NO_MODULE)
ladanyi@1
    53
  FIND_PACKAGE(LEMON REQUIRED)
ladanyi@1
    54
ENDIF()
ladanyi@1
    55
alpar@2
    56
## This line finds doxygen (for document creation)
alpar@2
    57
alpar@0
    58
FIND_PACKAGE(Doxygen)
alpar@0
    59
alpar@2
    60
## These are the include directories used by the compiler.
alpar@2
    61
alpar@0
    62
INCLUDE_DIRECTORIES(
alpar@0
    63
  ${PROJECT_SOURCE_DIR}
alpar@0
    64
  ${PROJECT_BINARY_DIR}
alpar@0
    65
  ${LEMON_INCLUDE_DIRS}
alpar@0
    66
)
alpar@0
    67
alpar@2
    68
## Sometimes MSVC overwhelms you with compiler warnings which are impossible to
alpar@2
    69
## avoid. Then comment out these sections. Normally you won't need it as the
alpar@2
    70
## LEMON include headers suppress these warnings anyway.
alpar@2
    71
alpar@2
    72
#IF(MSVC)
alpar@2
    73
#  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
alpar@2
    74
#      /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
alpar@0
    75
# # Suppressed warnings:
alpar@0
    76
# # C4250: 'class1' : inherits 'class2::member' via dominance
alpar@0
    77
# # C4355: 'this' : used in base member initializer list
alpar@0
    78
# # C4503: 'function' : decorated name length exceeded, name was truncated
alpar@2
    79
# # C4800: 'type' : forcing value to bool 'true' or 'false'
alpar@2
    80
# #        (performance warning)
alpar@0
    81
# # C4996: 'function': was declared deprecated
alpar@0
    82
# ENDIF(MSVC)
alpar@0
    83
alpar@0
    84
ENABLE_TESTING()
alpar@0
    85
kpeter@3
    86
## The auxiliary doxygen files (.dox) should be placed in the 'doc'
alpar@2
    87
## subdirectory. The next line includes the CMAKE config of that directory.
alpar@2
    88
alpar@0
    89
ADD_SUBDIRECTORY(doc)
alpar@0
    90
alpar@6
    91
ADD_SUBDIRECTORY(generators/netgen)
alpar@8
    92
ADD_SUBDIRECTORY(data)
alpar@6
    93
alpar@9
    94
ADD_SUBDIRECTORY(tests)
alpar@9
    95
alpar@2
    96
#######################################################################
alpar@2
    97
## CPACK configuration
alpar@2
    98
##
alpar@2
    99
## It is used to configure the .exe installer created by CPACK.
alpar@2
   100
## Consider editing these values:
kpeter@4
   101
##
alpar@2
   102
## - CPACK_PACKAGE_VENDOR
alpar@2
   103
## - CPACK_PACKAGE_DESCRIPTION_SUMMARY
alpar@2
   104
## - CPACK_NSIS_HELP_LINK
alpar@2
   105
## - CPACK_NSIS_URL_INFO_ABOUT
alpar@2
   106
## - CPACK_NSIS_CONTACT
kpeter@4
   107
##
kpeter@4
   108
## Additionally, you may want to change the icons/images used by the
kpeter@4
   109
## NSIS installer, i.e. these variables:
kpeter@4
   110
##
kpeter@4
   111
## - CPACK_NSIS_MUI_ICON
kpeter@4
   112
## - CPACK_PACKAGE_ICON
kpeter@4
   113
## - CPACK_NSIS_INSTALLED_ICON_NAME
kpeter@4
   114
##
kpeter@4
   115
## and/or the files they point to.
alpar@2
   116
#######################################################################
alpar@0
   117
alpar@0
   118
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
alpar@0
   119
  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
alpar@0
   120
  SET(CPACK_PACKAGE_VENDOR "EGRES")
alpar@0
   121
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
alpar@0
   122
      "LEMON PROJECT TEMPLATE - A Template Build Environment for LEMON")
alpar@0
   123
  SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
alpar@0
   124
alpar@0
   125
  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
alpar@0
   126
alpar@0
   127
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
alpar@0
   128
      "${PROJECT_NAME}")
alpar@0
   129
  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
alpar@0
   130
      "${PROJECT_NAME}")
alpar@0
   131
alpar@0
   132
  SET(CPACK_COMPONENTS_ALL
alpar@0
   133
      html_documentation
alpar@0
   134
      bin)
alpar@0
   135
alpar@0
   136
  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
alpar@0
   137
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
alpar@0
   138
alpar@0
   139
  SET(CPACK_COMPONENT_BIN_DESCRIPTION
alpar@0
   140
      "Command line utilities")
alpar@0
   141
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
alpar@0
   142
      "Doxygen generated documentation")
alpar@0
   143
alpar@0
   144
  SET(CPACK_GENERATOR "NSIS")
kpeter@4
   145
kpeter@4
   146
  SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon-project.ico")
kpeter@4
   147
  SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
kpeter@4
   148
  SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
kpeter@4
   149
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon-project.ico")
kpeter@4
   150
alpar@0
   151
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
alpar@0
   152
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
alpar@0
   153
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
alpar@0
   154
  SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
alpar@0
   155
  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
alpar@0
   156
      CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
alpar@0
   157
      ")
alpar@0
   158
  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
alpar@0
   159
      !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
alpar@0
   160
      Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
alpar@0
   161
      ")
alpar@0
   162
alpar@0
   163
  INCLUDE(CPack)
alpar@0
   164
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})