-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
43 lines (33 loc) · 1.25 KB
/
CMakeLists.txt
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
37
38
39
40
41
42
43
cmake_minimum_required(VERSION 3.6)
project(kristvanity)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
# Taken from: https://cmake.org/pipermail/cmake/2013-November/056336.html
macro(group_sources curdir)
file(GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir} ${PROJECT_SOURCE_DIR}/${curdir}/*)
foreach(child ${children})
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child})
group_sources(${curdir}/${child})
else()
string(REPLACE "/" "\\" groupname ${curdir})
source_group(${groupname} FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child})
endif()
endforeach()
endmacro()
group_sources("src")
group_sources("include")
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp")
add_executable(kristvanity ${SOURCE_FILES})
find_package(OpenSSL REQUIRED)
if (OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
target_link_libraries(kristvanity ${OPENSSL_CRYPTO_LIBRARY})
endif()
find_package(Threads REQUIRED)
target_link_libraries(kristvanity ${CMAKE_THREAD_LIBS_INIT})
find_package(TCLAP REQUIRED)
if (TCLAP_FOUND)
include_directories(${TCLAP_INCLUDE_DIR})
endif()
install(TARGETS kristvanity RUNTIME DESTINATION bin)