Skip to content

Commit 442aff3

Browse files
Merge branch 'aous72:master' into feature/add-openexr-support
2 parents 35dc9d1 + 3181392 commit 442aff3

File tree

7 files changed

+27
-23
lines changed

7 files changed

+27
-23
lines changed

CMakeLists.txt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,24 @@ endif()
172172

173173
include(GNUInstallDirs)
174174

175-
install(EXPORT openjph-config
175+
install(EXPORT openjph-targets
176176
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
177177
)
178178

179-
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
180-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
179+
include(CMakePackageConfigHelpers)
180+
181+
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/src/openjph-config.cmake.in
182+
"${CMAKE_CURRENT_BINARY_DIR}/openjph-config.cmake"
183+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
184+
)
185+
186+
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
187+
COMPATIBILITY SameMinorVersion)
188+
189+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openjph-config.cmake
190+
${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
191+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
192+
)
181193

182194
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
183195
set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
@@ -192,21 +204,15 @@ else()
192204
endif()
193205

194206
configure_file(
195-
"${CMAKE_CURRENT_SOURCE_DIR}/src/pkg-config.pc.cmake"
207+
"${CMAKE_CURRENT_SOURCE_DIR}/src/openjph.pc.in"
196208
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
197209
@ONLY
198210
)
199211

200-
include(CMakePackageConfigHelpers)
201-
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
202-
COMPATIBILITY SameMinorVersion)
203-
204-
install(
205-
FILES ${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
206-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
212+
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
213+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
207214
)
208215

209-
210216
################################################################################################
211217
# Testing (OJPH_BUILD_TESTS)
212218
################################################################################################
@@ -215,4 +221,3 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND OJPH_BUILD_TESTS)
215221
enable_testing()
216222
add_subdirectory(tests)
217223
endif()
218-

src/apps/ojph_compress/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,4 @@ target_link_libraries(ojph_compress PRIVATE openjph
105105
# ZLIB for OpenEXR 2.x:
106106
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
107107

108-
install(TARGETS ojph_compress
109-
EXPORT openjph-config
110-
)
108+
install(TARGETS ojph_compress)

src/apps/ojph_expand/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,4 @@ target_link_libraries(ojph_expand PRIVATE openjph
105105
# ZLIB for OpenEXR 2.x:
106106
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
107107

108-
install(TARGETS ojph_expand
109-
EXPORT openjph-config
110-
)
108+
install(TARGETS ojph_expand)

src/apps/ojph_stream_expand/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,4 @@ else()
2323
target_link_libraries(ojph_stream_expand PUBLIC openjph pthread)
2424
endif(MSVC)
2525

26-
install(TARGETS ojph_stream_expand
27-
EXPORT openjph-config
28-
)
26+
install(TARGETS ojph_stream_expand)

src/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ else()
139139
endif()
140140

141141
install(TARGETS openjph
142-
EXPORT openjph-config
142+
EXPORT openjph-targets
143143
)
144144

145145
install(DIRECTORY common/

src/openjph-config.cmake.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@PACKAGE_INIT@
2+
3+
include("${CMAKE_CURRENT_LIST_DIR}/openjph-targets.cmake")
4+
5+
check_required_components(openjph)
File renamed without changes.

0 commit comments

Comments
 (0)