mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
CMake support
This commit is contained in:
parent
bdff2dc45c
commit
55f9d46b47
14 changed files with 183 additions and 0 deletions
33
CMakeLists.txt
Normal file
33
CMakeLists.txt
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
project(rufus C)
|
||||||
|
|
||||||
|
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BINARY_DIR MATCHES "^${CMAKE_SOURCE_DIR}")
|
||||||
|
message(WARNING "In-source build detected")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
add_compile_options(/utf-8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(add_all_subdirs)
|
||||||
|
file(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
|
||||||
|
|
||||||
|
foreach(child ${children})
|
||||||
|
if(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${child})
|
||||||
|
continue()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${child}/CMakeLists.txt)
|
||||||
|
continue()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(${child} ${ARGN})
|
||||||
|
endforeach()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
add_all_subdirs()
|
40
src/CMakeLists.txt
Normal file
40
src/CMakeLists.txt
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
add_all_subdirs()
|
||||||
|
set(target_name rufus)
|
||||||
|
file(GLOB source_files *.c *.h rufus.rc)
|
||||||
|
add_executable(${target_name} WIN32 ${source_files})
|
||||||
|
|
||||||
|
target_include_directories(${target_name} PRIVATE
|
||||||
|
.
|
||||||
|
msvc-missing
|
||||||
|
ms-sys/inc
|
||||||
|
syslinux/libinstaller
|
||||||
|
syslinux/libfat
|
||||||
|
syslinux/win
|
||||||
|
libcdio
|
||||||
|
getopt)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
_OFF_T_DEFINED
|
||||||
|
_off_t=__int64
|
||||||
|
off_t=_off_t
|
||||||
|
COBJMACROS
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
||||||
|
|
||||||
|
target_link_libraries(${target_name} PRIVATE
|
||||||
|
bled
|
||||||
|
ext2fs
|
||||||
|
getopt
|
||||||
|
libcdio-driver
|
||||||
|
libcdio-iso9660
|
||||||
|
libcdio-udf
|
||||||
|
ms-sys
|
||||||
|
syslinux-libfat
|
||||||
|
syslinux-libinstaller
|
||||||
|
syslinux-win
|
||||||
|
comctl32
|
||||||
|
crypt32
|
||||||
|
dwmapi
|
||||||
|
setupapi
|
||||||
|
shlwapi
|
||||||
|
version
|
||||||
|
wintrust)
|
11
src/bled/CMakeLists.txt
Normal file
11
src/bled/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
set(target_name bled)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
target_include_directories(${target_name} PRIVATE ..)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
_OFF_T_DEFINED
|
||||||
|
_off_t=__int64
|
||||||
|
off_t=_off_t
|
||||||
|
_FILE_OFFSET_BITS=64
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
5
src/ext2fs/CMakeLists.txt
Normal file
5
src/ext2fs/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
set(target_name ext2fs)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
target_include_directories(${target_name} PRIVATE .. ../msvc-missing)
|
||||||
|
target_compile_definitions(${target_name} PRIVATE _CRT_SECURE_NO_WARNINGS _CRTDBG_MAP_ALLOC)
|
4
src/getopt/CMakeLists.txt
Normal file
4
src/getopt/CMakeLists.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
set(target_name getopt)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
target_compile_definitions(${target_name} PRIVATE HAVE_STRING_H)
|
1
src/libcdio/CMakeLists.txt
Normal file
1
src/libcdio/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
add_all_subdirs()
|
16
src/libcdio/driver/CMakeLists.txt
Normal file
16
src/libcdio/driver/CMakeLists.txt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
set(target_name libcdio-driver)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
|
||||||
|
target_include_directories(${target_name} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libcdio
|
||||||
|
${CMAKE_SOURCE_DIR}/src/msvc-missing)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
HAVE_CONFIG_H
|
||||||
|
_OFF_T_DEFINED
|
||||||
|
_off_t=__int64
|
||||||
|
off_t=_off_t
|
||||||
|
_FILE_OFFSET_BITS=64
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
17
src/libcdio/iso9660/CMakeLists.txt
Normal file
17
src/libcdio/iso9660/CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
set(target_name libcdio-iso9660)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
|
||||||
|
target_include_directories(${target_name} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libcdio
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libcdio/driver
|
||||||
|
${CMAKE_SOURCE_DIR}/src/msvc-missing)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
HAVE_CONFIG_H
|
||||||
|
_OFF_T_DEFINED
|
||||||
|
_off_t=__int64
|
||||||
|
off_t=_off_t
|
||||||
|
_FILE_OFFSET_BITS=64
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
17
src/libcdio/udf/CMakeLists.txt
Normal file
17
src/libcdio/udf/CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
set(target_name libcdio-udf)
|
||||||
|
file(GLOB_RECURSE source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
|
||||||
|
target_include_directories(${target_name} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libcdio
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libcdio/driver
|
||||||
|
${CMAKE_SOURCE_DIR}/src/msvc-missing)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
HAVE_CONFIG_H
|
||||||
|
_OFF_T_DEFINED
|
||||||
|
_off_t=__int64
|
||||||
|
off_t=_off_t
|
||||||
|
_FILE_OFFSET_BITS=64
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
5
src/ms-sys/CMakeLists.txt
Normal file
5
src/ms-sys/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
set(target_name ms-sys)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
target_include_directories(${target_name} PRIVATE inc)
|
||||||
|
target_compile_definitions(${target_name} PRIVATE _CRTDBG_MAP_ALLOC)
|
1
src/syslinux/CMakeLists.txt
Normal file
1
src/syslinux/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
add_all_subdirs()
|
11
src/syslinux/libfat/CMakeLists.txt
Normal file
11
src/syslinux/libfat/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
set(target_name syslinux-libfat)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
|
||||||
|
target_include_directories(${target_name} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/msvc-missing)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
inline=__inline
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
11
src/syslinux/libinstaller/CMakeLists.txt
Normal file
11
src/syslinux/libinstaller/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
set(target_name syslinux-libinstaller)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
|
||||||
|
target_include_directories(${target_name} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/msvc-missing)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
inline=__inline
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
11
src/syslinux/win/CMakeLists.txt
Normal file
11
src/syslinux/win/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
set(target_name syslinux-win)
|
||||||
|
file(GLOB source_files *.c *.h)
|
||||||
|
add_library(${target_name} STATIC ${source_files})
|
||||||
|
|
||||||
|
target_include_directories(${target_name} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/msvc-missing)
|
||||||
|
|
||||||
|
target_compile_definitions(${target_name} PRIVATE
|
||||||
|
inline=__inline
|
||||||
|
_CRTDBG_MAP_ALLOC)
|
Loading…
Add table
Add a link
Reference in a new issue