55 lines
1.4 KiB
CMake
55 lines
1.4 KiB
CMake
#----------------------------------------------#
|
|
#-----Konfiguration des Buildsystems CMake-----#
|
|
#----------------------------------------------#
|
|
# Minimale Version des Buildsystems
|
|
cmake_minimum_required(VERSION 3.16)
|
|
# Name des Projekts
|
|
project(LrcLibSync)
|
|
#----------------------------------------------#
|
|
#-------------------Optionen-------------------#
|
|
#----------------------------------------------#
|
|
# Setzte verwendeten C++-Standard auf C++17
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
# Optional: Baue mit Debugsymbolen / Optimierung
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
#set(CMAKE_BUILD_TYPE Release)
|
|
|
|
add_compile_options(-fsanitize=address)
|
|
add_link_options(-fsanitize=address)
|
|
|
|
|
|
add_compile_options(-ldl)
|
|
add_link_options(-ldl)
|
|
|
|
add_compile_options(-lpthread)
|
|
add_link_options(-lpthread)
|
|
|
|
|
|
add_compile_options(-lm)
|
|
add_link_options(-lm)
|
|
|
|
add_compile_options(-mavx2)
|
|
add_link_options(-mavx2)
|
|
|
|
|
|
add_compile_options(-msse2)
|
|
add_link_options(-msse2)
|
|
# Füge Includeverzeichnisse hinzu
|
|
include_directories(include)
|
|
# Legt die Variable SRC_FILES an, die alle
|
|
# .cpp-Dateien des Projekts benennt,
|
|
# die in Verzeichnis src/ liegen.
|
|
file(GLOB SRC_FILES
|
|
${PROJECT_SOURCE_DIR}/src/*)
|
|
|
|
# Use CMakes FetchContent
|
|
# Workaround for CMake >= 3.24
|
|
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP
|
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
|
cmake_policy(SET CMP0135 NEW)
|
|
endif()
|
|
|
|
|
|
add_executable(${PROJECT_NAME} src/main.cpp ${SRC_FILES})
|