[CMake] 64bit linking on linux

Birju Prajapati Birju.Prajapati at schneidertrading.com
Wed Feb 18 08:32:16 EST 2009


I have a simple CMakeLists.txt file, in a directory called 'multicast':


cmake_minimum_required(VERSION 2.6)

include_directories(../.. /usr/local/include/boost-1_38)

add_library(spreadx_multicast SHARED Message.cpp MulticastChannel.cpp)


This successfully gives me a 64 bit .so:


birju at cavewks7181:~/Dev/spreadx/multicast$ file libspreadx_multicast.so

libspreadx_multicast.so: ELF 64-bit LSB shared object, x86-64, version 1
(SYSV), dynamically linked, not stripped


However, there is a problem when I try and invoke that from a directory
above with the following CMakeLists.txt file:


cmake_minimum_required (VERSION 2.6)

project (SPREADX)

add_subdirectory (multicast)


This gives me a 32 bit .so:

birju at cavewks7181:~/Dev/spreadx$ file multicast/libspreadx_multicast.so

multicast/libspreadx_multicast.so: ELF 32-bit LSB shared object, Intel
80386, version 1 (SYSV), dynamically linked, not stripped


Why does it in one case generate a 64 bit lib, and in the other, a 32
bit one?




Schneider Trading
4th Floor,
25 Copthall Avenue
London EC2R 7BP


Message from: Birju.Prajapati at schneidertrading.com
Message to: cmake at cmake.org
Attached files: 0
This e-mail and any files transmitted with it are confidential, may be legally privileged, and are for the sole use of the intended recipient. Copyright in this e-mail and any accompanying document created by us is owned by us. If you are not the intended recipient of this e-mail or any part of it please telephone our IT Department at the number shown above or by e-mail at info at schneidertrading.com. 
You should not use or disclose to any other person the contents of this e-mail or its attachments (if any), nor take copies. This e-mail is not a representation or warranty and is not intended nor should it be taken to create any legal relations, contractual or otherwise.
Schneider Trading Associates Ltd (Registration No. 3692131) is incorporated in England and Wales and the registered office is at 25 Copthall Avenue, London EC2R 7BP. The company is authorised and regulated by the Financial Services Authority
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090218/80517644/attachment-0001.htm>

More information about the CMake mailing list