adjust cmake file
This commit is contained in:
parent
2db6d14216
commit
b9411fa714
1 changed files with 32 additions and 5 deletions
|
@ -9,14 +9,41 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
# Add source files
|
# Add source files
|
||||||
file(GLOB SOURCES "src/utils/*.cpp" "src/types/*.cpp" "src/nbt/*.cpp")
|
file(GLOB SOURCES "src/utils/*.cpp" "src/types/*.cpp" "src/nbt/*.cpp")
|
||||||
file(GLOB HEADERS "src/utils/*.h" "src/types/*.h" "src/nbt/*.h")
|
|
||||||
|
|
||||||
# Add an shared library target
|
# Collect header files by directory
|
||||||
|
file(GLOB UTIL_HEADERS "src/utils/*.h")
|
||||||
|
file(GLOB TYPE_HEADERS "src/types/*.h")
|
||||||
|
file(GLOB NBT_HEADERS "src/nbt/*.h")
|
||||||
|
|
||||||
|
# Add a shared library target
|
||||||
add_library(ac SHARED ${SOURCES})
|
add_library(ac SHARED ${SOURCES})
|
||||||
|
|
||||||
# Optionally, if you have any additional include directories or libraries, add them here:
|
# Set properties for the library
|
||||||
|
set_target_properties(ac PROPERTIES
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
SOVERSION 1
|
||||||
|
PUBLIC_HEADER "${UTIL_HEADERS};${TYPE_HEADERS};${NBT_HEADERS}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Optionally, add include directories if needed
|
||||||
# target_include_directories(ac PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
# target_include_directories(ac PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
# Optionally, link to other libraries if needed
|
||||||
# target_link_libraries(ac PRIVATE some_library)
|
# target_link_libraries(ac PRIVATE some_library)
|
||||||
|
|
||||||
install(TARGETS ac LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
# Install targets
|
||||||
install(TARGETS ac PUBLIC_HEADER ${CMAKE_INSTALL_INCLUDEDIR}/libac)
|
install(TARGETS ac
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libac
|
||||||
|
)
|
||||||
|
|
||||||
|
# Install headers into specific directories
|
||||||
|
install(FILES ${UTIL_HEADERS}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libac/util
|
||||||
|
)
|
||||||
|
install(FILES ${TYPE_HEADERS}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libac/types
|
||||||
|
)
|
||||||
|
install(FILES ${NBT_HEADERS}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libac/nbt
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue