diff options
Diffstat (limited to 'Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt')
-rw-r--r-- | Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt deleted file mode 100644 index 760d6a57c..000000000 --- a/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt +++ /dev/null @@ -1,60 +0,0 @@ - -# add the library that runs -add_library(MathFunctions MathFunctions.cxx) - -# state that anybody linking to us needs to include the current source dir -# to find MathFunctions.h, while we don't. -target_include_directories(MathFunctions - INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} - ) - -# should we use our own math functions -option(USE_MYMATH "Use tutorial provided math implementation" ON) -if(USE_MYMATH) - - # 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) - - # first we add the executable that generates the table - add_executable(MakeTable MakeTable.cxx) - - # add the command to generate the source code - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h - COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h - DEPENDS MakeTable - ) - - # library that just does sqrt - add_library(SqrtLibrary STATIC - mysqrt.cxx - ${CMAKE_CURRENT_BINARY_DIR}/Table.h - ) - - # state that we depend on our binary dir to find Table.h - target_include_directories(SqrtLibrary PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ) - - set_target_properties(SqrtLibrary PROPERTIES - POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} - ) - - target_compile_definitions(SqrtLibrary PRIVATE - "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>" - "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>" - ) - target_link_libraries(MathFunctions PRIVATE SqrtLibrary) -endif() - -target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>") - -# define the symbol stating we are using the declspec(dllexport) when -#building on windows -target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") - -install(TARGETS MathFunctions DESTINATION lib) -install(FILES MathFunctions.h DESTINATION include) |