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 our binary dir to find Table.h
20 target_include_directories(MathFunctions
21 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
22 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
25 # link our compiler flags interface library
26 target_link_libraries(MathFunctions tutorial_compiler_flags)
29 set(installable_libs MathFunctions tutorial_compiler_flags)
30 install(TARGETS ${installable_libs} DESTINATION lib)
31 # install include headers
32 install(FILES MathFunctions.h DESTINATION include)