aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: b9dc7f79b1bfca850d380e6d623d1daaaf499d21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
include_directories(
	${CMAKE_SOURCE_DIR}/include
	${CMAKE_BINARY_DIR}/include
)

add_executable(spm spm.c config.c compat.c deps.c fs.c rpath.c find.c shell.c archive.c str.c relocation.c install.c config_global.c manifest.c checksum.c extern/url.c version_spec.c spm_build.c mime.c internal_cmd.c environment.c mirrors.c strlist.c shlib.c)

target_link_libraries(spm crypto ssl curl)
if (LINUX)
	target_link_libraries(spm rt)
endif()

if(MSVC)
	target_compile_options(spm PRIVATE /W4 /WX)
else()
	target_compile_options(spm PRIVATE -Wall -Wextra)
endif()

install(
	TARGETS spm
	DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(
	FILES
		${CMAKE_BINARY_DIR}/include/config.h
		${CMAKE_SOURCE_DIR}/include/spm.h
	DESTINATION "${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}"
)