mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 11:14:39 +00:00
Refactor CMakeLists.txt for improved organization and add test data copying
This commit is contained in:
@@ -16,6 +16,12 @@ cmake_minimum_required(VERSION 3.13)
|
|||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
||||||
|
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Build architectures for Mac OS X" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Integrate vcpkg toolchain if available but not explicitly provided.
|
# Integrate vcpkg toolchain if available but not explicitly provided.
|
||||||
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||||
if(DEFINED ENV{VCPKG_ROOT} AND EXISTS "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
|
if(DEFINED ENV{VCPKG_ROOT} AND EXISTS "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
|
||||||
@@ -29,39 +35,41 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE AND EXISTS "${CMAKE_TOOLCHAIN_FILE}")
|
|||||||
include("${CMAKE_TOOLCHAIN_FILE}")
|
include("${CMAKE_TOOLCHAIN_FILE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(APPLE)
|
|
||||||
IF("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Build architectures for Mac OS X" FORCE)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF(APPLE)
|
|
||||||
|
|
||||||
project(libaaruformat C)
|
project(libaaruformat C)
|
||||||
|
|
||||||
# Option to enable slog logging (disabled by default)
|
# Option to enable slog logging (disabled by default)
|
||||||
option(USE_SLOG "Enable slog logging" OFF)
|
option(USE_SLOG "Enable slog logging" OFF)
|
||||||
|
|
||||||
add_compile_definitions(__STDC_FORMAT_MACROS=1)
|
# Set C standard
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_C_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
# Enable position independent code by default
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
# MSVC ARM specific override
|
||||||
if("${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" AND "${CMAKE_C_COMPILER_ARCHITECTURE_ID}" MATCHES "ARMV7")
|
if("${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" AND "${CMAKE_C_COMPILER_ARCHITECTURE_ID}" MATCHES "ARMV7")
|
||||||
set(CMAKE_C_STANDARD 11)
|
set(CMAKE_C_STANDARD 11)
|
||||||
else()
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Global compile definitions
|
||||||
|
add_compile_definitions(__STDC_FORMAT_MACROS=1)
|
||||||
|
|
||||||
|
# MinGW specific configuration
|
||||||
if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
|
if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
|
||||||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
|
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
|
||||||
set(WIN32 TRUE)
|
set(WIN32 TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_link_options(-static-libgcc)
|
add_link_options(-static-libgcc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message("Detected system processor: ${CMAKE_SYSTEM_PROCESSOR}")
|
message(STATUS "Detected system processor: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
message("Detected vs platform name: ${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
|
message(STATUS "Detected vs platform name: ${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
|
||||||
message("Detected compiler: ${CMAKE_C_COMPILER_ID}")
|
message(STATUS "Detected compiler: ${CMAKE_C_COMPILER_ID}")
|
||||||
message("Detected build type: ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Detected build type: ${CMAKE_BUILD_TYPE}")
|
||||||
message("Detected platform: ${CMAKE_C_PLATFORM_ID}")
|
message(STATUS "Detected platform: ${CMAKE_C_PLATFORM_ID}")
|
||||||
message("Size of (void*): ${CMAKE_SIZEOF_VOID_P}")
|
message(STATUS "Size of (void*): ${CMAKE_SIZEOF_VOID_P}")
|
||||||
|
|
||||||
# Check if target is 64-bit
|
# Check if target is 64-bit
|
||||||
if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8"
|
if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8"
|
||||||
@@ -188,7 +196,18 @@ add_library(aaruformat SHARED
|
|||||||
include/aaruformat/structs/tape.h
|
include/aaruformat/structs/tape.h
|
||||||
src/blocks/tape.c)
|
src/blocks/tape.c)
|
||||||
|
|
||||||
include_directories(include include/aaruformat 3rdparty/uthash/include 3rdparty/uthash/src)
|
# Set up include directories for the target
|
||||||
|
target_include_directories(aaruformat
|
||||||
|
PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/aaruformat>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/uthash/include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/uthash/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Load third-party dependencies
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake-modules")
|
||||||
|
|
||||||
include(3rdparty/flac.cmake)
|
include(3rdparty/flac.cmake)
|
||||||
include(3rdparty/lzma.cmake)
|
include(3rdparty/lzma.cmake)
|
||||||
@@ -215,15 +234,16 @@ macro(TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE target)
|
|||||||
endforeach()
|
endforeach()
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
foreach(lib IN LISTS ARGN)
|
foreach(lib IN LISTS ARGN)
|
||||||
target_link_libraries(${target} "LINKER:--whole-archive" ${lib} "LINKER:--no-whole-archive")
|
target_link_libraries(${target} -Wl,-force_load ${lib})
|
||||||
endforeach()
|
endforeach()
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
foreach(lib IN LISTS ARGN)
|
foreach(lib IN LISTS ARGN)
|
||||||
target_link_libraries(${target} "LINKER:--whole-archive" ${lib} "LINKER:--no-whole-archive")
|
target_link_libraries(${target} -Wl,--whole-archive ${lib} -Wl,--no-whole-archive)
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
# MinGW/ARM specific: disable PIC
|
||||||
if(NOT "${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW"
|
if(NOT "${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW"
|
||||||
OR (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm"
|
OR (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm"
|
||||||
AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"))
|
AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"))
|
||||||
@@ -232,10 +252,6 @@ else()
|
|||||||
set_property(TARGET aaruformat PROPERTY POSITION_INDEPENDENT_CODE FALSE)
|
set_property(TARGET aaruformat PROPERTY POSITION_INDEPENDENT_CODE FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake-modules")
|
|
||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
# Add slog submodule
|
# Add slog submodule
|
||||||
if(POLICY CMP0000)
|
if(POLICY CMP0000)
|
||||||
cmake_policy(VERSION 3.5)
|
cmake_policy(VERSION 3.5)
|
||||||
@@ -246,18 +262,20 @@ if(USE_SLOG)
|
|||||||
add_subdirectory(3rdparty/slog)
|
add_subdirectory(3rdparty/slog)
|
||||||
|
|
||||||
# Include slog headers
|
# Include slog headers
|
||||||
include_directories(aaruformat 3rdparty/slog/src)
|
target_include_directories(aaruformat PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/slog/src)
|
||||||
|
|
||||||
# Enable TRACE and slog output
|
# Enable TRACE and slog output
|
||||||
add_compile_definitions(aaruformat ENABLE_TRACE ENABLE_FATAL USE_SLOG)
|
target_compile_definitions(aaruformat PRIVATE ENABLE_TRACE ENABLE_FATAL USE_SLOG)
|
||||||
|
|
||||||
|
# Link slog
|
||||||
|
target_link_libraries(aaruformat PRIVATE slog)
|
||||||
|
|
||||||
message(STATUS "slog logging enabled")
|
message(STATUS "slog logging enabled")
|
||||||
else()
|
else()
|
||||||
message(STATUS "slog logging disabled (enable with -DUSE_SLOG=ON)")
|
message(STATUS "slog logging disabled (enable with -DUSE_SLOG=ON)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(include 3rdparty/uthash/src)
|
# Check for math library
|
||||||
|
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
|
|
||||||
check_library_exists(m log "" HAVE_LIB_M)
|
check_library_exists(m log "" HAVE_LIB_M)
|
||||||
@@ -265,11 +283,6 @@ if(HAVE_LIB_M)
|
|||||||
TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE(aaruformat m)
|
TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE(aaruformat m)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Link slog conditionally
|
|
||||||
if(USE_SLOG)
|
|
||||||
target_link_libraries(aaruformat slog)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Find Doxygen for documentation generation
|
# Find Doxygen for documentation generation
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
# 'Google_test' is the subproject name
|
# Test suite project
|
||||||
project(tests)
|
project(tests CXX)
|
||||||
|
|
||||||
# 'lib' is the folder with Google Test sources
|
# Temporarily disable deprecation warnings for Google Test
|
||||||
set(_aaru_saved_warn_deprecated __aaru_warn_not_set__)
|
set(_aaru_saved_warn_deprecated __aaru_warn_not_set__)
|
||||||
if(DEFINED CMAKE_WARN_DEPRECATED)
|
if(DEFINED CMAKE_WARN_DEPRECATED)
|
||||||
set(_aaru_saved_warn_deprecated ${CMAKE_WARN_DEPRECATED})
|
set(_aaru_saved_warn_deprecated ${CMAKE_WARN_DEPRECATED})
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
|
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
# Add Google Test subdirectory
|
||||||
add_subdirectory(lib)
|
add_subdirectory(lib)
|
||||||
|
|
||||||
|
# Restore original deprecation warning setting
|
||||||
if(_aaru_saved_warn_deprecated STREQUAL __aaru_warn_not_set__)
|
if(_aaru_saved_warn_deprecated STREQUAL __aaru_warn_not_set__)
|
||||||
unset(CMAKE_WARN_DEPRECATED CACHE)
|
unset(CMAKE_WARN_DEPRECATED CACHE)
|
||||||
unset(CMAKE_WARN_DEPRECATED)
|
unset(CMAKE_WARN_DEPRECATED)
|
||||||
@@ -19,38 +21,82 @@ else()
|
|||||||
set(CMAKE_WARN_DEPRECATED ${_aaru_saved_warn_deprecated} CACHE BOOL "" FORCE)
|
set(CMAKE_WARN_DEPRECATED ${_aaru_saved_warn_deprecated} CACHE BOOL "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
unset(_aaru_saved_warn_deprecated)
|
unset(_aaru_saved_warn_deprecated)
|
||||||
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR} ../include ../3rdparty/uthash/include ../3rdparty/uthash/src)
|
|
||||||
|
|
||||||
# Copy test data files into build tree
|
# Define test data files to copy
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/random DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
set(TEST_DATA_FILES
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/flac.flac DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
random
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/audio.bin DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
flac.flac
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/lzma.bin DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
audio.bin
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/data.bin DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
lzma.bin
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/mf2hd_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
data.bin
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/mf2hd.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
mf2hd_v1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/floptical_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
mf2hd.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/floptical.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
floptical_v1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/gigamo_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
floptical.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/gigamo.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
gigamo_v1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/hifd_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
gigamo.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/hifd.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
hifd_v1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/mo540_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
hifd.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/mo540.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
mo540_v1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/mo640_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
mo540.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/mo640.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
mo640_v1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/cdmode1_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
mo640.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/cdmode1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
cdmode1_v1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/cdmode2_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
cdmode1.aif
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/cdmode2.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
cdmode2_v1.aif
|
||||||
|
cdmode2.aif
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create data directory in build tree
|
||||||
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data)
|
||||||
|
|
||||||
|
# Copy test data files at build time (not configure time)
|
||||||
|
foreach(data_file ${TEST_DATA_FILES})
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data/${data_file}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/data/${data_file}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/data/${data_file}
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/${data_file}
|
||||||
|
COMMENT "Copying test data file: ${data_file}"
|
||||||
|
)
|
||||||
|
list(APPEND TEST_DATA_OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/data/${data_file})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# Add custom target to ensure data files are copied
|
||||||
|
add_custom_target(copy_test_data ALL DEPENDS ${TEST_DATA_OUTPUTS})
|
||||||
|
|
||||||
# Test executable (all unit tests)
|
# Test executable (all unit tests)
|
||||||
add_executable(tests_run crc64.cpp spamsum.cpp crc32.c crc32.h flac.cpp lzma.cpp sha256.cpp md5.cpp sha1.cpp open_image.cpp
|
add_executable(tests_run
|
||||||
create_image.cpp)
|
crc64.cpp
|
||||||
|
spamsum.cpp
|
||||||
|
crc32.c
|
||||||
|
crc32.h
|
||||||
|
flac.cpp
|
||||||
|
lzma.cpp
|
||||||
|
sha256.cpp
|
||||||
|
md5.cpp
|
||||||
|
sha1.cpp
|
||||||
|
open_image.cpp
|
||||||
|
create_image.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set up include directories using modern target-specific approach
|
||||||
|
target_include_directories(tests_run
|
||||||
|
PRIVATE
|
||||||
|
${gtest_SOURCE_DIR}/include
|
||||||
|
${gtest_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/uthash/include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/uthash/src
|
||||||
|
)
|
||||||
|
|
||||||
# Link libraries
|
# Link libraries
|
||||||
target_link_libraries(tests_run PRIVATE gtest gtest_main aaruformat)
|
target_link_libraries(tests_run PRIVATE gtest gtest_main aaruformat)
|
||||||
|
|
||||||
|
# Ensure test data is copied before running tests
|
||||||
|
add_dependencies(tests_run copy_test_data)
|
||||||
|
|
||||||
# Integrate with CTest (per-test reporting)
|
# Integrate with CTest (per-test reporting)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
|
|||||||
@@ -1,11 +1,47 @@
|
|||||||
project(aaruformattool)
|
# Tool executable project
|
||||||
|
project(aaruformattool C CXX)
|
||||||
|
|
||||||
|
# Find required dependencies
|
||||||
find_package(ICU COMPONENTS uc REQUIRED)
|
find_package(ICU COMPONENTS uc REQUIRED)
|
||||||
find_package(Argtable3 CONFIG REQUIRED)
|
find_package(Argtable3 CONFIG REQUIRED)
|
||||||
|
|
||||||
include_directories(${ICU_INCLUDE_DIRS})
|
# Tool executable
|
||||||
|
add_executable(aaruformattool
|
||||||
|
main.c
|
||||||
|
version.h
|
||||||
|
aaruformattool.h
|
||||||
|
identify.c
|
||||||
|
info.c
|
||||||
|
helpers.c
|
||||||
|
read.c
|
||||||
|
printhex.c
|
||||||
|
verify.c
|
||||||
|
ecc_cd.c
|
||||||
|
commands.h
|
||||||
|
commands.c
|
||||||
|
usage.h
|
||||||
|
usage.c
|
||||||
|
compare.c
|
||||||
|
cli_compare.c
|
||||||
|
convert.c
|
||||||
|
termbox2.h
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(aaruformattool main.c version.h aaruformattool.h identify.c info.c helpers.c read.c printhex.c verify.c ecc_cd.c
|
# Set C as the linker language (even though we enable CXX for stdlib)
|
||||||
commands.h commands.c usage.h usage.c compare.c cli_compare.c convert.c termbox2.h)
|
set_target_properties(aaruformattool PROPERTIES LINKER_LANGUAGE C)
|
||||||
target_link_libraries(aaruformattool "aaruformat" argtable3::argtable3)
|
|
||||||
target_link_libraries(aaruformattool "aaruformat" ICU::uc)
|
# Set up include directories
|
||||||
|
target_include_directories(aaruformattool PRIVATE ${ICU_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
# Link libraries
|
||||||
|
target_link_libraries(aaruformattool
|
||||||
|
PRIVATE
|
||||||
|
aaruformat
|
||||||
|
argtable3::argtable3
|
||||||
|
ICU::uc
|
||||||
|
)
|
||||||
|
|
||||||
|
# On macOS/iOS, explicitly link the C++ standard library for ICU dependencies
|
||||||
|
if(APPLE)
|
||||||
|
target_link_libraries(aaruformattool PRIVATE "-lc++")
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user