Birju Prajapati wrote:
I’ve figured it out. I added the following lines into the root CMakeLists.txt file:

SET(CMAKE_CXX_FLAGS "-m64")

SET(CMAKE_C_FLAGS "-m64")

SET(CMAKE_EXE_LINKER_FLAGS "-m64")

SET(CMAKE_MODULE_LINKER_FLAGS "-m64")

SET(CMAKE_SHARED_LINKER_FLAGS "-m64")


That is not the preferable way to do this. As it hard codes flags into the CMake file. The way I would do it is:

export CXXFLAGS=-m64
export CFLAGS=-m64
export LDFLAGS=-m64

cmake ../myproject

If those environment variables are set BEFORE you run cmake, then cmake will put them into the cache correctly.

-Bill
_______________________________________________
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

Reply via email to