I am trying to import an external C/C++ library in my android module in one of the projects. The library is called android-fluidsynth. I am following instructions given at this link to integrate it. Following is how my CMakeLists.txt
looks like:
EDIT 2 : The below one works
# Sets the minimum version of CMake required to build your native library.
# This ensures that a certain set of CMake features is available to
# your build.
cmake_minimum_required(VERSION 3.4.1)
######################################################################################
######### Adding fluidsynth library from the external code
######################################################################################
# Sets lib_src_DIR to the path of the target CMake project.
set(fluidsynth-lib-name libfluidsynthsrc)
set( lib_DIR /Users/swapnilgupta/work/musicmuni/fluidsynth-android/android/ )
# Sets lib_build_DIR to the path of the desired output directory.
set( lib_build_DIR ${lib_DIR}/outputs )
file(MAKE_DIRECTORY ${lib_build_DIR})
# Adds the CMakeLists.txt file located in the specified directory
# as a build dependency.
add_subdirectory( # Specifies the directory of the CMakeLists.txt file.
${lib_DIR}
# Specifies the directory for the build outputs.
${lib_build_DIR} )
# Adds the output of the additional CMake build as a prebuilt static
# library and names it.
add_library( ${fluidsynth-lib-name}
SHARED
IMPORTED )
set_target_properties( ${fluidsynth-lib-name} PROPERTIES IMPORTED_LOCATION
${lib_build_DIR}/${ANDROID_ABI}/lib${fluidsynth-lib-name}.so )
On trying to build this I get the following error:
install TARGETS given no RUNTIME DESTINATION for executable target "fluidsynth"
I have gone through some SO posts and added following lines in my CMakeLists.txt
but I still get this error.
if(WIN32)
install(TARGETS fluidsynth
RUNTIME DESTINATION ./)
else()
install(TARGETS fluidsynth
LIBRARY DESTINATION ./)
endif()
Can anyone please help?