Fixed cmake install of headers

This commit is contained in:
Rebekah 2020-08-07 21:05:02 -04:00
parent ea2d36675d
commit 9d59f4be23
8 changed files with 40 additions and 10 deletions

View File

@ -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/")

View File

@ -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)

View 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)

View 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)

View File

@ -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

View 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)

View 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)

View 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)