Ver a proveniência

Merge pull request #6 from Aang23/cmake_support

Initial CMake support
tags/v1.8.0
Liam há 4 anos
committed by GitHub
ascendente
cometimento
f730a6efe5
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: 4AEE18F83AFDEB23
3 ficheiros alterados com 44 adições e 0 eliminações
  1. +3
    -0
      .gitignore
  2. +21
    -0
      CMakeLists.txt
  3. +20
    -0
      cmake/FindLibSndFile.cmake

+ 3
- 0
.gitignore Ver ficheiro

@@ -50,3 +50,6 @@ aptdec

# VSCode
.vscode

# CMake
build

+ 21
- 0
CMakeLists.txt Ver ficheiro

@@ -0,0 +1,21 @@
cmake_minimum_required (VERSION 3.0.0)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

project (aptdec)

add_executable(aptdec main.c color.c dsp.c filter.c image.c median.c pngio.c reg.c)

# Math
target_link_libraries(aptdec PRIVATE m)

# PNG
if(WIN32 AND NOT MINGW)
find_package(PNG CONFIG REQUIRED)
else()
find_package(PNG REQUIRED)
endif()
target_link_libraries(aptdec PRIVATE PNG::PNG)

# SndFile
find_package(LibSndFile REQUIRED)
target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY})

+ 20
- 0
cmake/FindLibSndFile.cmake Ver ficheiro

@@ -0,0 +1,20 @@
# Find libsndfile

FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h)

SET(LIBSNDFILE_NAMES ${LIBSNDFILE_NAMES} sndfile libsndfile)
FIND_LIBRARY(LIBSNDFILE_LIBRARY NAMES ${LIBSNDFILE_NAMES} PATH)

IF (LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)
SET(LIBSNDFILE_FOUND TRUE)
ENDIF (LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)

IF (LIBSNDFILE_FOUND)
IF (NOT LibSndFile_FIND_QUIETLY)
MESSAGE (STATUS "Found LibSndFile: ${LIBSNDFILE_LIBRARY}")
ENDIF (NOT LibSndFile_FIND_QUIETLY)
ELSE (LIBSNDFILE_FOUND)
IF (LibSndFile_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find sndfile")
ENDIF (LibSndFile_FIND_REQUIRED)
ENDIF (LIBSNDFILE_FOUND)

Carregando…
Cancelar
Guardar