Merge pull request #300 from rdieter/master

allow modified install paths
This commit is contained in:
Geoff McLane 2015-11-14 15:30:34 +01:00
commit fe62fbf8d9

View file

@ -138,6 +138,19 @@ if (MSVC)
list(APPEND LIBHFILES ${SRCDIR}/sprtf.h) list(APPEND LIBHFILES ${SRCDIR}/sprtf.h)
endif () endif ()
####################################### #######################################
if (NOT LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR lib${LIB_SUFFIX})
endif ()
if (NOT BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR bin)
endif ()
if (NOT INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR include)
endif ()
# Always build the STATIC library # Always build the STATIC library
set(name tidy-static) set(name tidy-static)
add_library ( ${name} STATIC ${CFILES} ${HFILES} ${LIBHFILES} ) add_library ( ${name} STATIC ${CFILES} ${HFILES} ${LIBHFILES} )
@ -146,11 +159,11 @@ set_target_properties( ${name} PROPERTIES
) )
list ( APPEND add_LIBS ${name} ) list ( APPEND add_LIBS ${name} )
install(TARGETS ${name} install(TARGETS ${name}
RUNTIME DESTINATION bin RUNTIME DESTINATION ${BIN_INSTALL_DIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION lib LIBRARY DESTINATION ${LIB_INSTALL_DIR}
) )
install( FILES ${HFILES} DESTINATION include ) install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} )
######################################## ########################################
# if user option still on # if user option still on
if (BUILD_SHARED_LIB) if (BUILD_SHARED_LIB)
@ -166,9 +179,9 @@ if (BUILD_SHARED_LIB)
set_target_properties( ${name} PROPERTIES set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DBUILDING_SHARED_LIB" ) COMPILE_FLAGS "-DBUILDING_SHARED_LIB" )
install(TARGETS ${name} install(TARGETS ${name}
RUNTIME DESTINATION bin RUNTIME DESTINATION ${BIN_INSTALL_DIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION lib LIBRARY DESTINATION ${LIB_INSTALL_DIR}
) )
endif () endif ()