Skip to content

Commit

Permalink
Add CMake option to disable installation of headers and libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
kodemeister authored and cgutman committed Sep 21, 2023
1 parent 880e41f commit bbfe93c
Showing 1 changed file with 10 additions and 6 deletions.
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()

0 comments on commit bbfe93c

Please sign in to comment.