Commit 0629df2d authored by Ghislain MARY's avatar Ghislain MARY

Some CMake improvements.

parent 4c870ec4
......@@ -38,6 +38,11 @@ option(CONFIG_DEBUG_LEAKS "Enable internal menory leaks checking support" OFF)
include(GNUInstallDirs)
if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}")
endif()
configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
include_directories(
......@@ -45,10 +50,6 @@ include_directories(
corec
)
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
add_compile_options(-fPIC)
endif()
add_compile_options(-w)
add_subdirectory(corec/corec)
......@@ -75,7 +76,7 @@ configure_file(Matroska2Config.cmake.in
@ONLY
)
set(CONFIG_PACKAGE_LOCATION "share/${PROJECT_NAME}/cmake")
set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake")
install(EXPORT Matroska2Targets
FILE Matroska2Targets.cmake
DESTINATION ${CONFIG_PACKAGE_LOCATION}
......
......@@ -81,6 +81,7 @@ if(CONFIG_STDIO)
endif()
add_library(corec-objects OBJECT ${COREC_SOURCES})
set_target_properties(corec-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
install(FILES
banned.h
......
......@@ -31,6 +31,7 @@ add_library(ebml2-objects OBJECT
ebmldate.c
ebmlvoid.c
)
set_target_properties(ebml2-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
install(DIRECTORY ebml
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
......
......@@ -25,6 +25,7 @@ add_library(matroska2-objects OBJECT
matroskablock.c
matroska_sem.c
)
set_target_properties(matroska2-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
target_include_directories(matroska2-objects PRIVATE ../libebml2 .)
if(ENABLE_STATIC)
......
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