alpar@0: CMAKE_MINIMUM_REQUIRED(VERSION 2.6) alpar@0: alpar@2: ## Here comes the name of your project: alpar@2: alpar@0: SET(PROJECT_NAME "LEMON-PROJECT-TEMPLATE") alpar@2: alpar@2: ## Change 'hg-tip' to the current version number of your project if you wish. kpeter@3: ## Optionally, you can leave it as is and set PROJECT_VERSION from kpeter@3: ## the cmake-gui when you make a release. alpar@2: ## The last parameter is a help string displayed by CMAKE. alpar@2: alpar@0: SET(PROJECT_VERSION "hg-tip" kpeter@3: CACHE STRING "${PROJECT_NAME} version string") alpar@0: alpar@2: ## Do not edit this. alpar@0: PROJECT(${PROJECT_NAME}) alpar@0: alpar@0: SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) alpar@0: alpar@8: IF(UNIX) alpar@8: SET(INSTALL_BIN_DIR "bin" CACHE STRING alpar@8: "Subdir for installing the binaries") alpar@8: SET(INSTALL_DOC_DIR "share/doc/${PROJECT_NAME}" alpar@8: CACHE STRING alpar@8: "Subdir for installing the doc") alpar@8: SET(INSTALL_DATA_DIR "share/data/${PROJECT_NAME}" alpar@8: CACHE STRING alpar@8: "Subdir for installing the map data") alpar@8: SET(INSTALL_EXAMPLES_DIR "share/doc/${PROJECT_NAME}/examples" alpar@8: CACHE STRING alpar@8: "Subdir for installing the examples") alpar@8: ELSE(UNIX) alpar@8: SET(INSTALL_BIN_DIR "." CACHE STRING alpar@8: "Subdir for installing the binaries") alpar@8: SET(INSTALL_DOC_DIR "doc" CACHE STRING alpar@8: "Subdir for installing the doc") alpar@8: SET(INSTALL_DATA_DIR "data" CACHE STRING alpar@8: "Subdir for installing the map data") alpar@8: SET(INSTALL_EXAMPLES_DIR "examples" CACHE STRING alpar@8: "Subdir for installing the examples") alpar@8: ENDIF(UNIX) alpar@8: alpar@2: ## The next part looks for LEMON. Typically, you don't want to modify it. alpar@2: ## alpar@5: ## First, it tries to use LEMON as a CMAKE subproject by looking for alpar@5: ## it in the 'lemon' or 'deps/lemon' subdirectories or in directory alpar@5: ## given by the LEMON_SOURCE_ROOT_DIR variable. alpar@5: ## If LEMON isn't there, then CMAKE will try to find an installed alpar@5: ## version of LEMON. If it is installed at some non-standard place, alpar@5: ## then you must tell its location in the LEMON_ROOT_DIR CMAKE config alpar@5: ## variable. (Do not hard code it into your config! Others may keep alpar@2: ## LEMON at different places.) alpar@2: alpar@5: FIND_PATH(LEMON_SOURCE_ROOT_DIR CMakeLists.txt alpar@5: PATHS ${CMAKE_SOURCE_DIR}/lemon ${CMAKE_SOURCE_DIR}/deps/lemon alpar@5: NO_DEFAULT_PATH alpar@5: DOC "Location of LEMON source as a CMAKE subproject") alpar@5: alpar@5: IF(EXISTS ${LEMON_SOURCE_ROOT_DIR}) alpar@5: ADD_SUBDIRECTORY(${LEMON_SOURCE_ROOT_DIR} deps/lemon) ladanyi@1: SET(LEMON_INCLUDE_DIRS alpar@5: ${LEMON_SOURCE_ROOT_DIR} alpar@5: ${CMAKE_BINARY_DIR}/deps/lemon ladanyi@1: ) ladanyi@1: SET(LEMON_LIBRARIES lemon) alpar@5: UNSET(LEMON_ROOT_DIR CACHE) alpar@5: UNSET(LEMON_DIR CACHE) alpar@5: UNSET(LEMON_INCLUDE_DIR CACHE) alpar@5: UNSET(LEMON_LIBRARY CACHE) ladanyi@1: ELSE() ladanyi@1: FIND_PACKAGE(LEMON QUIET NO_MODULE) ladanyi@1: FIND_PACKAGE(LEMON REQUIRED) ladanyi@1: ENDIF() ladanyi@1: alpar@2: ## This line finds doxygen (for document creation) alpar@2: alpar@0: FIND_PACKAGE(Doxygen) alpar@0: alpar@2: ## These are the include directories used by the compiler. alpar@2: alpar@0: INCLUDE_DIRECTORIES( alpar@0: ${PROJECT_SOURCE_DIR} alpar@0: ${PROJECT_BINARY_DIR} alpar@0: ${LEMON_INCLUDE_DIRS} alpar@0: ) alpar@0: alpar@8: IF(CMAKE_COMPILER_IS_GNUCXX) alpar@8: SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") alpar@8: SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") alpar@8: ENDIF(CMAKE_COMPILER_IS_GNUCXX) alpar@7: ADD_SUBDIRECTORY(src) alpar@0: alpar@2: ## Sometimes MSVC overwhelms you with compiler warnings which are impossible to alpar@2: ## avoid. Then comment out these sections. Normally you won't need it as the alpar@2: ## LEMON include headers suppress these warnings anyway. alpar@2: alpar@2: #IF(MSVC) alpar@2: # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} alpar@2: # /wd4250 /wd4355 /wd4503 /wd4800 /wd4996") alpar@0: # # Suppressed warnings: alpar@0: # # C4250: 'class1' : inherits 'class2::member' via dominance alpar@0: # # C4355: 'this' : used in base member initializer list alpar@0: # # C4503: 'function' : decorated name length exceeded, name was truncated alpar@2: # # C4800: 'type' : forcing value to bool 'true' or 'false' alpar@2: # # (performance warning) alpar@0: # # C4996: 'function': was declared deprecated alpar@0: # ENDIF(MSVC) alpar@0: alpar@0: ENABLE_TESTING() alpar@0: kpeter@3: ## The auxiliary doxygen files (.dox) should be placed in the 'doc' alpar@2: ## subdirectory. The next line includes the CMAKE config of that directory. alpar@2: alpar@0: ADD_SUBDIRECTORY(doc) alpar@0: alpar@2: ####################################################################### alpar@2: ## CPACK configuration alpar@2: ## alpar@2: ## It is used to configure the .exe installer created by CPACK. alpar@2: ## Consider editing these values: kpeter@4: ## alpar@2: ## - CPACK_PACKAGE_VENDOR alpar@2: ## - CPACK_PACKAGE_DESCRIPTION_SUMMARY alpar@2: ## - CPACK_NSIS_HELP_LINK alpar@2: ## - CPACK_NSIS_URL_INFO_ABOUT alpar@2: ## - CPACK_NSIS_CONTACT kpeter@4: ## kpeter@4: ## Additionally, you may want to change the icons/images used by the kpeter@4: ## NSIS installer, i.e. these variables: kpeter@4: ## kpeter@4: ## - CPACK_NSIS_MUI_ICON kpeter@4: ## - CPACK_PACKAGE_ICON kpeter@4: ## - CPACK_NSIS_INSTALLED_ICON_NAME alpar@8: ## kpeter@4: ## and/or the files they point to. alpar@2: ####################################################################### alpar@0: alpar@0: IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) alpar@0: SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) alpar@0: SET(CPACK_PACKAGE_VENDOR "EGRES") alpar@0: SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY alpar@0: "LEMON PROJECT TEMPLATE - A Template Build Environment for LEMON") alpar@0: SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") alpar@0: alpar@0: SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) alpar@0: alpar@0: SET(CPACK_PACKAGE_INSTALL_DIRECTORY alpar@0: "${PROJECT_NAME}") alpar@0: SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY alpar@8: "${PROJECT_NAME} ${PROJECT_VERSION}") alpar@0: alpar@8: SET(CPACK_COMPONENTS_ALL bin doc) alpar@0: alpar@8: SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Executables") alpar@0: SET(CPACK_COMPONENT_BIN_DESCRIPTION alpar@0: "Command line utilities") alpar@8: SET(CPACK_COMPONENT_BIN_REQUIRED TRUE) alpar@0: alpar@8: SET(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation") alpar@8: SET(CPACK_COMPONENT_DOC_DESCRIPTION alpar@8: "Documentation generated by Doxygen.") alpar@8: alpar@8: alpar@0: SET(CPACK_GENERATOR "NSIS") kpeter@4: kpeter@4: SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon-project.ico") kpeter@4: SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico") kpeter@4: SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") kpeter@4: SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon-project.ico") kpeter@4: alpar@0: SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") alpar@0: SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") alpar@0: SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") alpar@0: SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") alpar@0: SET(CPACK_NSIS_CREATE_ICONS_EXTRA " alpar@0: CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\" alpar@0: ") alpar@0: SET(CPACK_NSIS_DELETE_ICONS_EXTRA " alpar@0: !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP alpar@0: Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\" alpar@0: ") alpar@0: alpar@0: INCLUDE(CPack) alpar@0: ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})