-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install headers/libs for mod dev, add a ModLoaderConfig.cmake
- Loading branch information
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
cmake_minimum_required(VERSION 3.6) | ||
project(server_modloader) | ||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
||
set(MODLOADER_VERSION "Preview 1") | ||
|
||
add_subdirectory(dep/funchook) | ||
|
||
include_directories(include/) | ||
add_library(server_modloader SHARED include/modloader/hook.h include/modloader/statichook.h include/modloader/log.h | ||
include/modloader/loader.h | ||
src/hook.cpp src/log.cpp src/loader.h src/loader.cpp src/elf_helper.cpp src/elf_helper.h src/main.cpp) | ||
target_link_libraries(server_modloader funchook) | ||
target_compile_definitions(server_modloader PRIVATE MODLOADER_VERSION="${MODLOADER_VERSION}") | ||
target_compile_definitions(server_modloader PRIVATE MODLOADER_VERSION="${MODLOADER_VERSION}") | ||
target_include_directories(server_modloader PUBLIC include/) | ||
|
||
install(TARGETS server_modloader DESTINATION lib) | ||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include) | ||
install(FILES ModLoaderConfig.cmake DESTINATION share/cmake/modloader) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
add_library(ModLoader SHARED IMPORTED) | ||
|
||
find_library(MODLOADER_LIBRARY server_modloader HINTS "${CMAKE_CURRENT_LIST_DIR}/../../../lib") | ||
set(MODLOADER_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../include/") | ||
set_target_properties(ModLoader PROPERTIES IMPORTED_LOCATION "${MODLOADER_LIBRARY}") | ||
set_target_properties(ModLoader PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MODLOADER_INCLUDE_DIR}") |