diff options
author | Vitaliy Kirsanov <krokoziabla@yandex-team.ru> | 2019-04-07 12:37:56 +0300 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2019-05-04 11:41:48 +1000 |
commit | 6cd2b6cded1d7281df7584d7fad9ccb1d1022243 (patch) | |
tree | 5014375b784a5337cf9688edf0fd446a3878c16e /CMakeLists.txt | |
parent | c39718d7a36405114f9ed0b1a7acaef64ea88131 (diff) | |
download | flac-6cd2b6cded1d7281df7584d7fad9ccb1d1022243.tar.gz |
FindOGG.cmake module added
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a4870fe5..e1166db5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,10 +6,14 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(BUILD_CXXLIBS "Build libFLAC++" ON) option(BUILD_EXAMPLES "Build and install examples" ON) +option(WITH_OGG "ogg support (default: test for libogg)" ON) + +if(WITH_OGG) + find_package(OGG REQUIRED) +endif() if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef") if(CMAKE_BULD_TYPE STREQUAL Release) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -funroll-loops") @@ -17,6 +21,12 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") option(ENABLE_SSP "Enable GNU GCC stack smash protection" OFF) endif() +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef") +endif() +if(CMAKE_C_COMPILER_ID MATCHES "GNU") + set(CMAKE_EXE_LINKER_FLAGS -no-pie) +endif() include(CMakePackageConfigHelpers) include(CPack) @@ -114,6 +124,7 @@ install( FILES "${CMAKE_CURRENT_BINARY_DIR}/flac-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/flac-config-version.cmake" + "cmake/FindOGG.cmake" DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake") file(GLOB FLAC_HEADERS "include/FLAC/*.h") |