Added function install_headers() which will retain header prefix path

This commit is contained in:
Joakim Hove 2013-10-21 17:13:37 +02:00
parent 2e3caa9be3
commit d5a78e3232
2 changed files with 10 additions and 3 deletions

View File

@ -0,0 +1,8 @@
function ( install_headers header-list prefix )
foreach (header ${header-list})
set( abs_path "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
get_filename_component( path ${abs_path} PATH )
file( RELATIVE_PATH rel_path "${PROJECT_SOURCE_DIR}" "${path}")
install ( FILES ${header} DESTINATION ${prefix}/include/${rel_path} )
endforeach()
endfunction()

View File

@ -90,7 +90,6 @@ add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/generated-source/DefaultKeyword
add_library(Parser ${rawdeck_source} ${parser_source} ${deck_source})
target_link_libraries(Parser opm-json ${Boost_LIBRARIES})
include( ${PROJECT_SOURCE_DIR}/cmake/Modules/install_headers.cmake )
install_headers( "${HEADER_FILES}" "${CMAKE_INSTALL_PREFIX}" )
install( TARGETS Parser DESTINATION ${CMAKE_INSTALL_LIBDIR} )
install( FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/opm/parser/eclipse)