Tutorial: Improve Step 3

* Move `option(USE_MYMATH...` to the same location in all CMakeLists files
This commit is contained in:
Betsy McPhail
2019-07-09 13:36:53 -04:00
committed by Brad King
parent 49ce4d6ff4
commit bc64401c3d
5 changed files with 31 additions and 18 deletions

View File

@@ -7,15 +7,15 @@ project(Tutorial VERSION 1.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
# does this system provide the log and exp functions?
include(CheckSymbolExists)
set(CMAKE_REQUIRED_LIBRARIES "m")
check_symbol_exists(log "math.h" HAVE_LOG)
check_symbol_exists(exp "math.h" HAVE_EXP)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
# configure a header file to pass the version number only
configure_file(TutorialConfig.h.in TutorialConfig.h)