Skip to content

Commit

Permalink
Add install option for cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
rainhard committed Nov 29, 2024
1 parent 9cfda2f commit f2d9a39
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

project(
photon
VERSION 0.7
VERSION 0.8
LANGUAGES C CXX ASM
)

Expand Down Expand Up @@ -390,3 +390,16 @@ if (PHOTON_BUILD_TESTING)
endif ()
GenerateStandaloneCTestScript(${CMAKE_SOURCE_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CTestTestfile.cmake)
endif ()

################################################################################

# Install headers and libs
add_custom_target(copy_includes ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include
COMMENT "Copying include files to build directory: ${PROJECT_BINARY_DIR}/include"
)
add_dependencies(copy_includes photon_static)

install(DIRECTORY ${PROJECT_BINARY_DIR}/include/ DESTINATION include)
install(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libphoton.a DESTINATION lib)
install(PROGRAMS ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libphoton.so DESTINATION lib)

0 comments on commit f2d9a39

Please sign in to comment.