Create install command: run `sudo make install`

fixes-turtlebasket
Mattia Montanari 2020-04-18 16:15:44 +01:00
parent 72cd5f3617
commit e08f4992d1
1 changed files with 8 additions and 0 deletions

View File

@ -60,6 +60,8 @@ ELSE()
add_definitions(-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE) add_definitions(-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE)
ENDIF(BUILD_STATIC_LIB) ENDIF(BUILD_STATIC_LIB)
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${SOURCE_HEADS})
# PLATFORM-SPECIFIC SETTING # PLATFORM-SPECIFIC SETTING
if (UNIX) if (UNIX)
find_library(M_LIB m) find_library(M_LIB m)
@ -76,6 +78,12 @@ target_include_directories( ${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/
target_link_libraries(${PROJECT_NAME} ${CMOCKA_LIBRARY} ) target_link_libraries(${PROJECT_NAME} ${CMOCKA_LIBRARY} )
set(DESTDIR "/usr")
INSTALL(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION "${DESTDIR}/lib"
PUBLIC_HEADER DESTINATION "${DESTDIR}/include"
)
if (WITH_EXAMPLES) if (WITH_EXAMPLES)
add_subdirectory(examples/c) add_subdirectory(examples/c)
endif (WITH_EXAMPLES) endif (WITH_EXAMPLES)