Fixed cmake install of headers
This commit is contained in:
parent
ea2d36675d
commit
9d59f4be23
@ -4,12 +4,12 @@
|
||||
##
|
||||
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(nekohook)
|
||||
project(nekohook CXX)
|
||||
|
||||
# Settings
|
||||
set(NEKOHOOK_BUILD_SHARED OFF CACHE BOOL "Build the shared library")
|
||||
set(NEKOHOOK_BUILD_STATIC ON CACHE BOOL "Build the static library")
|
||||
set(NEKOHOOK_GFX opengl CACHE STRING "Graphics api to use: none;opengl")
|
||||
|
||||
set(NEKOHOOK_X86 OFF CACHE BOOL "Build x86 libraries for x86_64")
|
||||
# Lib itself
|
||||
add_subdirectory(src)
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/")
|
||||
|
@ -1,15 +1,24 @@
|
||||
|
||||
# TODO: add function to test a library for wanted functions and apply conditionals as nessesary
|
||||
|
||||
file(GLOB_RECURSE sources "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
file(GLOB_RECURSE headers "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
||||
set(sources "")
|
||||
add_subdirectory(features)
|
||||
add_subdirectory(game)
|
||||
add_subdirectory(gfx)
|
||||
add_subdirectory(ui)
|
||||
add_subdirectory(util)
|
||||
|
||||
set(suffix "")
|
||||
if (NEKOHOOK_X86)
|
||||
set(suffix "32")
|
||||
endif(NEKOHOOK_X86)
|
||||
|
||||
add_custom_target(nekohook)
|
||||
|
||||
macro(ApplyCommon in_target)
|
||||
add_dependencies(nekohook ${in_target})
|
||||
set_property(TARGET ${in_target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
set_property(TARGET ${in_target} PROPERTY CXX_STANDARD 17)
|
||||
set_property(TARGET ${in_target} PROPERTY OUTPUT_NAME nekohook)
|
||||
|
||||
target_include_directories(${in_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/")
|
||||
target_include_directories(${in_target} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
|
||||
@ -17,7 +26,7 @@ macro(ApplyCommon in_target)
|
||||
target_link_libraries(${in_target} PUBLIC rt pthread)
|
||||
endif ()
|
||||
|
||||
install(TARGETS ${in_target} DESTINATION lib)
|
||||
install(TARGETS ${in_target} DESTINATION lib${suffix})
|
||||
endmacro()
|
||||
|
||||
if(NEKOHOOK_BUILD_SHARED)
|
||||
|
6
src/nekohook/features/CMakeLists.txt
Normal file
6
src/nekohook/features/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
file(GLOB tmp_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
||||
set(sources ${sources} ${tmp_sources} PARENT_SCOPE)
|
||||
install(FILES ${headers} DESTINATION include/nekohook/features)
|
||||
|
4
src/nekohook/game/CMakeLists.txt
Normal file
4
src/nekohook/game/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
file(GLOB tmp_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
||||
set(sources ${sources} ${tmp_sources} PARENT_SCOPE)
|
||||
install(FILES ${headers} DESTINATION include/nekohook/game)
|
@ -25,16 +25,15 @@
|
||||
|
||||
namespace nekohook::trace {
|
||||
|
||||
|
||||
geo::Vec3 Terrain(const geo::Segment3&);
|
||||
|
||||
using EndInfo = std::pair<Entity*, geo::Vec3>;
|
||||
EndInfo Shot(const geo::Segment3&, Entity* ignore = Entity::GetLocalPlayer());
|
||||
|
||||
// Check if line hits entity, this is for convienience
|
||||
bool Entity(Entity* entity, const geo::Segment3& v, Entity* ignore = Entity::GetLocalPlayer()) {
|
||||
bool Entity(Entity* entity, const geo::Segment3& v, Entity* ignore = Entity::GetLocalPlayer()); /* {
|
||||
assert(entity != ignore);
|
||||
return Shot(v, ignore).first == entity;
|
||||
}
|
||||
}*/
|
||||
|
||||
} // namespace neko::trace
|
||||
|
4
src/nekohook/gfx/CMakeLists.txt
Normal file
4
src/nekohook/gfx/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
file(GLOB tmp_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
||||
set(sources ${sources} ${tmp_sources} PARENT_SCOPE)
|
||||
install(FILES ${headers} DESTINATION include/nekohook/gfx)
|
4
src/nekohook/ui/CMakeLists.txt
Normal file
4
src/nekohook/ui/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
file(GLOB tmp_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
||||
set(sources ${sources} ${tmp_sources} PARENT_SCOPE)
|
||||
install(FILES ${headers} DESTINATION include/nekohook/ui)
|
4
src/nekohook/util/CMakeLists.txt
Normal file
4
src/nekohook/util/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
file(GLOB tmp_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
||||
set(sources ${sources} ${tmp_sources} PARENT_SCOPE)
|
||||
install(FILES ${headers} DESTINATION include/nekohook/ui)
|
Reference in New Issue
Block a user