Commit b9cd1be2 authored by François Grisez's avatar François Grisez

Reworks build with CMake

parent 44de7a5c
......@@ -16,12 +16,16 @@ configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
include_directories(${CMAKE_BINARY_DIR} ./corec)
if(NOT ${CMAKE_HOST_SYSTEM_NAME} STREQUAL Windows)
add_compile_options(-fPIC)
endif()
add_subdirectory(corec/corec)
add_subdirectory(libebml2)
add_subdirectory(libmatroska2)
install(FILES ${CMAKE_BINARY_DIR}/config.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/matroska2/include/corec
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec
)
include(CMakePackageConfigHelpers)
......
......@@ -31,8 +31,7 @@
get_filename_component(MATROSKA2_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
set(MATROSKA2_INCLUDE_DIRS
${MATROSKA2_CMAKE_DIR}/../../../include
${MATROSKA2_CMAKE_DIR}/../../matroska2/include
)
set(MATROSKA2_LIBRARIES ${MATROSKA2_CMAKE_DIR}/../../libmatroska.a)
set(MATROSKA2_LIBRARIES ${MATROSKA2_CMAKE_DIR}/../../libmatroska2.a ${MATROSKA2_CMAKE_DIR}/../../libebml2.a ${MATROSKA2_CMAKE_DIR}/../../libcorec.a)
set(MATROSKA2_CPPFLAGS)
set(MATROSKA2_FOUND 1)
......@@ -46,6 +46,10 @@ endif()
add_library(corec STATIC ${COREC_SOURCES})
install(TARGETS corec
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
install(FILES
banned.h
confhelper.h
......@@ -55,5 +59,34 @@ install(FILES
memalloc.h
memheap.h
portab.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/matroska2/include/corec
)
\ No newline at end of file
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec
)
install(FILES array/array.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/array)
install(FILES helpers/charconvert/charconvert.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/helpers/charconvert)
install(FILES helpers/date/date.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/helpers/date)
install(FILES helpers/file/file.h
helpers/file/streams.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/helpers/file
)
install(FILES helpers/md5/md5.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/helpers/md5)
install(FILES helpers/parser/buffer.h
helpers/parser/dataheap.h
helpers/parser/hotkey.h
helpers/parser/nodelookup.h
helpers/parser/parser.h
helpers/parser/strtab.h
helpers/parser/strtypes.h
helpers/parser/urlpart.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/helpers/parser
)
install(FILES helpers/system/ccsystem.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/helpers/system)
install(FILES multithread/multithread.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/multithread)
install(FILES node/node.h
node/node_internal.h
node/nodebase.h
node/nodetools.h
node/nodetree.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/node
)
install(FILES str/str.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/corec/str)
\ No newline at end of file
......@@ -10,6 +10,12 @@ add_library(ebml2 STATIC
ebmlvoid.c
)
target_link_libraries(ebml2 corec)
install(TARGETS ebml2
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
install(DIRECTORY ebml
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/matroska2/include
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
\ No newline at end of file
......@@ -9,12 +9,10 @@ target_include_directories(matroska2
PUBLIC ${CMAKE_SOURCE_DIR}/libmatroska2
)
target_link_libraries(matroska2 ebml2 corec)
install(DIRECTORY matroska
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
install(TARGETS matroska2
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
\ No newline at end of file
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment