Skip to content

Commit

Permalink
Install inconveniences (#196)
Browse files Browse the repository at this point in the history
* exclude tests when included

* add component to includes install, to match the libs install, otherwise they are not copied on component install

* nl

* and lets make it a release
  • Loading branch information
galkahana authored Feb 20, 2023
1 parent 1cd3842 commit 32abca4
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 15 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15)
# Soname
# MAJOR is incremented when symbols are removed or changed in an incompatible way
# MINOR is incremented when new symbols are added
project(PDFHummus VERSION 4.5.2)
project(PDFHummus VERSION 4.5.3)


option(USE_BUNDLED "Whether to use bundled libraries" TRUE)
Expand Down Expand Up @@ -153,9 +153,13 @@ endif(NOT USE_BUNDLED)

ADD_SUBDIRECTORY(PDFWriter)

enable_testing()
ADD_SUBDIRECTORY(PDFWriterTesting)

if(PROJECT_IS_TOP_LEVEL)
# avoid installing the testing lib altogether when included in another project.
# it's annoying when in parent all, and more annoying to then get the tests added
# to the parent project ctest.
enable_testing()
ADD_SUBDIRECTORY(PDFWriterTesting)
endif(PROJECT_IS_TOP_LEVEL)

include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
Expand Down
3 changes: 2 additions & 1 deletion FreeType/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ install(TARGETS FreeType
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
DESTINATION include/FreeType
COMPONENT dependencies
FILES_MATCHING
PATTERN "*.h"
)
)
3 changes: 2 additions & 1 deletion LibAesgm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ install(TARGETS LibAesgm
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
COMPONENT dependencies
FILES_MATCHING
PATTERN "*.h"
)
)
3 changes: 2 additions & 1 deletion LibJpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ install(TARGETS LibJpeg
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
COMPONENT dependencies
FILES_MATCHING
PATTERN "*.h"
)
)
1 change: 1 addition & 0 deletions LibPng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ install(TARGETS LibPng
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
COMPONENT dependencies
FILES_MATCHING
PATTERN "*.h"
)
3 changes: 2 additions & 1 deletion LibTiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ install(TARGETS LibTiff
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
COMPONENT dependencies
FILES_MATCHING
PATTERN "*.h"
)
)
1 change: 1 addition & 0 deletions PDFWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ install(TARGETS PDFWriter

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
COMPONENT libraries
FILES_MATCHING
PATTERN "*.h"
)
Expand Down
6 changes: 0 additions & 6 deletions PDFWriterTesting/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ add_executable (PDFWriterTesting
PDFCommentWriter.cpp
)

# (adding to all target only if project is built independently, so that FetchContent imports that build from source
# wont build this unnecessary step unless asked for explicitly)
set_target_properties(PDFWriterTesting
PROPERTIES EXCLUDE_FROM_ALL $<NOT:$<BOOL:${PROJECT_IS_TOP_LEVEL}>>
)

target_link_libraries (PDFWriterTesting PDFWriter)

if(APPLE)
Expand Down
3 changes: 2 additions & 1 deletion ZLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ install(TARGETS Zlib
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
COMPONENT dependencies
FILES_MATCHING
PATTERN "*.h"
)
)

0 comments on commit 32abca4

Please sign in to comment.