Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds install rules to gnu/linux targets #110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,62 @@ endif()
if(IOS_PLATFORM AND IOS_DEMO)
add_subdirectory(ios)
endif()

if(GNULINUX_PLATFORM)
# package config
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
set(includedir "\${prefix}/include")

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/ne10.pc.in
${CMAKE_CURRENT_BINARY_DIR}/ne10.pc
@ONLY)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/ne10.pc
DESTINATION lib${LIB_SUFFIX}/pkgconfig)

# install rules
install( DIRECTORY inc/
DESTINATION include/ne10
FILES_MATCHING PATTERN "*.h")
install( DIRECTORY common/
DESTINATION include/ne10
FILES_MATCHING PATTERN "*.h")

if(NE10_ENABLE_DSP)
install( DIRECTORY modules/dsp/
DESTINATION include/ne10/dsp
FILES_MATCHING PATTERN "*.h")
endif()

if(NE10_ENABLE_MATH)
install( DIRECTORY modules/math/
DESTINATION include/ne10/math
FILES_MATCHING PATTERN "*.h")
endif()

if(NE10_ENABLE_IMGPROC)
install( DIRECTORY modules/imgproc/
DESTINATION include/ne10/imgproc
FILES_MATCHING PATTERN "*.h")
endif()

if(NE10_ENABLE_PHYSICS)
install( DIRECTORY modules/physics/
DESTINATION include/ne10/physics
FILES_MATCHING PATTERN "*.h")
endif()
# uninstall rules
configure_file(
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)

add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
endif()

32 changes: 32 additions & 0 deletions cmake/cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F

IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")

FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSE(EXISTS "$ENV{DESTDIR}${file}")
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)
5 changes: 4 additions & 1 deletion modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ if(NE10_BUILD_STATIC OR ANDROID_PLATFORM OR IOS_DEMO)
VERSION ${NE10_VERSION}
)

install(TARGETS NE10 DESTINATION lib)

if(IOS_DEMO)
install(TARGETS NE10
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../ios/NE10Demo/libs/)
Expand Down Expand Up @@ -410,5 +412,6 @@ if(NE10_BUILD_SHARED)
)

target_link_libraries(NE10_test m)

install(TARGETS NE10_shared DESTINATION lib)

endif()
13 changes: 13 additions & 0 deletions ne10.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
LV_CXXFLAGS=@LV_CXXFLAGS@


Name: ne10
Description: Ne10: An open optimized software library project for the ARM® Architecture
Requires:
Version: @LIBVER@
Libs: -L${libdir} -lne10
Cflags: -I${includedir} ${LV_CXXFLAGS}