lemon/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Wed, 06 May 2015 11:31:43 +0200
changeset 1138 f95b18d99843
parent 1115 9153e490f09c
permissions -rw-r--r--
Merge CMP0026 setting
     1 INCLUDE_DIRECTORIES(
     2   ${PROJECT_SOURCE_DIR}
     3   ${PROJECT_BINARY_DIR}
     4 )
     5 
     6 CONFIGURE_FILE(
     7   ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
     8   ${CMAKE_CURRENT_BINARY_DIR}/config.h
     9 )
    10 
    11 CONFIGURE_FILE(
    12   ${CMAKE_CURRENT_SOURCE_DIR}/lemon.pc.in
    13   ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc
    14   @ONLY
    15 )
    16 
    17 SET(LEMON_SOURCES
    18   arg_parser.cc
    19   base.cc
    20   color.cc
    21   lp_base.cc
    22   lp_skeleton.cc
    23   random.cc
    24   bits/windows.cc
    25 )
    26 
    27 IF(LEMON_HAVE_GLPK)
    28   SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
    29   INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
    30   IF(WIN32)
    31     INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
    32     INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
    33     INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
    34   ENDIF()
    35 ENDIF()
    36 
    37 IF(LEMON_HAVE_CPLEX)
    38   SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
    39   INCLUDE_DIRECTORIES(${ILOG_INCLUDE_DIRS})
    40 ENDIF()
    41 
    42 IF(LEMON_HAVE_CLP)
    43   SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
    44   INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    45 ENDIF()
    46 
    47 IF(LEMON_HAVE_CBC)
    48   SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
    49   INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    50 ENDIF()
    51 
    52 IF(LEMON_HAVE_SOPLEX)
    53   SET(LEMON_SOURCES ${LEMON_SOURCES} soplex.cc)
    54   INCLUDE_DIRECTORIES(${SOPLEX_INCLUDE_DIRS})
    55 ENDIF()
    56 
    57 ADD_LIBRARY(lemon ${LEMON_SOURCES})
    58 
    59 TARGET_LINK_LIBRARIES(lemon
    60   ${GLPK_LIBRARIES} ${COIN_LIBRARIES} ${ILOG_LIBRARIES} ${SOPLEX_LIBRARIES}
    61   )
    62 
    63 IF(UNIX)
    64   SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION})
    65 ENDIF()
    66 
    67 INSTALL(
    68   TARGETS lemon
    69   ARCHIVE DESTINATION lib
    70   LIBRARY DESTINATION lib
    71   COMPONENT library
    72 )
    73 
    74 INSTALL(
    75   DIRECTORY . bits concepts
    76   DESTINATION include/lemon
    77   COMPONENT headers
    78   FILES_MATCHING PATTERN "*.h"
    79 )
    80 
    81 INSTALL(
    82   FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
    83   DESTINATION include/lemon
    84   COMPONENT headers
    85 )
    86 
    87 INSTALL(
    88   FILES ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc
    89   DESTINATION lib/pkgconfig
    90 )
    91