You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
713 B
23 lines
713 B
5 years ago
|
add_library(MathFunctions mysqrt.cxx)
|
||
16 years ago
|
|
||
5 years ago
|
# state that anybody linking to us needs to include the current source dir
|
||
|
# to find MathFunctions.h, while we don't.
|
||
|
target_include_directories(MathFunctions
|
||
|
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
|
||
|
)
|
||
16 years ago
|
|
||
5 years ago
|
# does this system provide the log and exp functions?
|
||
|
include(CheckSymbolExists)
|
||
|
set(CMAKE_REQUIRED_LIBRARIES "m")
|
||
|
check_symbol_exists(log "math.h" HAVE_LOG)
|
||
|
check_symbol_exists(exp "math.h" HAVE_EXP)
|
||
|
|
||
|
if(HAVE_LOG AND HAVE_EXP)
|
||
|
target_compile_definitions(MathFunctions
|
||
|
PRIVATE "HAVE_LOG" "HAVE_EXP")
|
||
|
endif()
|
||
|
|
||
|
# install rules
|
||
5 years ago
|
install(TARGETS MathFunctions DESTINATION lib)
|
||
|
install(FILES MathFunctions.h DESTINATION include)
|