android - Is there are rule in CMake that causes properties set in toolchain file to not persistent to CMakeLists? -


i trying build openal android ndk. license requires library dynamically loaded. receive following message when attempting build:

cmake warning (dev) @ cmakelists.txt:1032 (add_library):   add_library called shared option target platform not   support dynamic linking.  building static library instead.  may lead   problems. 

my toolchain file includes set_property(global property target_supports_shared_libs true) , looks this:

set(cmake_system_name generic) set(cmake_c_compiler "${host}-gcc") set(cmake_cxx_compiler "${host}-g++")  set(cmake_find_root_path_mode_program never) set(cmake_find_root_path_mode_library only) set(cmake_find_root_path_mode_include only)  set(env{pkg_config_libdir} "${cmake_install_prefix}/lib/pkgconfig") set(env{pkg_config_path} "")  set_property(global property target_supports_shared_libs true) 

i create build directory in source , invoke cmake following:

cmake .. -dalsoft_backend_wave=0 -dalsoft_require_opensl=1 -dalsoft_no_config_util=1 -dalsoft_examples=0 -dalsoft_utils=0 -dalsoft_config=0 -dcmake_install_prefix=$android_dev/opt -dcmake_install_rpath=$android_dev/opt -dhost= -dcmake_toolchain_file=../../android-toolchain.cmake 

i have verified toolchain file loaded adding garbage , seeing cmake command result in error.

the cmakelists.txt file starts this:

# cmake build file list openal  cmake_minimum_required(version 2.6)  project(openal)  if(command cmake_policy)   cmake_policy(set cmp0003 new)   cmake_policy(set cmp0005 new) endif(command cmake_policy)  set(cmake_module_path "${openal_source_dir}/cmake") 

i have built library dynamic module placing set_property(global property target_supports_shared_libs true) in cmakelist.txt after project(openal). if place before build results in static library mentioned warning.

it seems though property target_supports_shared_libs being reset after project(openal). have read documetnation project, target_supports_shared_libs , including toolchain file have not found explicitly mentions resetting of target toolchain variables.

does cmake have rules causes variable reset between toolchain file , cmakelists.txt processing, or perhaps before , after project command?

i using cmake 2.8.12.2. each time issue cmake command, fresh copy of source directory sure there isn't caching issue.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -