2008-10-12 18:41:06 +02:00
|
|
|
# first we add the executable that generates the table
|
|
|
|
add_executable(MakeTable MakeTable.cxx)
|
|
|
|
|
|
|
|
# add the command to generate the source code
|
2019-11-11 23:01:05 +01:00
|
|
|
add_custom_command(
|
2008-10-12 18:41:06 +02:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
|
2019-11-11 23:01:05 +01:00
|
|
|
COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
|
2008-10-12 18:41:06 +02:00
|
|
|
DEPENDS MakeTable
|
|
|
|
)
|
|
|
|
|
|
|
|
# add the main library
|
2019-11-11 23:01:05 +01:00
|
|
|
add_library(MathFunctions
|
|
|
|
mysqrt.cxx
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Table.h
|
|
|
|
)
|
|
|
|
|
|
|
|
# state that anybody linking to us needs to include the current source dir
|
|
|
|
# to find MathFunctions.h, while we don't.
|
|
|
|
# state that we depend on our binary dir to find Table.h
|
|
|
|
target_include_directories(MathFunctions
|
|
|
|
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
|
2020-02-01 23:06:01 +01:00
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
2019-11-11 23:01:05 +01:00
|
|
|
)
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
# install rules
|
2019-11-11 23:01:05 +01:00
|
|
|
install(TARGETS MathFunctions DESTINATION lib)
|
|
|
|
install(FILES MathFunctions.h DESTINATION include)
|