[CMake] Cross-compilation & Find_Package(Tcl)...

David Cole david.cole at kitware.com
Tue Jun 26 11:35:20 EDT 2012


On Tue, Jun 26, 2012 at 11:22 AM, Georgios Petasis <petasisg at yahoo.gr> wrote:
> Στις 26/6/2012 17:56, ο/η Georgios Petasis έγραψε:
>
>> Hi all,
>>
>> I am trying to cross-compile an application for windows, in a Fedora 17
>> box.
>> I have successfully cross-compiled/installed Tcl/Tk from sources.
>> And I want to also cross-compile my application, which uses cmake.
>>
>> Is there a way to convince cmake to use the platform tclsh (in order to
>> run some scripts), but find the includes & libraries that I have
>> cross-compiled for the platform?
>>
>> Running cmake from the Fedora wrapper "mingw32-cmake" does not work. I
>> also tried to set the following variables:
>>
>> CMAKE_PREFIX_PATH=/opt/ActiveTcl-8.6
>> CMAKE_INCLUDE_PATH=/free/cross-compilation-binaries/win32-ix86/tcl/include
>> CMAKE_LIBRARY_PATH=/free/cross-compilation-binaries/win32-ix86/tcl/lib
>> CMAKE_PROGRAM_PATH=/opt/ActiveTcl-8.6/bin
>>
>> But I always get the following:
>>
>> -- Found Tclsh: /opt/ActiveTcl-8.6/bin/tclsh (found version "8.6")
>> CMake Error at
>> /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
>>  Could NOT find TCL (missing: TCL_LIBRARY TCL_INCLUDE_PATH)
>> Call Stack (most recent call first):
>>  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:288
>> (_FPHSA_FAILURE_MESSAGE)
>>  /usr/share/cmake/Modules/FindTCL.cmake:206
>> (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
>>  CMakeLists.txt:122 (FIND_PACKAGE)
>>
>>
>> Any ideas?
>>
>> George
>>
> I have managed to proceed a little bit further, with the following commands:
>
> echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH"
> echo "CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH"
> echo "CMAKE_LIBRARY_PATH=$CMAKE_LIBRARY_PATH"
> echo "CMAKE_PROGRAM_PATH=$CMAKE_PROGRAM_PATH"
> mingw32-cmake -D CMAKE_BUILD_TYPE=$BUILD_TYPE \
>              -D PKG_OS_ARCH=$ARCH -D CMAKE_INSTALL_PREFIX=$PREFIX \
>              -D TCL_INCLUDE_PATH=$CMAKE_INCLUDE_PATH \
>              -D TK_INCLUDE_PATH=$CMAKE_INCLUDE_PATH \
>              -D TCL_LIBRARY=$CMAKE_LIBRARY_PATH \
>              -D TK_LIBRARY=$CMAKE_LIBRARY_PATH ...
>
> Which gave as output:
>
> CMAKE_PREFIX_PATH=/free/cross-compilation-binaries/win32-ix86/tcl/
> CMAKE_INCLUDE_PATH=/free/cross-compilation-binaries/win32-ix86/tcl/include
> CMAKE_LIBRARY_PATH=/free/cross-compilation-binaries/win32-ix86/tcl/lib
> CMAKE_PROGRAM_PATH=/opt/ActiveTcl-8.6/bin
> ...
> CMake Error: The following variables are used in this project, but they are
> set to NOTFOUND.
> Please set them or make sure they are set and tested correctly in the CMake
> files:
> TCL_STUB_LIBRARY (ADVANCED)
>
>
> How to help cmake to define the stubs library path?
> Looking inside the /free/cross-compilation-binaries/win32-ix86/tcl/lib
> folder, the stubs library is named "libtclstub86.a"
>
>
> George
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

I think TCL_LIBRARY and TK_LIBRARY are supposed to be set the the name
of the library files, not to the directory which contains them.

You can just define TCL_STUB_LIBRARY with -D as well, assuming it's
not automatically found after you fix TCL_LIBRARY and TK_LIBRARY -D
values...

  -DTCL_STUB_LIBRARY=/free/cross-compilation-binaries/win32-ix86/tcl/lib/libtclstub86.a


HTH,
David


More information about the CMake mailing list