Skip to content

Commit 50cdb9e

Browse files
committed
Add relative includes
1 parent 1b20dbc commit 50cdb9e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,16 @@ endif()
149149

150150
include(GNUInstallDirs)
151151
install(TARGETS openjph
152+
EXPORT openjph_targets
152153
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
153154
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
154155
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
155156

157+
install(EXPORT openjph_targets
158+
FILE openjph_targets.cmake
159+
DESTINATION lib/cmake/openjph
160+
)
161+
156162
install(DIRECTORY src/core/common/
157163
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openjph
158164
FILES_MATCHING

src/core/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ if(EMSCRIPTEN)
3838
add_library(openjph ${SOURCES})
3939
add_library(openjphsimd ${SOURCES} ${CODESTREAM_WASM} ${CODING_WASM} ${TRANSFORM_WASM})
4040

41-
target_include_directories(openjph PUBLIC common)
42-
target_include_directories(openjphsimd PUBLIC common)
41+
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}common> $<INSTALL_INTERFACE:include>)
42+
target_include_directories(openjphsimd PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}common> $<INSTALL_INTERFACE:include>)
4343

4444
target_compile_options(openjphsimd PRIVATE -DOJPH_ENABLE_WASM_SIMD -msimd128)
4545

@@ -124,7 +124,7 @@ if (BUILD_SHARED_LIBS AND WIN32)
124124
endif()
125125

126126
## include library version/name
127-
target_include_directories(openjph PUBLIC common)
127+
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common> $<INSTALL_INTERFACE:include>)
128128
target_compile_definitions(openjph PUBLIC _FILE_OFFSET_BITS=64)
129129

130130
if (MSVC)

0 commit comments

Comments
 (0)