Generate and install LEMONConfig.cmake
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Wed, 27 May 2009 20:12:08 +0100
changeset 677c5dc4d3124aa
parent 676 0cd6d84103a4
child 678 01d301395d03
Generate and install LEMONConfig.cmake
CMakeLists.txt
cmake/LEMONConfig.cmake.in
lemon/CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Wed May 27 13:08:47 2009 +0100
     1.2 +++ b/CMakeLists.txt	Wed May 27 20:12:08 2009 +0100
     1.3 @@ -30,6 +30,23 @@
     1.4    ADD_SUBDIRECTORY(test)
     1.5  ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
     1.6  
     1.7 +CONFIGURE_FILE(
     1.8 +  ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
     1.9 +  ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
    1.10 +  @ONLY
    1.11 +)
    1.12 +IF(UNIX)
    1.13 +  INSTALL(
    1.14 +    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
    1.15 +    DESTINATION share/lemon/cmake
    1.16 +  )
    1.17 +ELSEIF(WIN32)
    1.18 +  INSTALL(
    1.19 +    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
    1.20 +    DESTINATION cmake
    1.21 +  )
    1.22 +ENDIF(UNIX)
    1.23 +
    1.24  IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    1.25    IF(WIN32)
    1.26      SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/cmake/LEMONConfig.cmake.in	Wed May 27 20:12:08 2009 +0100
     2.3 @@ -0,0 +1,13 @@
     2.4 +SET(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory")
     2.5 +SET(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}")
     2.6 +
     2.7 +IF(UNIX)
     2.8 +  SET(LEMON_LIB_NAME "libemon.a")
     2.9 +ELSEIF(WIN32)
    2.10 +  SET(LEMON_LIB_NAME "lemon.lib")
    2.11 +ENDIF(UNIX)
    2.12 +
    2.13 +SET(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library")
    2.14 +SET(LEMON_LIBRARIES "${LEMON_LIBRARY}")
    2.15 +
    2.16 +MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR)
     3.1 --- a/lemon/CMakeLists.txt	Wed May 27 13:08:47 2009 +0100
     3.2 +++ b/lemon/CMakeLists.txt	Wed May 27 20:12:08 2009 +0100
     3.3 @@ -44,19 +44,25 @@
     3.4  ENDIF(LEMON_HAVE_CBC)
     3.5  
     3.6  ADD_LIBRARY(lemon ${LEMON_SOURCES})
     3.7 +IF(UNIX)
     3.8 +  SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon)
     3.9 +ENDIF(UNIX)
    3.10  
    3.11  INSTALL(
    3.12    TARGETS lemon
    3.13    ARCHIVE DESTINATION lib
    3.14 -  COMPONENT library)
    3.15 +  COMPONENT library
    3.16 +)
    3.17  
    3.18  INSTALL(
    3.19    DIRECTORY . bits concepts
    3.20    DESTINATION include/lemon
    3.21    COMPONENT headers
    3.22 -  FILES_MATCHING PATTERN "*.h")
    3.23 +  FILES_MATCHING PATTERN "*.h"
    3.24 +)
    3.25  
    3.26  INSTALL(
    3.27    FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
    3.28    DESTINATION include/lemon
    3.29 -  COMPONENT headers)
    3.30 +  COMPONENT headers
    3.31 +)