AW-Security-Media-Lib/CMakeLists.txt

49 lines
1.8 KiB
CMake
Raw Normal View History

2022-09-18 03:35:35 +08:00
cmake_minimum_required(VERSION 3.9)
project(SecMedia VERSION 0.0.1 DESCRIPTION "Security Media Package")
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/release/lib)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/release/out)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_C_FLAGS$ "${CMAKE_C_FLAGS} -fvisibility = hidden")
set(CMAKE_CXX_FLAGS$ "${CMAKE_CXX_FLAGS} -fvisibility = hidden")
add_compile_options(-fPIC)
add_compile_options(-fvisibility=hidden)
include(GNUInstallDirs)
include(GenerateExportHeader)
include_directories(include src)
add_definitions(-DGENERATE_EXPORT)
set(SecMedia_Root ${CMAKE_CURRENT_SOURCE_DIR}/src)
file(GLOB SecMedia_src_list ${SecMedia_Root}/*/*.cpp ${SecMedia_Root}/*/*.h ${SecMedia_Root}/*/*.c ${SecMedia_Root}/*/*/*.cpp ${SecMedia_Root}/*/*/*.h ${SecMedia_Root}/*/*/*.c)
file(GLOB SecMedia_api_list ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
# target_compile_options(${PROJECT_NAME} PRIVATE -fvisibility=hidden)
add_library(${PROJECT_NAME} SHARED ${SecMedia_src_list})
#add_library(${PROJECT_NAME} STATIC ${SecMedia_src_list})
target_include_directories(${PROJECT_NAME} PRIVATE ${SecMedia_Root}/.)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
PUBLIC_HEADER ${SecMedia_api_list}
)
# CXX_VISIBILITY_PRESET hidden
# CMAKE_C_FLAGS hidden)
set(LINK_LIB_LIST ${PROJECT_NAME} )
#MESSAGE(STATUS ${SecMedia_api_list})
#configure_file(SecMedia.pc.in SecMedia.pc @ONLY)
# install(TARGETS ${PROJECT_NAME}
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc
# DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
add_subdirectory(test)