forked from oatpp/oatpp-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (28 loc) · 1 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
cmake_minimum_required(VERSION 3.1)
set(project_name my-project) ## rename your project here
project(${project_name}-loader)
include(ExternalProject)
#############################################################################
## load all dependencies
ExternalProject_Add(oatpp
GIT_REPOSITORY "https://github.com/oatpp/oatpp.git"
GIT_TAG origin/master
CMAKE_ARGS -DOATPP_BUILD_TESTS=OFF
)
ExternalProject_Add(main
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/main
INSTALL_COMMAND cmake -E echo "SKIP INSTALL"
DEPENDS oatpp
)
#############################################################################
## make run command
ExternalProject_Get_Property(main BINARY_DIR)
add_custom_target(run
COMMAND ${BINARY_DIR}/${project_name}-exe
DEPENDS main
WORKING_DIRECTORY ${BINARY_DIR}
)
#############################################################################
## make test command
enable_testing()
add_test(all-tests ${BINARY_DIR}/${project_name}-test)