diff options
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") |