Issue #94: New directory structure

This commit is contained in:
Jakub Melka 2023-09-23 18:07:38 +02:00
parent 07c2a476a0
commit 9b33b3a4a5
13 changed files with 81 additions and 24 deletions

View File

@ -80,6 +80,26 @@ if (LINUX_GCC)
find_package(TBB REQUIRED)
endif()
option(PDF4QT_INSTALL_TO_USR "Install to usr directory" OFF)
if(PDF4QT_LINUX)
set(PDF4QT_INSTALL_LIB_DIR_IMPL lib)
set(PDF4QT_INSTALL_BIN_DIR_IMPL bin)
else()
set(PDF4QT_INSTALL_LIB_DIR_IMPL bin)
set(PDF4QT_INSTALL_BIN_DIR_IMPL bin)
endif()
if(PDF4QT_INSTALL_TO_USR)
set(PDF4QT_INSTALL_LIB_DIR usr/${PDF4QT_INSTALL_LIB_DIR_IMPL})
set(PDF4QT_INSTALL_BIN_DIR usr/${PDF4QT_INSTALL_BIN_DIR_IMPL})
set(PDF4QT_INSTALL_SHARE_DIR usr/share)
else()
set(PDF4QT_INSTALL_LIB_DIR ${PDF4QT_INSTALL_LIB_DIR_IMPL})
set(PDF4QT_INSTALL_BIN_DIR ${PDF4QT_INSTALL_BIN_DIR_IMPL})
set(PDF4QT_INSTALL_SHARE_DIR share)
endif()
add_subdirectory(Pdf4QtLib)
add_subdirectory(CodeGenerator)
add_subdirectory(JBIG2_Viewer)
@ -97,16 +117,16 @@ add_subdirectory(WixInstaller)
message("CMAKE_PREFIX_PATH = " ${CMAKE_PREFIX_PATH})
message("CMAKE_TOOLCHAIN_FILE = " ${CMAKE_TOOLCHAIN_FILE})
install(FILES Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocDiff.desktop Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocPageOrganizer.desktop Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtViewerLite.desktop Desktop/io.github.JakubMelka.Pdf4qt.desktop DESTINATION share/applications)
install(FILES Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocDiff.svg Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocPageOrganizer.svg Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtViewerLite.svg Desktop/io.github.JakubMelka.Pdf4qt.svg DESTINATION share/icons/hicolor/scalable/apps)
install(FILES Desktop/io.github.JakubMelka.Pdf4qt.appdata.xml DESTINATION share/metainfo)
install(FILES Desktop/128x128/io.github.JakubMelka.Pdf4qt.Pdf4QtDocDiff.png Desktop/128x128/io.github.JakubMelka.Pdf4qt.Pdf4QtDocPageOrganizer.png Desktop/128x128/io.github.JakubMelka.Pdf4qt.Pdf4QtViewerLite.png Desktop/128x128/io.github.JakubMelka.Pdf4qt.png DESTINATION share/icons/hicolor/128x128/apps)
install(FILES Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocDiff.desktop Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocPageOrganizer.desktop Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtViewerLite.desktop Desktop/io.github.JakubMelka.Pdf4qt.desktop DESTINATION ${PDF4QT_INSTALL_SHARE_DIR}/applications)
install(FILES Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocDiff.svg Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtDocPageOrganizer.svg Desktop/io.github.JakubMelka.Pdf4qt.Pdf4QtViewerLite.svg Desktop/io.github.JakubMelka.Pdf4qt.svg DESTINATION ${PDF4QT_INSTALL_SHARE_DIR}/icons/hicolor/scalable/apps)
install(FILES Desktop/io.github.JakubMelka.Pdf4qt.appdata.xml DESTINATION ${PDF4QT_INSTALL_SHARE_DIR}/metainfo)
install(FILES Desktop/128x128/io.github.JakubMelka.Pdf4qt.Pdf4QtDocDiff.png Desktop/128x128/io.github.JakubMelka.Pdf4qt.Pdf4QtDocPageOrganizer.png Desktop/128x128/io.github.JakubMelka.Pdf4qt.Pdf4QtViewerLite.png Desktop/128x128/io.github.JakubMelka.Pdf4qt.png DESTINATION ${PDF4QT_INSTALL_SHARE_DIR}/icons/hicolor/128x128/apps)
configure_file(make-package.sh.in make-package.sh)
if(PDF4QT_INSTALL_DEPENDENCIES)
install(DIRECTORY ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin/
TYPE BIN
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.so"
@ -119,14 +139,14 @@ if(PDF4QT_INSTALL_DEPENDENCIES)
if(PDF4QT_INSTALL_QT_DEPENDENCIES)
install(DIRECTORY ${PDF4QT_QT_ROOT}/bin/
RUNTIME DESTINATION bin/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/
FILES_MATCHING
REGEX "(Qt6Core|Qt6Gui|Qt6PrintSupport|Qt6Svg|Qt6TextToSpeech|Qt6Widgets|Qt6Xml|Qt6OpenGL|Qt6OpenGLWidgets|Qt6Multimedia|Qt6Network)\\..*"
PATTERN "Debug" EXCLUDE
)
install(DIRECTORY ${PDF4QT_QT_ROOT}/plugins/platforms/
RUNTIME DESTINATION bin/platforms/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/platforms/
FILES_MATCHING
PATTERN "qwindows.dll"
PATTERN "*.so"
@ -134,13 +154,13 @@ if(PDF4QT_INSTALL_DEPENDENCIES)
)
install(DIRECTORY ${PDF4QT_QT_ROOT}/plugins/iconengines/
RUNTIME DESTINATION bin/iconengines/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/iconengines/
FILES_MATCHING
REGEX "qsvgicon\\..*"
)
install(DIRECTORY ${PDF4QT_QT_ROOT}/plugins/imageformats/
RUNTIME DESTINATION bin/imageformats/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/imageformats/
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.so"
@ -149,7 +169,7 @@ if(PDF4QT_INSTALL_DEPENDENCIES)
)
install(DIRECTORY ${PDF4QT_QT_ROOT}/plugins/styles/
RUNTIME DESTINATION bin/styles/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/styles/
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.so"
@ -158,7 +178,7 @@ if(PDF4QT_INSTALL_DEPENDENCIES)
)
install(DIRECTORY ${PDF4QT_QT_ROOT}/plugins/texttospeech/
RUNTIME DESTINATION bin/texttospeech/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/texttospeech/
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.so"
@ -172,7 +192,7 @@ if(PDF4QT_INSTALL_DEPENDENCIES)
message(STATUS "MSVC Redistributable Package Path = ${MSVC_REDISTRIBUTABLES_PATH}")
install(DIRECTORY ${MSVC_REDISTRIBUTABLES_PATH}/
RUNTIME DESTINATION bin/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/
FILES_MATCHING
PATTERN "*.dll"
)

View File

@ -19,7 +19,7 @@ add_executable(CodeGenerator
codegenerator.cpp
main.cpp
generatormainwindow.cpp
generatormainwindow.ui
generatormainwindow.ui
)
target_link_libraries(CodeGenerator PRIVATE Pdf4QtLib Qt6::Core Qt6::Widgets Qt6::Gui Qt6::Xml)
@ -27,4 +27,6 @@ target_link_libraries(CodeGenerator PRIVATE Pdf4QtLib Qt6::Core Qt6::Widgets Qt6
set_target_properties(CodeGenerator PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)

View File

@ -26,4 +26,6 @@ target_link_libraries(JBIG2_VIEWER PRIVATE Pdf4QtLib Qt6::Core Qt6::Widgets Qt6:
set_target_properties(JBIG2_VIEWER PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)

View File

@ -35,6 +35,8 @@ target_link_libraries(Pdf4QtDocDiff PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Wi
set_target_properties(Pdf4QtDocDiff PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)
install(TARGETS Pdf4QtDocDiff)
install(TARGETS Pdf4QtDocDiff RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} LIBRARY DESTINATION ${PDF4QT_INSTALL_LIB_DIR})

View File

@ -36,6 +36,8 @@ target_link_libraries(Pdf4QtDocPageOrganizer PRIVATE Pdf4QtLib Qt6::Core Qt6::Gu
set_target_properties(Pdf4QtDocPageOrganizer PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)
install(TARGETS Pdf4QtDocPageOrganizer)
install(TARGETS Pdf4QtDocPageOrganizer RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} LIBRARY DESTINATION ${PDF4QT_INSTALL_LIB_DIR})

View File

@ -131,6 +131,8 @@ target_include_directories(Pdf4QtLib PUBLIC ${CMAKE_BINARY_DIR}/${INSTALL_INCLUD
set_target_properties(Pdf4QtLib PROPERTIES
VERSION ${PDF4QT_VERSION}
SOVERSION ${PDF4QT_VERSION})
SOVERSION ${PDF4QT_VERSION}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR})
install(TARGETS Pdf4QtLib)
install(TARGETS Pdf4QtLib RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} LIBRARY DESTINATION ${PDF4QT_INSTALL_LIB_DIR})

View File

@ -65,6 +65,8 @@ target_include_directories(Pdf4QtViewer PUBLIC ${CMAKE_BINARY_DIR}/${INSTALL_INC
set_target_properties(Pdf4QtLib PROPERTIES
VERSION ${PDF4QT_VERSION}
SOVERSION ${PDF4QT_VERSION})
SOVERSION ${PDF4QT_VERSION}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR})
install(TARGETS Pdf4QtViewer)
install(TARGETS Pdf4QtViewer RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} LIBRARY DESTINATION ${PDF4QT_INSTALL_LIB_DIR})

View File

@ -25,6 +25,8 @@ target_link_libraries(Pdf4QtViewerLite PRIVATE Pdf4QtLib Pdf4QtViewer Qt6::Core
set_target_properties(Pdf4QtViewerLite PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)
install(TARGETS Pdf4QtViewerLite)
install(TARGETS Pdf4QtViewerLite RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} LIBRARY DESTINATION ${PDF4QT_INSTALL_LIB_DIR})

View File

@ -16,9 +16,9 @@
# along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
if(PDF4QT_LINUX)
set(PDF4QT_PLUGINS_DIR lib/pdf4qt)
set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdf4qt)
else()
set(PDF4QT_PLUGINS_DIR bin/pdfplugins)
set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdfplugins)
endif()
add_subdirectory(AudioBookPlugin)

