-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (40 loc) · 1.28 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
44
45
46
47
48
49
cmake_minimum_required (VERSION 3.12)
project("EasyProtobufferReflex")
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
option(BUILD_SHARED_LIBS "Build shared libs" false)
# conan profile
set(CONAN_PROFILE CACHE STRING "default")
# conanfile.txt file
set(CONANFILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/conanfile.txt")
# conan install command
set(CONAN_INSTALL_COMMAND "conan install ${CONANFILE_PATH} -pr ${CONAN_PROFILE} --build=missing --output-folder=${CMAKE_BINARY_DIR} --build=missing")
# run conan install
if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan_toolchain.cmake")
message("Running conan install... Please wait")
execute_process(
COMMAND powershell
${CONAN_INSTALL_COMMAND}
OUTPUT_VARIABLE FOO
RESULT_VARIABLE FOOR
ERROR_VARIABLE FOO_ER
)
message("conan install finished")
message(${FOO_ER})
endif()
include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies.cmake)
include(GenerateExportHeader)
# include your folders
#add_subdirectory("app")
add_subdirectory("ProtoReflection")
add_subdirectory("Tests")
# install
install(TARGETS
ProtoReflection
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include
)