CMakeLists.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright (c) 2008-2017 the Urho3D project.
  2. #
  3. # Permission is hereby granted, free of charge, to any person obtaining a copy
  4. # of this software and associated documentation files (the "Software"), to deal
  5. # in the Software without restriction, including without limitation the rights
  6. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. # copies of the Software, and to permit persons to whom the Software is
  8. # furnished to do so, subject to the following conditions:
  9. #
  10. # The above copyright notice and this permission notice shall be included in
  11. # all copies or substantial portions of the Software.
  12. #
  13. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. # THE SOFTWARE.
  20. #
  21. # Define target name
  22. set (TARGET_NAME ik)
  23. include (CheckIncludeFiles)
  24. check_include_files (stdint.h HAVE_STDINT_H)
  25. # Memory debugging options, non-DEBUG and multi-config generator will set the default to FALSE
  26. if (CMAKE_BUILD_TYPE STREQUAL Debug)
  27. set (DEFAULT_MEMORY_DEBUGGING 1)
  28. endif ()
  29. option (IK_MEMORY_DEBUGGING "Global switch for memory options. Keep track of the number of allocations and de-allocations and prints a report when the program shuts down" ${DEFAULT_MEMORY_DEBUGGING})
  30. cmake_dependent_option (IK_MEMORY_BACKTRACE "Generate backtraces for every malloc(), making it easy to track down memory leaks" "${DEFAULT_MEMORY_DEBUGGING}" "IK_MEMORY_DEBUGGING AND NOT WEB" FALSE)
  31. set (IK_REAL float CACHE STRING "Type to use for real numbers")
  32. option (IK_DOT_OUTPUT "When enabled, the generated chains are dumped to DOT for debug purposes")
  33. # Define source files
  34. define_source_files (GLOB_CPP_PATTERNS src/*.c GLOB_H_PATTERNS include/ik/*.h)
  35. if (IK_MEMORY_BACKTRACE)
  36. list (APPEND SOURCE_FILES src/platform/linux/backtrace_linux.c)
  37. endif ()
  38. # Define generated source files
  39. set (IK_BUILD_TYPE STATIC) # Urho always builds its 3rd-party as STATIC lib
  40. configure_file (include/ik/export.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/generated/ik/export.h)
  41. configure_file (include/ik/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/generated/ik/config.h)
  42. # Define dependency libs
  43. set (INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include/generated include)
  44. # Setup target
  45. setup_library ()
  46. # Install headers for building the Urho3D library
  47. install_header_files (DIRECTORY include/ik/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/ik FILES_MATCHING PATTERN *.h USE_FILE_SYMLINK BUILD_TREE_ONLY) # Note: the trailing slash is significant
  48. install_header_files (FILES ${CMAKE_CURRENT_BINARY_DIR}/include/generated/ik/export.h ${CMAKE_CURRENT_BINARY_DIR}/include/generated/ik/config.h DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/ik BUILD_TREE_ONLY)