Browse Source

Fix CMake build when included from other project

hl_urbicide
Velaron 3 years ago committed by a1batross
parent
commit
219fb37f44
  1. 4
      CMakeLists.txt
  2. 2
      cmake/LibraryNaming.cmake

4
CMakeLists.txt

@ -27,7 +27,7 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15.0")
endif() endif()
# Install custom module path # Install custom module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(VSForceXPToolchain) # Force XP toolchain for Visual Studio include(VSForceXPToolchain) # Force XP toolchain for Visual Studio
@ -52,8 +52,6 @@ set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for Linux/MacOS/Windows"
# MAIN BUILD CODE \ # MAIN BUILD CODE \
###################\ ###################\
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT) if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT)
if(MSVC) if(MSVC)
error("UNDONE: set 32 build flags") error("UNDONE: set 32 build flags")

2
cmake/LibraryNaming.cmake

@ -1,7 +1,7 @@
include(CheckSymbolExists) include(CheckSymbolExists)
# generated(see comments in public/build.h) # generated(see comments in public/build.h)
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_SOURCE_DIR}/public/") set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/")
check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT) check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT)
check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64) check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64)
check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID) check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID)

Loading…
Cancel
Save