erwinlem
2022-07-11 b5e5203f5ba3a1d0d6d711a93189a3c462824666
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 .
1 files modified
1 ■■■■ changed files
make-rules/cmake.mk 1 ●●●● patch | view | raw | blame | history
make-rules/cmake.mk
@@ -149,6 +149,7 @@
# 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))