30 lines
883 B
CMake
30 lines
883 B
CMake
cmake_minimum_required(VERSION 3.18..3.28)
|
|
project(ReArchive)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp")
|
|
file(GLOB_RECURSE SOURCES "src/*.c" "src/*.cpp")
|
|
|
|
if(UNIX)
|
|
add_library(ReArchive SHARED ${SOURCES})
|
|
endif()
|
|
|
|
if(WIN32)
|
|
add_library(ReArchive STATIC ${SOURCES})
|
|
endif()
|
|
|
|
set_target_properties(ReArchive PROPERTIES LINKER_LANGUAGE CXX)
|
|
target_include_directories(ReArchive PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
|
|
|
add_executable(rsarchive main.cpp)
|
|
target_link_libraries(rsarchive PUBLIC ReArchive)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the build type" FORCE)
|
|
endif()
|
|
|
|
include(GNUInstallDirs)
|
|
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install path prefix" FORCE)
|
|
install(TARGETS ReArchive DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
install(TARGETS rsarchive DESTINATION ${CMAKE_INSTALL_BINDIR}) |