Build libpakrd with cmake instead of using it as prebuilt library
This commit is contained in:
1 parent
c5dd826c66
commit
2de3e9b4df
12 files changed
+442
-15
No files matched your search
@@ -0,0 +1,46 @@
|
||||
cmake_minimum_required(VERSION 3.17)
|
||||
|
||||
project(pakrd)
|
||||
|
||||
# VARIABLES
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
# Export both *.lib and *.dll on Windows
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../lib")
|
||||
|
||||
# TARGETS
|
||||
add_library(${PROJECT_NAME} SHARED
|
||||
src/cpath.c
|
||||
src/darr.c
|
||||
src/io.c
|
||||
src/pak.c
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
include
|
||||
../../include/
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC SDL2)
|
||||
|
||||
install(FILES
|
||||
include/cpath.h
|
||||
include/darr.h
|
||||
include/io.h
|
||||
include/pak.h
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
CONFIGURATIONS Release
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
Reference in new issue
Block a user