-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (36 loc) · 1.74 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
46
47
cmake_minimum_required (VERSION 3.5...3.17)
project(EnterExtractor LANGUAGES CXX)
option(BOOST_FILESYSTEM "Use boost filesystem instead of C++17 filesystem" OFF)
option(ENABLE_MULTITHREADING "Enable multithreaded PNG output for BUP conversion" ON)
set(CMAKE_FIND_FRAMEWORK LAST)
set(SOURCES src/Image.cpp src/Decompression.cpp src/HeaderStructs.cpp src/RegionChecker.cpp src/Pic.cpp src/CompositedBupOutputter.cpp src/PartsBupOutputter.cpp src/Bup.cpp src/Txa.cpp src/Msk.cpp src/Utilities.cpp src/main.cpp)
set(HEADERS src/Config.hpp src/Image.hpp src/Decompression.hpp src/HeaderStructs.hpp src/RegionChecker.hpp src/FileTypes.hpp src/FS.hpp src/BupOutputters.hpp src/Utilities.hpp)
add_executable(EnterExtractor ${SOURCES} ${HEADERS})
find_package(PNG REQUIRED)
target_link_libraries(EnterExtractor PRIVATE PNG::PNG)
if(NOT WIN32)
find_package(Iconv REQUIRED)
target_link_libraries(EnterExtractor PRIVATE Iconv::Iconv)
endif()
set(BOOST_COMPONENTS)
if(${BOOST_FILESYSTEM})
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} filesystem)
target_compile_definitions(EnterExtractor PRIVATE USE_BOOST_FS)
target_compile_features(EnterExtractor PRIVATE cxx_std_14)
else()
target_compile_features(EnterExtractor PRIVATE cxx_std_17)
endif()
if(${ENABLE_MULTITHREADING})
find_package(Threads REQUIRED)
target_link_libraries(EnterExtractor PRIVATE Threads::Threads)
target_compile_definitions(EnterExtractor PRIVATE ENABLE_MULTITHREADED=1)
else()
target_compile_definitions(EnterExtractor PRIVATE ENABLE_MULTITHREADED=0)
endif()
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
foreach(component IN ITEMS ${BOOST_COMPONENTS})
target_link_libraries(EnterExtractor PRIVATE Boost::${component})
endforeach()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()