Use GNUInstallDirs for CMAKE_INSTALL_*DIR

This commit is contained in:
Chow Loong Jin 2012-05-23 05:50:32 +08:00
parent aba89e3f76
commit e9f2abaf6c
1 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
cmake_policy(VERSION 2.6)
project(tinyxml2)
include(GNUInstallDirs)
#enable_testing()
#CMAKE_BUILD_TOOL
@ -60,7 +61,7 @@ add_dependencies(test tinyxml2)
add_dependencies(test ${TARGET_DATA_COPY})
target_link_libraries(test tinyxml2)
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "")
IF(BUILD_STATIC_LIBS)
INSTALL(TARGETS tinyxml2 tinyxml2static
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@ -69,6 +70,6 @@ ELSE(BUILD_STATIC_LIBS)
INSTALL(TARGETS tinyxml2
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
ENDIF(BUILD_STATIC_LIBS)
INSTALL(FILES tinyxml2.h DESTINATION include)
INSTALL(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
#add_test(test ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)