mlc/CMakeLists.txt

50 lines
1.2 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.5)
2023-07-16 00:15:31 +00:00
project(
mlc
2024-07-06 16:53:26 +00:00
VERSION 1.3.4
DESCRIPTION "Media Library Compiler: converts your media library to a lossy compilation"
2023-07-16 00:15:31 +00:00
LANGUAGES CXX
)
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0079 NEW)
2023-07-15 19:44:29 +00:00
2023-10-10 16:24:46 +00:00
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif ()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
list(APPEND COMPILE_OPTIONS -O3)
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND COMPILE_OPTIONS -g)
list(APPEND COMPILE_OPTIONS -Wall)
list(APPEND COMPILE_OPTIONS -Wextra)
endif()
message("Compilation options: " ${COMPILE_OPTIONS})
2023-07-16 00:15:31 +00:00
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
2023-10-20 21:12:26 +00:00
set(THREADS_PREFER_PTHREAD_FLAG ON)
2023-07-15 19:44:29 +00:00
2023-07-16 00:15:31 +00:00
find_package(FLAC REQUIRED)
find_package(JPEG REQUIRED)
2023-10-20 20:39:27 +00:00
find_package(LAME REQUIRED)
find_package(TAGLIB REQUIRED)
2023-10-20 21:12:26 +00:00
find_package(Threads REQUIRED)
2023-07-16 00:15:31 +00:00
2023-10-20 20:39:27 +00:00
add_executable(${PROJECT_NAME})
2023-10-10 16:24:46 +00:00
target_compile_options(${PROJECT_NAME} PRIVATE ${COMPILE_OPTIONS})
add_subdirectory(src)
2023-07-16 00:15:31 +00:00
2023-10-20 20:39:27 +00:00
target_link_libraries(${PROJECT_NAME}
2023-07-25 23:39:56 +00:00
FLAC::FLAC
2023-10-20 20:39:27 +00:00
LAME::LAME
JPEG::JPEG
2023-10-20 20:39:27 +00:00
TAGLIB::TAGLIB
2023-10-20 21:12:26 +00:00
Threads::Threads
2023-07-16 00:15:31 +00:00
)
2023-07-15 19:44:29 +00:00
2023-10-20 20:39:27 +00:00
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)