CMakeLists.txt 862 B

123456789101112131415161718192021222324252627
  1. # first we add the executable that generates the table
  2. add_executable(MakeTable MakeTable.cxx)
  3. # add the command to generate the source code
  4. add_custom_command(
  5. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
  6. COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
  7. DEPENDS MakeTable
  8. )
  9. # add the main library
  10. add_library(MathFunctions
  11. mysqrt.cxx
  12. ${CMAKE_CURRENT_BINARY_DIR}/Table.h
  13. )
  14. # state that anybody linking to us needs to include the current source dir
  15. # to find MathFunctions.h, while we don't.
  16. # state that we depend on our binary dir to find Table.h
  17. target_include_directories(MathFunctions
  18. INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
  19. PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
  20. )
  21. # install rules
  22. install(TARGETS MathFunctions DESTINATION lib)
  23. install(FILES MathFunctions.h DESTINATION include)