-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
34 lines (28 loc) · 1.33 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.2)
set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CORELOAD_INSTALL_INCLUDE_DIR ${PROJECT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
include_directories(${CORELOAD_INSTALL_INCLUDE_DIR})
project(coreload_dll)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
add_definitions(-D_TARGET_X86_=1 -DCORELOAD_BITS=32)
set(CORELOAD_DLL_NAME "coreload32")
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
add_definitions(-D_TARGET_AMD64_=1 -DCORELOAD_BITS=64)
set(CORELOAD_DLL_NAME "coreload64")
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM")
add_definitions(-D_TARGET_ARM_=1 -DCORELOAD_BITS=32)
set(CORELOAD_DLL_NAME "coreload32")
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64")
add_definitions(-D_TARGET_ARM64_=1 -DCORELOAD_BITS=64)
set(CORELOAD_DLL_NAME "coreload64")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MACHINE:arm64")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MACHINE:arm64")
else()
message(FATAL_ERROR "Unknown target architecture")
endif()
add_subdirectory(src)