1.1 --- a/CMakeLists.txt Fri Nov 13 12:33:33 2009 +0100
1.2 +++ b/CMakeLists.txt Thu Dec 10 17:05:35 2009 +0100
1.3 @@ -1,37 +1,73 @@
1.4 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
1.5
1.6 -IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
1.7 - INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
1.8 -ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
1.9 - SET(PROJECT_NAME "LEMON")
1.10 - SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.")
1.11 -ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
1.12 -
1.13 +SET(PROJECT_NAME "LEMON")
1.14 PROJECT(${PROJECT_NAME})
1.15
1.16 -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
1.17 +IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
1.18 + INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
1.19 +ELSEIF(DEFINED ENV{LEMON_VERSION})
1.20 + SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
1.21 +ELSE()
1.22 + EXECUTE_PROCESS(
1.23 + COMMAND hg id -i
1.24 + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
1.25 + OUTPUT_VARIABLE HG_REVISION
1.26 + ERROR_QUIET
1.27 + OUTPUT_STRIP_TRAILING_WHITESPACE
1.28 + )
1.29 + IF(HG_REVISION STREQUAL "")
1.30 + SET(HG_REVISION "hg-tip")
1.31 + ENDIF()
1.32 + SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
1.33 +ENDIF()
1.34
1.35 -INCLUDE(FindDoxygen)
1.36 -INCLUDE(FindGhostscript)
1.37 +SET(PROJECT_VERSION ${LEMON_VERSION})
1.38
1.39 -ADD_DEFINITIONS(-DHAVE_CONFIG_H)
1.40 +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
1.41 +
1.42 +FIND_PACKAGE(Doxygen)
1.43 +FIND_PACKAGE(Ghostscript)
1.44 +FIND_PACKAGE(GLPK 4.33)
1.45 +FIND_PACKAGE(CPLEX)
1.46 +FIND_PACKAGE(COIN)
1.47
1.48 INCLUDE(CheckTypeSize)
1.49 -CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
1.50 +CHECK_TYPE_SIZE("long long" LONG_LONG)
1.51 +SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
1.52
1.53 ENABLE_TESTING()
1.54
1.55 ADD_SUBDIRECTORY(lemon)
1.56 -ADD_SUBDIRECTORY(demo)
1.57 -ADD_SUBDIRECTORY(doc)
1.58 -ADD_SUBDIRECTORY(test)
1.59 +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
1.60 + ADD_SUBDIRECTORY(demo)
1.61 + ADD_SUBDIRECTORY(tools)
1.62 + ADD_SUBDIRECTORY(doc)
1.63 + ADD_SUBDIRECTORY(test)
1.64 +ENDIF()
1.65
1.66 -IF(WIN32)
1.67 +CONFIGURE_FILE(
1.68 + ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
1.69 + ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
1.70 + @ONLY
1.71 +)
1.72 +IF(UNIX)
1.73 + INSTALL(
1.74 + FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
1.75 + DESTINATION share/lemon/cmake
1.76 + )
1.77 +ELSEIF(WIN32)
1.78 + INSTALL(
1.79 + FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
1.80 + DESTINATION cmake
1.81 + )
1.82 +ENDIF()
1.83 +
1.84 +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)
1.85 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
1.86 SET(CPACK_PACKAGE_VENDOR "EGRES")
1.87 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
1.88 - "LEMON - Library of Efficient Models and Optimization in Networks")
1.89 - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
1.90 + "LEMON - Library for Efficient Modeling and Optimization in Networks")
1.91 + SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
1.92
1.93 SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
1.94
1.95 @@ -40,16 +76,19 @@
1.96 SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
1.97 "${PROJECT_NAME} ${PROJECT_VERSION}")
1.98
1.99 - SET(CPACK_COMPONENTS_ALL headers library html_documentation)
1.100 + SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
1.101
1.102 SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
1.103 SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
1.104 + SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
1.105 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
1.106
1.107 SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
1.108 "C++ header files")
1.109 SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
1.110 "DLL and import library")
1.111 + SET(CPACK_COMPONENT_BIN_DESCRIPTION
1.112 + "Command line utilities")
1.113 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
1.114 "Doxygen generated documentation")
1.115
1.116 @@ -71,9 +110,9 @@
1.117 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
1.118
1.119 SET(CPACK_GENERATOR "NSIS")
1.120 - SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico")
1.121 - SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico")
1.122 - #SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
1.123 + SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
1.124 + SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
1.125 + #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
1.126 SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
1.127 SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
1.128 SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
1.129 @@ -88,4 +127,4 @@
1.130 ")
1.131
1.132 INCLUDE(CPack)
1.133 -ENDIF(WIN32)
1.134 +ENDIF()