mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #1 from hyperair/master
Add .pc file and use GNUInstallDirs for CMAKE_INSTALL_*DIR variables
This commit is contained in:
commit
7c1f52a437
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||||
cmake_policy(VERSION 2.6)
|
cmake_policy(VERSION 2.6)
|
||||||
|
|
||||||
project(tinyxml2)
|
project(tinyxml2)
|
||||||
|
include(GNUInstallDirs)
|
||||||
#enable_testing()
|
#enable_testing()
|
||||||
|
|
||||||
#CMAKE_BUILD_TOOL
|
#CMAKE_BUILD_TOOL
|
||||||
|
@ -60,7 +61,7 @@ add_dependencies(test tinyxml2)
|
||||||
add_dependencies(test ${TARGET_DATA_COPY})
|
add_dependencies(test ${TARGET_DATA_COPY})
|
||||||
target_link_libraries(test tinyxml2)
|
target_link_libraries(test tinyxml2)
|
||||||
|
|
||||||
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "")
|
|
||||||
IF(BUILD_STATIC_LIBS)
|
IF(BUILD_STATIC_LIBS)
|
||||||
INSTALL(TARGETS tinyxml2 tinyxml2static
|
INSTALL(TARGETS tinyxml2 tinyxml2static
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
@ -69,6 +70,16 @@ ELSE(BUILD_STATIC_LIBS)
|
||||||
INSTALL(TARGETS tinyxml2
|
INSTALL(TARGETS tinyxml2
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
ENDIF(BUILD_STATIC_LIBS)
|
ENDIF(BUILD_STATIC_LIBS)
|
||||||
INSTALL(FILES tinyxml2.h DESTINATION include)
|
INSTALL(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
|
||||||
|
foreach(p LIB INCLUDE)
|
||||||
|
set(var CMAKE_INSTALL_${p}DIR)
|
||||||
|
if(NOT IS_ABSOLUTE "${${var}}")
|
||||||
|
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)
|
||||||
|
install(FILES tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
|
|
||||||
#add_test(test ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
|
#add_test(test ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir=@CMAKE_INSTALL_LIBDIR@
|
||||||
|
includedir=@CMAKE_INSTALL_INCLUDEDIR@
|
||||||
|
|
||||||
|
Name: TinyXML2
|
||||||
|
Description: simple, small, C++ XML parser
|
||||||
|
Version: @GENERIC_LIB_VERSION@
|
||||||
|
Libs: -L${libdir} -ltinyxml2
|
||||||
|
Cflags: -I${includedir}
|
Loading…
Reference in New Issue