MantisBT - CMake
View Issue Details
0014907CMakeCMakepublic2014-05-06 09:062016-06-10 14:31
Jeormy Fu 
Kitware Robot 
highmajoralways
closedmoved 
Android
 
 
0014907: CMAKE_MODULE_PATH is seems not working
 i tried set this in toolchain and CMakeLists.txt.

Changing the Linux.cmake in /Applications/CMake\ 2.8-12.app/Contents/share/cmake-2.8/Modules/Platform works for me.

I'm wondering is there any solution other than that exists for this because Android doesn't support soname?
No tags attached.
Issue History
2014-05-06 09:06Jeormy FuNew Issue
2014-05-06 09:52Brad KingNote Added: 0035826
2014-05-07 10:01Brad KingNote Added: 0035838
2014-05-07 10:02Brad KingNote Added: 0035839
2016-06-10 14:29Kitware RobotNote Added: 0042544
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035826)
Brad King   
2014-05-06 09:52   
See 0014602:0035199. Make sure CMAKE_MODULE_PATH is set before the project() or enable_language() command is called.
(0035838)
Brad King   
2014-05-07 10:01   
This issue tracker does not support updates via email. The email you got was for notification only. For reference, I'm posting your email response here:

On 05/06/2014 11:10 AM, Fu Jiantao wrote:
> I have put it at the beginning of CMakeLists.txt
>
> # This block needs to stay before the project (log4cplus) line so that
>
> # the output files placed into Android's libs directory.
>
> if (CMAKE_TOOLCHAIN_FILE)
>
> get_filename_component(TOOL_CHAIN_FILE_NAME "${CMAKE_TOOLCHAIN_FILE}" NAME_WE)
>
> if("${TOOL_CHAIN_FILE_NAME}" MATCHES "android.toolchain")
>
> # Android: set output folder to ${CMAKE_BINARY_DIR}
>
> set (LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH
>
> "root for library output, set this to change where Android libs
> are compiled to")
>
> endif()
>
> endif ()
>
> # Remove when CMake >= 2.8.4 is required
>
> set (CMAKE_LEGACY_CYGWIN_WIN32 0)
>
>
> set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/android/Platform)
>
> message( ${CMAKE_MODULE_PATH} )
>
>
> And i can see the output of "message( ${CMAKE_MODULE_PATH} )" is
>
> /Users/jeromy/work/cisco/temp/log4cplus-release/log4cplus-1.2.0-rc1/android/Platform,
> which is what i expected.
>
> And there is Linux.cmake in that directory with the content:
>
>
> include(${CMAKE_ROOT}/Modules/Platform/Linux.cmake)
>
> set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "")
>
>
> When run "cmake
> -DCMAKE_TOOLCHAIN_FILE=../../android/android.toolchain.cmake
> -DUNICODE:BOOL=OFF -DANDROID_STL:STRING=stlport_shared
> -DANDROID_NATIVE_API_LEVEL:STRING=9 -DCMAKE_BUILD_TYPE=Release
> -DANDROID_FUNCTION_LEVEL_LINKING:BOOL=OFF ../../;make log4cplus"
>
> The result is not what i expected, soname is still there.
(0035839)
Brad King   
2014-05-07 10:02   
The module name is "Platform/Linux" so you need to point CMAKE_MODULE_PATH at the directory containing the "Platform" directory:

 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/android)
(0042544)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.