View File

@ -25,6 +25,8 @@ target_link_libraries(Pdf4QtViewerProfi PRIVATE Pdf4QtLib Pdf4QtViewer Qt6::Core
set_target_properties(Pdf4QtViewerProfi PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)
install(TARGETS Pdf4QtViewerProfi)
install(TARGETS Pdf4QtViewerProfi RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} LIBRARY DESTINATION ${PDF4QT_INSTALL_LIB_DIR})

View File

@ -21,3 +21,10 @@ add_executable(PdfExampleGenerator
)
target_link_libraries(PdfExampleGenerator PRIVATE Pdf4QtLib Qt6::Core Qt6::Widgets Qt6::Gui)
set_target_properties(PdfExampleGenerator PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)

View File

@ -52,4 +52,11 @@ if(MINGW)
target_link_libraries(PdfTool PRIVATE ole32 sapi)
endif()
install(TARGETS PdfTool)
set_target_properties(PdfTool PROPERTIES
WIN32_EXECUTABLE OFF
MACOSX_BUNDLE OFF
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)
install(TARGETS PdfTool RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} LIBRARY DESTINATION ${PDF4QT_INSTALL_LIB_DIR})

View File

@ -20,3 +20,10 @@ add_executable(UnitTests
)
target_link_libraries(UnitTests PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Test)
set_target_properties(UnitTests PROPERTIES
WIN32_EXECUTABLE OFF
MACOSX_BUNDLE OFF
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}
)