|
| 1 | +###################################################################### |
| 2 | +# CMakeLists.txt generated for component estgeotform2dForPtsAndLines |
| 3 | +# Product type: static library |
| 4 | +###################################################################### |
| 5 | +cmake_minimum_required(VERSION 3.12) |
| 6 | +# project(estgeotform2dForPtsAndLines) |
| 7 | +if(DEFINED ENV{CMAKE_EXPORT_COMPILE_COMMANDS} AND NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS) |
| 8 | + set(CMAKE_EXPORT_COMPILE_COMMANDS $ENV{CMAKE_EXPORT_COMPILE_COMMANDS}) |
| 9 | +endif() |
| 10 | + |
| 11 | + |
| 12 | +###################################################################### |
| 13 | +## Path variables |
| 14 | +###################################################################### |
| 15 | +get_filename_component(START_DIR ./ ABSOLUTE) |
| 16 | +set(MATLAB_ROOT /opt/matlab/R2023a CACHE PATH "") |
| 17 | +if(${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) |
| 18 | + set(BUILDING_IN_SOURCE_DIR TRUE) |
| 19 | + set(BINARY_START_DIR "${START_DIR}") |
| 20 | +else() |
| 21 | + set(BUILDING_IN_SOURCE_DIR FALSE) |
| 22 | + set(BINARY_START_DIR "${CMAKE_BINARY_DIR}") |
| 23 | +endif() |
| 24 | +if(WIN32 AND NOT MINGW) |
| 25 | + set(SYSLIB_PREFIX "lib") |
| 26 | +else() |
| 27 | + set(SYSLIB_PREFIX "") |
| 28 | +endif() |
| 29 | + |
| 30 | +###################################################################### |
| 31 | +## System libraries |
| 32 | +###################################################################### |
| 33 | +find_library(FOUND_LIBM m NO_SYSTEM_ENVIRONMENT_PATH PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES} |
| 34 | + ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}) |
| 35 | +find_library(FOUND_LIBSTDCXX stdc++ NO_SYSTEM_ENVIRONMENT_PATH PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES} |
| 36 | + ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}) |
| 37 | + |
| 38 | +###################################################################### |
| 39 | +## Target definition and commands |
| 40 | +###################################################################### |
| 41 | +add_library(estgeotform2dForPtsAndLines SHARED ${START_DIR}/rt_nonfinite.cpp |
| 42 | + ${START_DIR}/rtGetNaN.cpp |
| 43 | + ${START_DIR}/rtGetInf.cpp |
| 44 | + ${START_DIR}/estgeotform2dForPtsAndLines.cpp) |
| 45 | +set_target_properties(estgeotform2dForPtsAndLines PROPERTIES |
| 46 | + PREFIX "" |
| 47 | + POSITION_INDEPENDENT_CODE ON |
| 48 | + RUNTIME_OUTPUT_DIRECTORY "${BINARY_START_DIR}/$<0:>" |
| 49 | + LIBRARY_OUTPUT_DIRECTORY "${BINARY_START_DIR}/$<0:>" |
| 50 | + ARCHIVE_OUTPUT_DIRECTORY "${BINARY_START_DIR}/$<0:>") |
| 51 | +target_compile_features(estgeotform2dForPtsAndLines PUBLIC cxx_std_11) |
| 52 | +target_compile_definitions(estgeotform2dForPtsAndLines PRIVATE -DMODEL=estgeotform2dForPtsAndLines) |
| 53 | +target_include_directories(estgeotform2dForPtsAndLines PUBLIC $<BUILD_INTERFACE:${START_DIR}> |
| 54 | + $<INSTALL_INTERFACE:$<INSTALL_PREFIX>> |
| 55 | + $<BUILD_INTERFACE:${START_DIR}> |
| 56 | + $<INSTALL_INTERFACE:$<INSTALL_PREFIX>> |
| 57 | + $<BUILD_INTERFACE:${MATLAB_ROOT}/extern/include>) |
| 58 | +target_link_libraries(estgeotform2dForPtsAndLines INTERFACE $<$<BOOL:${FOUND_LIBM}>:m> |
| 59 | + $<$<BOOL:${FOUND_LIBSTDCXX}>:stdc++>) |
| 60 | + |
| 61 | + |
| 62 | +###################################################################### |
| 63 | +## Build success message |
| 64 | +###################################################################### |
| 65 | +add_custom_command(TARGET estgeotform2dForPtsAndLines POST_BUILD |
| 66 | + COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "\\#\\#\\# Created library: $<TARGET_FILE:estgeotform2dForPtsAndLines>") |
| 67 | + |
| 68 | +###################################################################### |
| 69 | +## Call toolchain hook function if defined |
| 70 | +###################################################################### |
| 71 | +if(COMMAND toolchain_target_hook) |
| 72 | + toolchain_target_hook(estgeotform2dForPtsAndLines) |
| 73 | +endif() |
0 commit comments