-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
28 lines (21 loc) · 877 Bytes
/
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
# Koans to learn CMake
# Sources at https://github.com/tibonihoo/CMakeKoans
# Author: Thibauld Nion
#
# CMake is available at http://cmake.org/
cmake_minimum_required(VERSION 3.3)
# Chose the generator according to the selector initially chosen for running this cmake
set(GENERATOR_OPTIONS "-G" "${CMAKE_GENERATOR}")
if(CMAKE_BUILD_TYPE)
list(APPEND GENERATOR_OPTIONS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
add_custom_target(KoanWorkingDirectory
${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/koans_build)
add_custom_target(KoanProject
${CMAKE_COMMAND} ${GENERATOR_OPTIONS} -DAPPRENTICE_NAME=NEWB ${PROJECT_SOURCE_DIR}/koans
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/koans_build
DEPENDS KoanWorkingDirectory)
add_custom_target(RunKoans ALL
${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/koans_build
DEPENDS KoanProject)