Skip to content
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

Add CMake option to disable installation of headers and libraries #11

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8.12...3.20)

project(enet)

option(ENET_NO_INSTALL "Disable installation of headers and libraries" OFF)

# The "configure" step.
include(CheckFunctionExists)
include(CheckStructHasMember)
Expand Down Expand Up @@ -108,10 +110,12 @@ if (MINGW)
target_link_libraries(enet winmm ws2_32)
endif()

install(TARGETS enet
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib/static
LIBRARY DESTINATION lib)
if(NOT ENET_NO_INSTALL)
install(TARGETS enet
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib/static
LIBRARY DESTINATION lib)

install(DIRECTORY include/
DESTINATION include)
install(DIRECTORY include/
DESTINATION include)
endif()