Skip to content

Commit

Permalink
Merge pull request #37 from gopro/ylaala/pkg-config
Browse files Browse the repository at this point in the history
Ylaala/pkg config
  • Loading branch information
dnewman-gpsw authored Oct 2, 2019
2 parents 597c9ec + 601b44b commit bf1b09f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
add_definitions(-D_ALLOCATOR=1 -DWARPSTUFF=1)

if (WIN32)
include(ucm.cmake)
ucm_set_runtime(STATIC)

SET(COMPILER_FLAGS "")
SET(COMPILER_FLAGS_W_OMP "/openmp" )
SET(ADDITIONAL_LIBS "")
Expand All @@ -33,14 +30,13 @@ if (APPLE)
SET(ADDITIONAL_LIBS "-lpthread")
endif (APPLE)

set(CMAKE_CONFIGURATION_TYPES "Debug;Release")

include_directories("Common" "Tables" "Codec" "ConvertLib" "WarpLib" "Example")
file(GLOB CODEC_SOURCES "Codec/*.c" "Codec/*.h" "Codec/*.cpp" "WarpLib/*.c" "WarpLib/*.h" )
file(GLOB ENCODER_SOURCES "EncoderSDK/*.cpp" "Common/*.h")
file(GLOB DECODER_SOURCES "DecoderSDK/*.cpp" "Common/*.h" "WarpLib/*.c" "WarpLib/*.h" "ConvertLib/*.cpp" "ConvertLib/*.h" )
file(GLOB EXAMPLE_SOURCE "Example/*.cpp" "Example/*.h" )
file(GLOB WAVELETDEMO_SOURCE "Example/WaveletDemo/*.c" "Example/WaveletDemo/*.h" )
file(GLOB PUBLIC_HEADERS "Common/*.h")

# Build CFHDCodec library (static and shared rules)
if (BUILD_LIBS)
Expand Down Expand Up @@ -117,19 +113,26 @@ set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix
set(BIN_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/bin CACHE PATH "Installation prefix for user executables" FORCE)
set(LIB_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "Installation prefix for object code libraries" FORCE)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/cineformsdk CACHE PATH "Installation prefix for header files" FORCE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libcineformsdk.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libcineformsdk.pc)

# System wide installation
if (BUILD_STATIC)
if (BUILD_SEPARATED)
install(TARGETS CFHDEncoderStatic CFHDDecoderStatic DESTINATION lib/)
set(TARGET_NAMES CFHDEncoderStatic CFHDDecoderStatic)
else (BUILD_SEPARATED)
install(TARGETS CFHDCodecStatic DESTINATION lib/)
set(TARGET_NAMES CFHDCodecStatic)
endif (BUILD_SEPARATED)
else (BUILD_STATIC)
if (BUILD_SEPARATED)
install(TARGETS CFHDEncoder CFHDDecoder DESTINATION lib/)
set(TARGET_NAMES CFHDEncoder CFHDDecoder)
else (BUILD_SEPARATED)
install(TARGETS CFHDCodecShared DESTINATION lib/)
set(TARGET_NAMES CFHDCodecShared)
endif (BUILD_SEPARATED)
endif (BUILD_STATIC)
foreach(TARGET_NAME ${TARGET_NAMES})
set(LIB_INSTALL_NAMES ${LIB_INSTALL_NAMES} -l${TARGET_NAME})
endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libcineformsdk.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libcineformsdk.pc)

install(TARGETS ${TARGET_NAMES} DESTINATION lib/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcineformsdk.pc DESTINATION lib/pkgconfig)
install(FILES ${PUBLIC_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR})
8 changes: 8 additions & 0 deletions GPDeps
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "1.0",
"info": {
"type": "lib",
"visibility": "public",
"platforms": ["macos", "win", "linux"]
}
}
2 changes: 1 addition & 1 deletion libcineformsdk.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Name: ${PROJECT_NAME}
Description: CineForm SDK libraries
URL: https://github.com/gopro/cineform-sdk
Version: ${PROJECT_VERSION}
Libs: -L${LIB_INSTALL_DIR} -lCFHDCodec ${ADDITIONAL_LIBS}
Libs: -L${LIB_INSTALL_DIR} ${LIB_INSTALL_NAMES} ${ADDITIONAL_LIBS}
Cflags: -I${INCLUDE_INSTALL_DIR}

0 comments on commit bf1b09f

Please sign in to comment.