diff options
| author | jhurst <jhurst@cinecert.com> | 2016-05-09 18:18:42 +0000 |
|---|---|---|
| committer | jhurst <> | 2016-05-09 18:18:42 +0000 |
| commit | 2b101472bf1f76db63ae1c97cf5393fe7195bcb1 (patch) | |
| tree | edf3c46b53393fc796d02d06130477e485639cc2 /src/CMakeLists.txt | |
| parent | cc05011a20424c6b855995b5965782582ca21c42 (diff) | |
Defined bool ASDCP::UL::operator<(const UL& rhs) const, which is needed to carry out the version-insensitive lookup policy when searching for ULs in a std::map<> of UL entries.
Diffstat (limited to 'src/CMakeLists.txt')
| -rw-r--r-- | src/CMakeLists.txt | 222 |
1 files changed, 171 insertions, 51 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8ccc914..259989b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,51 +1,171 @@ -cmake_minimum_required(VERSION 2.8.12)
-
-project(asdcplibmod)
-
-# The version number.
-set(VERSION_MAJOR 2)
-set(VERSION_MINOR 5)
-set(VERSION_PATCH 13)
-set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "Default Targets")
-# use, i.e. don't skip the full RPATH for the build tree
-set(CMAKE_SKIP_BUILD_RPATH OFF)
-# when building, don't use the install RPATH already
-# (but later on when installing)
-set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-# add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
-# the RPATH to be used when installing, but only if it's not a system directory
-list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
-if("${isSystemDir}" STREQUAL "-1")
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-endif("${isSystemDir}" STREQUAL "-1")
-
-# Configure a header file to pass some of the CMake settings to the source code.
-configure_file("${PROJECT_SOURCE_DIR}/src/info.in" "${PROJECT_BINARY_DIR}/src/info.h")
-
-# Add the binary tree to the search path for include files so that we will find info.h.
-include_directories("${PROJECT_BINARY_DIR}/src")
-add_subdirectory(src)
-
-set(CPACK_GENERATOR ZIP)
-if(UNIX)
- set(CPACK_GENERATOR ${CPACK_GENERATOR};STGZ;TGZ)
-endif(UNIX)
-if(UNIX AND NOT APPLE)
- set(CPACK_GENERATOR ${CPACK_GENERATOR};DEB;RPM)
-endif(UNIX AND NOT APPLE)
-set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Modified asdcp lib. Can generate MXF resources.")
-set(CPACK_PACKAGE_VENDOR "HSRM")
-set(CPACK_PACKAGE_CONTACT "bjoern.stresing@gmx.de")
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
-set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
-set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
-set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
-set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME}{VERSION_MAJOR}.${VERSION_MINOR})
-include(CPack)
+find_library(OpenSSLLib_PATH NAMES libeay32 crypto PATHS "${PROJECT_SOURCE_DIR}/../openssl" "${PROJECT_SOURCE_DIR}/../lib/openssl" "$ENV{CMAKE_HINT}/openssl" ENV CMAKE_HINT PATH_SUFFIXES "lib" "openssl" "lib/openssl") +find_path(OpenSSLLib_include_DIR NAMES openssl/rand.h PATHS "${PROJECT_SOURCE_DIR}/../openssl" "${PROJECT_SOURCE_DIR}/../lib/openssl" "$ENV{CMAKE_HINT}/openssl" ENV CMAKE_HINT PATH_SUFFIXES "include" "inc32") +find_library(XercescppLib_PATH NAMES xerces-c xerces-c_3 PATHS "${PROJECT_SOURCE_DIR}/../xercescpp" "${PROJECT_SOURCE_DIR}/../lib/xercescpp" "$ENV{CMAKE_HINT}/xercescpp" ENV CMAKE_HINT PATH_SUFFIXES "lib") +find_library(XercescppLib_Debug_PATH NAMES xerces-c xerces-c_3D PATHS "${PROJECT_SOURCE_DIR}/../xercescpp" "${PROJECT_SOURCE_DIR}/../lib/xercescpp" "$ENV{CMAKE_HINT}/xercescpp" ENV CMAKE_HINT PATH_SUFFIXES "lib") +find_path(XercescppLib_include_DIR NAMES xercesc/dom/DOM.hpp PATHS "${PROJECT_SOURCE_DIR}/../xercescpp" "${PROJECT_SOURCE_DIR}/../lib/xercescpp" "$ENV{CMAKE_HINT}/xercescpp" ENV CMAKE_HINT PATH_SUFFIXES "include") +set(UseRandomUUID OFF CACHE BOOL "") + +# This lib. doesn't export from dll with __declspec(dllexport). So this lib. must be built statically on Windows. +if(NOT WIN32) + set(BUILD_SHARED_LIBS true CACHE BOOL "Build shared or static libs?" FORCE) +endif(NOT WIN32) + +# ----------libkumu---------- +# source +set(kumu_src KM_fileio.cpp KM_log.cpp KM_prng.cpp KM_util.cpp KM_xml.cpp KM_tai.cpp) + +# header +set(kumu_src ${kumu_src} KM_fileio.h KM_log.h KM_prng.h KM_util.h KM_xml.h KM_tai.h KM_error.h KM_memio.h KM_mutex.h KM_platform.h) + +# ----------libasdcp---------- +# source +set(asdcp_src MPEG2_Parser.cpp MPEG.cpp JP2K_Codestream_Parser.cpp JP2K_Sequence_Parser.cpp JP2K.cpp PCM_Parser.cpp Wav.cpp + TimedText_Parser.cpp KLV.cpp Dict.cpp MXFTypes.cpp MXF.cpp Index.cpp Metadata.cpp AS_DCP.cpp AS_DCP_MXF.cpp AS_DCP_AES.cpp + h__Reader.cpp h__Writer.cpp AS_DCP_MPEG2.cpp AS_DCP_JP2K.cpp AS_DCP_PCM.cpp AS_DCP_TimedText.cpp PCMParserList.cpp MDD.cpp + AS_DCP_ATMOS.cpp AS_DCP_DCData.cpp DCData_ByteStream_Parser.cpp DCData_Sequence_Parser.cpp AtmosSyncChannel_Generator.cpp + AtmosSyncChannel_Mixer.cpp PCMDataProviders.cpp SyncEncoder.c CRC16.c UUIDInformation.c +) + +# header for deployment (install target) +set(asdcp_deploy_header AS_DCP.h PCMParserList.h AS_DCP_internal.h KM_error.h KM_fileio.h KM_util.h KM_memio.h KM_tai.h KM_platform.h KM_log.h KM_mutex.h) + +# header +set(asdcp_src ${asdcp_src} Wav.h WavFileWriter.h MXF.h Metadata.h JP2K.h AS_DCP.h AS_DCP_internal.h KLV.h MPEG.h MXFTypes.h MDD.h + PCMParserList.h S12MTimecode.h AS_DCP_DCData_internal.h AtmosSyncChannel_Generator.h AtmosSyncChannel_Mixer.h PCMDataProviders.h + SyncEncoder.h SyncCommon.h CRC16.h UUIDInformation.h +) + +# ----------as02---------- +# source +set(as02_src h__02_Reader.cpp h__02_Writer.cpp AS_02_JP2K.cpp AS_02_PCM.cpp ST2052_TextParser.cpp AS_02_TimedText.cpp) + +# header for deployment (install target) +set(as02_deploy_header AS_02.h Metadata.h MXF.h MXFTypes.h KLV.h MDD.h) + +# header +set(as02_src ${as02_src} AS_02.h AS_02_internal.h) + + +include_directories("${PROJECT_SOURCE_DIR}/src" "${OpenSSLLib_include_DIR}" "${XercescppLib_include_DIR}") + +add_definitions(/DPACKAGE_VERSION=\"${VERSION_STRING}\" /DHAVE_XERCES_C=1) +if(WIN32) + add_definitions(/DKM_WIN32 /D_CONSOLE /DASDCP_PLATFORM=\"win32\" /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") +elseif(UNIX) + add_definitions(/DASDCP_PLATFORM=\"unix\") +endif(WIN32) + +if(UseRandomUUID) + add_definitions(/DCONFIG_RANDOM_UUID=1) +endif(UseRandomUUID) + +set(CMAKE_DEBUG_POSTFIX _d) # Append "_d" if debug lib. + +add_library(libkumu ${kumu_src}) +target_link_libraries(libkumu general "${OpenSSLLib_PATH}" debug "${XercescppLib_Debug_PATH}" optimized "${XercescppLib_PATH}") +set_target_properties(libkumu PROPERTIES PREFIX "" VERSION ${VERSION_STRING} SOVERSION ${VERSION_MAJOR}) + +add_library(libasdcp ${asdcp_src}) +target_link_libraries(libasdcp general libkumu) +set_target_properties(libasdcp PROPERTIES PREFIX "" VERSION ${VERSION_STRING} SOVERSION ${VERSION_MAJOR}) + +add_library(libas02 ${as02_src}) +target_link_libraries(libas02 general libasdcp) +set_target_properties(libas02 PROPERTIES PREFIX "" VERSION ${VERSION_STRING} SOVERSION ${VERSION_MAJOR}) + +add_executable(blackwave "blackwave.cpp") +target_link_libraries(blackwave general libasdcp) +if(WIN32) + target_link_libraries(blackwave general Advapi32.lib) +endif(WIN32) + +add_executable(wavesplit "wavesplit.cpp") +target_link_libraries(wavesplit general libasdcp) +if(WIN32) + target_link_libraries(wavesplit general Advapi32.lib) +endif(WIN32) + +add_executable(kmuuidgen "kmuuidgen.cpp") +target_link_libraries(kmuuidgen general libkumu) +if(WIN32) + target_link_libraries(kmuuidgen general Advapi32.lib) +endif(WIN32) + +add_executable(kmrandgen "kmrandgen.cpp") +target_link_libraries(kmrandgen general libkumu) +if(WIN32) + target_link_libraries(kmrandgen general Advapi32.lib) +endif(WIN32) + +add_executable(kmfilegen "kmfilegen.cpp") +target_link_libraries(kmfilegen general libkumu) +if(WIN32) + target_link_libraries(kmfilegen general Advapi32.lib) +endif(WIN32) + +add_executable(klvwalk "klvwalk.cpp") +target_link_libraries(klvwalk general libasdcp) +if(WIN32) + target_link_libraries(klvwalk general Advapi32.lib) +endif(WIN32) + +add_executable(asdcp-test "asdcp-test.cpp") +target_link_libraries(asdcp-test general libasdcp) +if(WIN32) + target_link_libraries(asdcp-test general Advapi32.lib) +endif(WIN32) + +add_executable(asdcp-wrap "asdcp-wrap.cpp") +target_link_libraries(asdcp-wrap general libasdcp) +if(WIN32) + target_link_libraries(asdcp-wrap general Advapi32.lib) +endif(WIN32) + +add_executable(asdcp-unwrap "asdcp-unwrap.cpp") +target_link_libraries(asdcp-unwrap general libasdcp) +if(WIN32) + target_link_libraries(asdcp-unwrap general Advapi32.lib) +endif(WIN32) + +add_executable(asdcp-info "asdcp-info.cpp") +target_link_libraries(asdcp-info general libasdcp) +if(WIN32) + target_link_libraries(asdcp-info general Advapi32.lib) +endif(WIN32) + +add_executable(asdcp-util "asdcp-util.cpp") +target_link_libraries(asdcp-util general libasdcp) +if(WIN32) + target_link_libraries(asdcp-util general Advapi32.lib) +endif(WIN32) + +add_executable(j2c-test "j2c-test.cpp") +target_link_libraries(j2c-test general libasdcp) +if(WIN32) + target_link_libraries(j2c-test general Advapi32.lib) +endif(WIN32) + +add_executable(as-02-wrap "as-02-wrap.cpp") +target_link_libraries(as-02-wrap general libas02) +if(WIN32) + target_link_libraries(as-02-wrap general Advapi32.lib) +endif(WIN32) + +add_executable(as-02-unwrap "as-02-unwrap.cpp") +target_link_libraries(as-02-unwrap general libas02) +if(WIN32) + target_link_libraries(as-02-unwrap general Advapi32.lib) +endif(WIN32) + +add_executable(as-02-info "as-02-info.cpp") +target_link_libraries(as-02-info general libas02) +if(WIN32) + target_link_libraries(as-02-info general Advapi32.lib) +endif(WIN32) + +# add the install target +install(TARGETS libkumu libasdcp libas02 EXPORT asdcplibtargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib INCLUDES DESTINATION "${OpenSSLLib_include_DIR}" "${XercescppLib_include_DIR}") +install(TARGETS blackwave wavesplit kmuuidgen kmrandgen kmfilegen klvwalk asdcp-test asdcp-wrap asdcp-unwrap asdcp-info asdcp-util j2c-test as-02-wrap as-02-unwrap as-02-info RUNTIME DESTINATION bin) +install(FILES ${as02_deploy_header} ${asdcp_deploy_header} DESTINATION include) +install(EXPORT asdcplibtargets DESTINATION targets) |
