-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
45 lines (35 loc) · 1.41 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
35
36
37
38
39
40
41
42
43
44
45
if(MSVC)
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
else()
cmake_minimum_required(VERSION 3.14.3)
endif()
project(ntfs2btrfs VERSION 20200330)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SRC_FILES src/ntfs2btrfs.cpp
src/ntfs.cpp
src/crc32c.c)
if(MSVC)
enable_language(ASM_MASM)
set(SRC_FILES ${SRC_FILES} src/crc32c-masm.asm)
else()
enable_language(ASM)
set(SRC_FILES ${SRC_FILES} src/crc32c-gas.S)
endif()
add_executable(ntfs2btrfs ${SRC_FILES})
set_property(TARGET ntfs2btrfs PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Work around bug in MSVC version of cmake - see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4257
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
if(MSVC)
target_compile_options(ntfs2btrfs PRIVATE /W4)
else()
target_compile_options(ntfs2btrfs PRIVATE -Wall -Wextra -Wno-address-of-packed-member)
endif()
install(TARGETS ntfs2btrfs DESTINATION bin)