Set CMAKE_LIBRARY_ARCHITECTURE to amd64 by default for 64bit This prevents cmake from picking up the 32bit version when compiling for 64bit.
To test make a CMakeLists.txt:
find_library(XTEST X11)
message("Found X11 at ${XTEST}")
And compile with :
cmake .
rm CMakeCache.txt
cmake -DCMAKE_LIBRARY_ARCHITECTURE=amd64 .
| | |
| | | # variable that we can generally use to accomplish the same result. Setting |
| | | # them both shouldn't harm anything. |
| | | CMAKE_OPTIONS += -DLIB_INSTALL_DIR="$(CMAKE_PREFIX)/$(CMAKE_LIBDIR.$(BITS))" |
| | | CMAKE_OPTIONS.64 += -DCMAKE_LIBRARY_ARCHITECTURE=amd64 |
| | | CMAKE_OPTIONS.64 += -DLIB_SUFFIX="/$(MACH64)" |
| | | endif |
| | | CMAKE_OPTIONS += $(CMAKE_OPTIONS.$(BITS)) |