alpar@225: CMAKE_MINIMUM_REQUIRED(VERSION 2.6) alpar@225: ladanyi@725: SET(PROJECT_NAME "LEMON") ladanyi@725: PROJECT(${PROJECT_NAME}) alpar@225: ladanyi@725: IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake) ladanyi@725: INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake) ladanyi@725: ELSEIF(DEFINED ENV{LEMON_VERSION}) ladanyi@725: SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.") ladanyi@725: ELSE() ladanyi@725: EXECUTE_PROCESS( ladanyi@725: COMMAND hg id -i ladanyi@725: WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ladanyi@725: OUTPUT_VARIABLE HG_REVISION ladanyi@725: ERROR_QUIET ladanyi@725: OUTPUT_STRIP_TRAILING_WHITESPACE ladanyi@725: ) ladanyi@727: IF(HG_REVISION STREQUAL "") ladanyi@727: SET(HG_REVISION "hg-tip") ladanyi@727: ENDIF() ladanyi@725: SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.") ladanyi@725: ENDIF() ladanyi@725: ladanyi@725: SET(PROJECT_VERSION ${LEMON_VERSION}) alpar@225: ladanyi@596: SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) alpar@225: ladanyi@726: FIND_PACKAGE(Doxygen) ladanyi@726: FIND_PACKAGE(Ghostscript) ladanyi@496: FIND_PACKAGE(GLPK 4.33) ladanyi@667: FIND_PACKAGE(CPLEX) ladanyi@668: FIND_PACKAGE(COIN) ladanyi@496: alpar@515: INCLUDE(CheckTypeSize) ladanyi@724: CHECK_TYPE_SIZE("long long" LONG_LONG) ladanyi@724: SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG}) alpar@515: alpar@225: ENABLE_TESTING() alpar@225: alpar@225: ADD_SUBDIRECTORY(lemon) ladanyi@596: IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) ladanyi@596: ADD_SUBDIRECTORY(demo) ladanyi@596: ADD_SUBDIRECTORY(tools) ladanyi@596: ADD_SUBDIRECTORY(doc) ladanyi@596: ADD_SUBDIRECTORY(test) ladanyi@726: ENDIF() alpar@225: ladanyi@722: CONFIGURE_FILE( ladanyi@722: ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in ladanyi@722: ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake ladanyi@722: @ONLY ladanyi@722: ) ladanyi@722: IF(UNIX) ladanyi@722: INSTALL( ladanyi@722: FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake ladanyi@722: DESTINATION share/lemon/cmake ladanyi@722: ) ladanyi@722: ELSEIF(WIN32) ladanyi@722: INSTALL( ladanyi@722: FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake ladanyi@722: DESTINATION cmake ladanyi@722: ) ladanyi@726: ENDIF() ladanyi@722: ladanyi@726: IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32) ladanyi@726: SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) ladanyi@726: SET(CPACK_PACKAGE_VENDOR "EGRES") ladanyi@726: SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ladanyi@726: "LEMON - Library for Efficient Modeling and Optimization in Networks") ladanyi@726: SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") alpar@225: ladanyi@726: SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) alpar@225: ladanyi@726: SET(CPACK_PACKAGE_INSTALL_DIRECTORY ladanyi@726: "${PROJECT_NAME} ${PROJECT_VERSION}") ladanyi@726: SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ladanyi@726: "${PROJECT_NAME} ${PROJECT_VERSION}") alpar@225: ladanyi@726: SET(CPACK_COMPONENTS_ALL headers library html_documentation bin) alpar@225: ladanyi@726: SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers") ladanyi@726: SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library") ladanyi@726: SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities") ladanyi@726: SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") alpar@225: ladanyi@726: SET(CPACK_COMPONENT_HEADERS_DESCRIPTION ladanyi@726: "C++ header files") ladanyi@726: SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION ladanyi@726: "DLL and import library") ladanyi@726: SET(CPACK_COMPONENT_BIN_DESCRIPTION ladanyi@726: "Command line utilities") ladanyi@726: SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION ladanyi@726: "Doxygen generated documentation") alpar@225: ladanyi@726: SET(CPACK_COMPONENT_HEADERS_DEPENDS library) alpar@225: ladanyi@726: SET(CPACK_COMPONENT_HEADERS_GROUP "Development") ladanyi@726: SET(CPACK_COMPONENT_LIBRARY_GROUP "Development") ladanyi@726: SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation") alpar@225: ladanyi@726: SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION ladanyi@726: "Components needed to develop software using LEMON") ladanyi@726: SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION ladanyi@726: "Documentation of LEMON") alpar@225: ladanyi@726: SET(CPACK_ALL_INSTALL_TYPES Full Developer) alpar@225: ladanyi@726: SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) ladanyi@726: SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full) ladanyi@726: SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full) alpar@225: ladanyi@726: SET(CPACK_GENERATOR "NSIS") ladanyi@726: SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico") ladanyi@726: SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico") ladanyi@726: #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") ladanyi@726: SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico") ladanyi@726: SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") ladanyi@726: SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") ladanyi@726: SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") ladanyi@726: SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") ladanyi@726: SET(CPACK_NSIS_CREATE_ICONS_EXTRA " ladanyi@726: CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\" ladanyi@726: ") ladanyi@726: SET(CPACK_NSIS_DELETE_ICONS_EXTRA " ladanyi@726: !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP ladanyi@726: Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\" ladanyi@726: ") alpar@225: ladanyi@726: INCLUDE(CPack) ladanyi@726: ENDIF()