cmake_minimum_required(VERSION 3.21) project(Heload) # I just like to have this with my tooling set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_C_STANDARD 11) # heload library # ############## add_library(heload SHARED src/heload.c src/symbols.c ) set_property(TARGET heload PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(heload dl) # Specify the public headers location target_include_directories(heload PUBLIC $ # During build $ # When installed ) install(TARGETS heload EXPORT heloadTargets ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) # Install header files install(DIRECTORY include/ DESTINATION include) # Export the library for find_package() install(EXPORT heloadTargets FILE heloadConfig.cmake DESTINATION lib/cmake/heload ) export(TARGETS heload FILE heloadConfig.cmake) # auditor libraries # ############### add_library(auditor-x86_64 SHARED src/auditor/auditor-x86_64.c ) install(TARGETS auditor-x86_64 EXPORT auditor-x86_64Targets ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin )