Skip to content

Commit

Permalink
Set CMAKE_LIBRARY_ARCHITECTURE to amd64 by default for 64bit This pre…
Browse files Browse the repository at this point in the history
…vents 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 .
  • Loading branch information
erwinlem committed Jul 11, 2022
1 parent 612a863 commit b5e5203
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions make-rules/cmake.mk
Expand Up @@ -149,6 +149,7 @@ CMAKE_OPTIONS += -DLIBEXEC_INSTALL_DIR="$(CMAKE_PREFIX)/$(CMAKE_LIBEXECDIR.$(BIT
# 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))
Expand Down

0 comments on commit b5e5203

Please sign in to comment.