-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update cmake build to output corehook DLL
Add support for building the corehook dll and the detours library at the same time
- Loading branch information
Showing
1 changed file
with
48 additions
and
5 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,15 +1,58 @@ | ||
cmake_minimum_required(VERSION 3.2) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
|
||
set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}) | ||
|
||
set(COREHOOK_INSTALL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}) | ||
set(COREHOOK_INSTALL_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin) | ||
set(COREHOOK_INSTALL_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib) | ||
|
||
|
||
include_directories(${COREHOOK_INSTALL_INCLUDE_DIR}) | ||
|
||
add_subdirectory(src) | ||
project(corehook) | ||
set(TARGET detours) | ||
|
||
enable_language(ASM_MASM) | ||
set(SOURCE_ASM | ||
src/trampolinex64.asm | ||
) | ||
|
||
set(SOURCE_FILES | ||
src/barrier.cpp | ||
src/creatwth.cpp | ||
src/detours.cpp | ||
src/disasm.cpp | ||
src/disolarm.cpp | ||
src/disolarm64.cpp | ||
src/disolia64.cpp | ||
src/disolx64.cpp | ||
src/disolx86.cpp | ||
src/image.cpp | ||
src/modules.cpp | ||
) | ||
|
||
set(COREHOOK_SOURCES | ||
dll/corehook/corehook.cpp | ||
) | ||
|
||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
src | ||
) | ||
|
||
add_library(detours STATIC ${SOURCE_FILES} ${SOURCE_ASM}) | ||
|
||
add_library(corehook SHARED ${COREHOOK_SOURCES}) | ||
target_link_libraries(corehook detours aux_ulib) | ||
|
||
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32") | ||
set_target_properties(corehook PROPERTIES OUTPUT_NAME corehook32) | ||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64") | ||
set_target_properties(corehook PROPERTIES OUTPUT_NAME corehook64) | ||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM") | ||
set_target_properties(corehook PROPERTIES OUTPUT_NAME corehook32) | ||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64") | ||
set_target_properties(corehook PROPERTIES OUTPUT_NAME corehook64) | ||
endif() | ||
|
||
install(TARGETS detours DESTINATION ${COREHOOK_INSTALL_BIN_DIR}) | ||
|