1 # first we add the executable that generates the table
2 add_executable(MakeTable MakeTable.cxx)
4 # add the command to generate the source code
6 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
7 COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
11 # add the main library
12 add_library(MathFunctions
14 ${CMAKE_CURRENT_BINARY_DIR}/Table.h
17 # state that anybody linking to us needs to include the current source dir
18 # to find MathFunctions.h, while we don't.
19 # state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
20 # TutorialConfig.h include is an implementation detail
21 # state that we depend on our binary dir to find Table.h
22 target_include_directories(MathFunctions
23 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
24 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
28 install(TARGETS MathFunctions DESTINATION lib)
29 install(FILES MathFunctions.h DESTINATION include)