Skip to content

Commit

Permalink
Fix package installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Oct 28, 2023
1 parent 380a93e commit ec4b215
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions out/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ endif()

project(phnt VERSION 3.0)

add_library(phnt_headers INTERFACE)
add_library(${PROJECT_NAME}::headers ALIAS phnt_headers)
target_include_directories(phnt_headers SYSTEM INTERFACE
if(PROJECT_IS_TOP_LEVEL)
set(tgt_headers headers)
else()
set(tgt_headers phnt_headers)
endif()

add_library(${tgt_headers} INTERFACE)
add_library(${PROJECT_NAME}::headers ALIAS ${tgt_headers})
target_include_directories(${tgt_headers} SYSTEM INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
)
target_include_directories(phnt_headers INTERFACE
target_include_directories(${tgt_headers} INTERFACE
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>
)

Expand All @@ -36,7 +42,7 @@ if(PROJECT_IS_TOP_LEVEL)
install(
TARGETS
phnt
phnt_headers
${tgt_headers}
EXPORT
${PROJECT_NAME}_Targets
ARCHIVE
Expand Down
2 changes: 1 addition & 1 deletion test/test_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern int EntryPoint(PPEB peb)
NULL,
&IoStatusBlock,
message,
strlen(message) - 1,
sizeof(message) - 1,
NULL,
NULL
);
Expand Down

0 comments on commit ec4b215

Please sign in to comment.