Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GNUInstallDirs and add cmake/Findphmap.cmake #941

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# *****************************************************************************
include(MessageColors)
include(LoggingHelper)
include(CheckIncludeFileCXX)
include(GNUInstallDirs)

# *****************************************************************************
# Options
Expand Down
4 changes: 4 additions & 0 deletions cmake/Findphmap.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include(CheckIncludeFileCXX)
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_INSTALL_INCLUDEDIR}")
check_include_file_cxx(parallel_hashmap/phmap.h PHMAP_PHMAP_INCLUDE)
check_include_file_cxx(parallel_hashmap/btree.h PHMAP_BTREE_INCLUDE)
11 changes: 7 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ add_definitions(-D"BUILD_REVISION=\\\"${BUILD_REVISION}\\\"")
find_package(OpenSSL QUIET)
find_package(PhysFS REQUIRED)
find_package(ZLIB REQUIRED)
find_package(phmap REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(Protobuf REQUIRED)
find_package(LibLZMA REQUIRED)
Expand All @@ -197,7 +198,6 @@ find_package(STDUUID CONFIG REQUIRED)
find_package(pugixml CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(httplib CONFIG REQUIRED)
CHECK_INCLUDE_FILE_CXX(phmap/phmap.h PHMAP_Found REQUIRED)

if(APPLE)
# Required for Physfs
Expand Down Expand Up @@ -455,7 +455,8 @@ if(MSVC)

target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/src
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${LUAJIT_INCLUDE_DIR}
${Protobuf_INCLUDE_DIRS}
${VORBISFILE_INCLUDE_DIR}
Expand Down Expand Up @@ -496,7 +497,8 @@ if(MSVC)
elseif(ANDROID)
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/src
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${LUAJIT_INCLUDE_DIR}
${CMAKE_THREAD_LIBS_INIT}
${Protobuf_INCLUDE_DIRS}
Expand Down Expand Up @@ -540,7 +542,8 @@ elseif(ANDROID)
else() # Linux
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/src
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${LUAJIT_INCLUDE_DIR}
${CMAKE_THREAD_LIBS_INIT}
${Protobuf_INCLUDE_DIRS}
Expand Down
Loading