aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: 623ea68a7c3a8c1a8e52e15897c70de47b1ec946 (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
29
30
31
32
33
34
35
36
include_directories(
	${CMAKE_SOURCE_DIR}/include
	${CMAKE_BINARY_DIR}/include
	${OpenSSL_INCLUDE_DIRS}
	${CURL_INCLUDE_DIRS}
)

add_executable(spm
	spm.c
)

target_link_directories(spm PUBLIC ${OpenSSL_LIBRARY_DIRS} ${CURL_LIBRARY_DIRS})
target_link_libraries(spm libspm ${OpenSSL_LIBRARIES} ${CURL_LIBRARIES})

## Uncomment to build a scratch executable (i.e. for quick library development / verification)
#add_executable(spm_scratch
#	scratch.c
#)
#
#target_link_directories(spm_scratch PUBLIC ${OpenSSL_LIBRARY_DIRS} ${CURL_LIBRARY_DIRS})
#target_link_libraries(spm_scratch libspm ${OpenSSL_LIBRARIES} ${CURL_LIBRARIES})

if (LINUX)
	target_link_libraries(spm libspm rt)
endif()

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

install(
	TARGETS spm
	DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)