binpac: Added headers to install target.

Also set some convenience variables that mimic what a FindBinPAC
module would set.  These could be used by a superproject that
wants to decide whether to use an existing BinPAC installation
or (re)build from source.
This commit is contained in:
Jon Siwek 2010-10-21 12:45:51 -05:00 committed by Tim Wojtulewicz
parent 47c64d7fed
commit 92f936fdb8
3 changed files with 40 additions and 4 deletions

View file

@ -79,10 +79,16 @@ add_subdirectory(src)
## Build Summary ## Build Summary
## ##
if (BinPAC_SKIP_INSTALL)
set(binpac_install_summary "Install skipped")
else ()
set(binpac_install_summary "${CMAKE_INSTALL_PREFIX}")
endif ()
message( message(
"\n==================| BinPAC Build Summary |====================" "\n==================| BinPAC Build Summary |===================="
"\n" "\n"
"\nInstall prefix: ${CMAKE_INSTALL_PREFIX}" "\nInstall prefix: ${binpac_install_summary}"
"\nDebug mode: ${ENABLE_DEBUG}" "\nDebug mode: ${ENABLE_DEBUG}"
"\nRelease mode: ${ENABLE_RELEASE}" "\nRelease mode: ${ENABLE_RELEASE}"
"\n" "\n"

View file

@ -13,7 +13,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
set(binpac_lib_SRCS set(binpac_lib_SRCS
binpac_buffer.cc binpac_buffer.cc
binpac_bytestring.cc binpac_bytestring.cc
binpac.h ${CMAKE_CURRENT_BINARY_DIR}/binpac.h
binpac_analyzer.h binpac_analyzer.h
binpac_buffer.h binpac_buffer.h
binpac_bytestring.h binpac_bytestring.h
@ -25,4 +25,27 @@ add_library(binpac_lib STATIC ${binpac_lib_SRCS})
set_target_properties(binpac_lib PROPERTIES OUTPUT_NAME binpac) set_target_properties(binpac_lib PROPERTIES OUTPUT_NAME binpac)
install(TARGETS binpac_lib DESTINATION lib) if (NOT BinPAC_SKIP_INSTALL)
install(TARGETS binpac_lib DESTINATION lib)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/binpac.h
binpac_analyzer.h
binpac_buffer.h
binpac_bytestring.h
binpac_exception.h
binpac_regex.h
DESTINATION
include
)
endif ()
# This is set to assist superprojects that want to build BinPac
# from source and rely on it as a target
set(BinPAC_LIBRARY binpac_lib
CACHE STRING "BinPAC static library" FORCE
)
set(BinPAC_INCLUDE_DIR
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
CACHE STRING "BinPAC header directories" FORCE
)

View file

@ -97,4 +97,11 @@ set(binpac_SRCS
add_executable(binpac ${binpac_SRCS}) add_executable(binpac ${binpac_SRCS})
install(TARGETS binpac DESTINATION bin) if (NOT BinPAC_SKIP_INSTALL)
install(TARGETS binpac DESTINATION bin)
endif ()
# This is set to assist superprojects that want to build BinPac
# from source and rely on it as a target
set(BinPAC_EXE binpac
CACHE STRING "BinPAC executable" FORCE)