-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more info in pc template & cmake compatibility #132
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ target_link_libraries(prime_proxyd prime_server ${CMAKE_THREAD_LIBS_INIT}) | |
add_executable(prime_workerd ${CMAKE_SOURCE_DIR}/src/prime_workerd.cpp) | ||
target_link_libraries(prime_workerd prime_server ${CMAKE_THREAD_LIBS_INIT}) | ||
|
||
# TODO(nils): AFAIU the project version shouldn't be the SO version | ||
set_target_properties(prime_server PROPERTIES | ||
PUBLIC_HEADER "${PRIME_LIBRARY_HEADERS}" | ||
SOVERSION ${PROJECT_VERSION_MAJOR} | ||
|
@@ -128,12 +129,22 @@ install(TARGETS prime_echod | |
prime_proxyd | ||
prime_workerd DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
CONFIGURE_FILE( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/libprime_server.pc.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/libprime_server.pc" | ||
# pkg-config stuff, also make it compatible with autotools | ||
set(prefix ${CMAKE_INSTALL_PREFIX}) | ||
set(exec_prefix ${prefix}) | ||
set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR}) | ||
set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/libprime_server.pc.in | ||
${CMAKE_CURRENT_BINARY_DIR}/libprime_server.pc | ||
@ONLY) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libprime_server.pc" DESTINATION ${pkgconfigdir}) | ||
|
||
# uninstall target | ||
configure_file(cmake/uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/prime_server_uninstall.cmake @ONLY) | ||
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/prime_server_uninstall.cmake) | ||
Comment on lines
+145
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as in the valhalla PR valhalla/valhalla#4516 |
||
|
||
# Add tests - Requires CTest | ||
enable_testing() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# from https://github.com/OSGeo/PROJ/blob/5920e2998318189970c0fe1e2db60f643515b9ea/cmake/uninstall.cmake.in | ||
|
||
# install_manifest.txt is created in the top build tree, not the project one | ||
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") | ||
endif() | ||
|
||
set(uninstall_file_list "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest_extra.txt") | ||
list(APPEND uninstall_file_list "@CMAKE_CURRENT_BINARY_DIR@/install_manifest_extra.txt") | ||
endif() | ||
|
||
set(dir_list) | ||
foreach (manifest_file IN ITEMS ${uninstall_file_list}) | ||
file(READ "${manifest_file}" files) | ||
string(REGEX REPLACE "\n$" "" files "${files}") | ||
string(REGEX REPLACE "\n" ";" files "${files}") | ||
list(REVERSE files) | ||
foreach (file ${files}) | ||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") | ||
if (IS_DIRECTORY "$ENV{DESTDIR}${file}") | ||
list(APPEND dir_list "${file}") | ||
elseif (EXISTS "$ENV{DESTDIR}${file}") | ||
get_filename_component(dir "${file}" DIRECTORY) | ||
list(APPEND dir_list "${dir}") | ||
execute_process( | ||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" | ||
OUTPUT_VARIABLE rm_out | ||
RESULT_VARIABLE rm_retval | ||
) | ||
if(NOT ${rm_retval} EQUAL 0) | ||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") | ||
endif (NOT ${rm_retval} EQUAL 0) | ||
else () | ||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") | ||
endif () | ||
endforeach(file) | ||
endforeach() | ||
|
||
while(NOT "${dir_list}" STREQUAL "") | ||
list(REMOVE_DUPLICATES dir_list) | ||
set(new_dir_list) | ||
foreach (file IN ITEMS ${dir_list}) | ||
if (IS_DIRECTORY "$ENV{DESTDIR}${file}" AND "${file}" MATCHES "@CMAKE_INSTALL_PREFIX@[/\\].+") | ||
file(GLOB file_list "$ENV{DESTDIR}${file}/*") | ||
list(LENGTH file_list file_list_len) | ||
# Only remove empty directories | ||
if(file_list_len EQUAL 0) | ||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") | ||
execute_process( | ||
COMMAND @CMAKE_COMMAND@ -E remove_directory "$ENV{DESTDIR}${file}" | ||
OUTPUT_VARIABLE rm_out | ||
RESULT_VARIABLE rm_retval | ||
) | ||
if(${rm_retval} EQUAL 0) | ||
get_filename_component(upper_dir "${file}" DIRECTORY) | ||
list(APPEND new_dir_list "${upper_dir}") | ||
else() | ||
message(STATUS "Problem when removing directory \"$ENV{DESTDIR}${file}\"") | ||
endif() | ||
endif() | ||
endif() | ||
endforeach() | ||
set(dir_list "${new_dir_list}") | ||
endwhile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the paths weren't set up in a cmake installation