Преглед на файлове

Initial CMake support

tags/v1.8.0
Aang23 преди 4 години
родител
ревизия
61db9ee3ed
променени са 3 файла, в които са добавени 44 реда и са изтрити 0 реда
  1. +3
    -0
      .gitignore
  2. +21
    -0
      CMakeLists.txt
  3. +20
    -0
      cmake/FindLibSndFile.cmake

+ 3
- 0
.gitignore Целия файл

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

# VSCode
.vscode

# CMake
build

+ 21
- 0
CMakeLists.txt Целия файл

@@ -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 Целия файл

@@ -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)

Зареждане…
Отказ
Запис