diff options
author | Markus Ferrell <markus.ferrell@kitware.com> | 2023-03-03 15:48:17 (GMT) |
---|---|---|
committer | Markus Ferrell <markus.ferrell@kitware.com> | 2023-03-07 16:43:26 (GMT) |
commit | e1f2b35723f28b55b786bbe4cbee70a3e54e7da9 (patch) | |
tree | 6f967531211adff82d72cabd9c049a4c3c109655 /Help/guide/tutorial/Step10 | |
parent | 35ca2d524befc71b840808cce4e0a773ef722b71 (diff) | |
download | CMake-e1f2b35723f28b55b786bbe4cbee70a3e54e7da9.zip CMake-e1f2b35723f28b55b786bbe4cbee70a3e54e7da9.tar.gz CMake-e1f2b35723f28b55b786bbe4cbee70a3e54e7da9.tar.bz2 |
Tutorial: Refactor MakeTable commands into MakeTable.cmake
Diffstat (limited to 'Help/guide/tutorial/Step10')
-rw-r--r-- | Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Help/guide/tutorial/Step10/MathFunctions/MakeTable.cmake | 10 |
2 files changed, 11 insertions, 10 deletions
diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt index 6f6c430..36b3fe1 100644 --- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt @@ -13,16 +13,7 @@ if(USE_MYMATH) target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH") - # first we add the executable that generates the table - add_executable(MakeTable MakeTable.cxx) - target_link_libraries(MakeTable PRIVATE tutorial_compiler_flags) - - # 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 - ) + include(MakeTable.cmake) # generates Table.h # library that just does sqrt add_library(SqrtLibrary STATIC diff --git a/Help/guide/tutorial/Step10/MathFunctions/MakeTable.cmake b/Help/guide/tutorial/Step10/MathFunctions/MakeTable.cmake new file mode 100644 index 0000000..12865a9 --- /dev/null +++ b/Help/guide/tutorial/Step10/MathFunctions/MakeTable.cmake @@ -0,0 +1,10 @@ +# first we add the executable that generates the table +add_executable(MakeTable MakeTable.cxx) +target_link_libraries(MakeTable PRIVATE tutorial_compiler_flags) + +# 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 + ) |