CMakeLists.txt 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ####################################################
  2. ## library individual settings
  3. #library name (name is appended to "nice_" to form the target library name)
  4. set(the_library "gp-hik-core")
  5. #add linkage dependencies to other libraries here
  6. set("nice_${the_library}_LINKING_DEPENDENCIES" "nice_core" ${MEX_LIBRARIES})
  7. #####################################################
  8. message(STATUS "adding library ${the_library}")
  9. nice_get_source_files()
  10. nice_build_library()
  11. nice_add_progs()
  12. nice_add_mexes()
  13. nice_add_unittests()
  14. #####
  15. set(the_module "nice_${the_library}")
  16. if(ENABLE_SOLUTION_FOLDERS)
  17. set_target_properties(${the_module} PROPERTIES FOLDER "modules")
  18. endif()
  19. set_target_properties(${the_module} PROPERTIES
  20. OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}"
  21. DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
  22. ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
  23. RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
  24. INSTALL_NAME_DIR lib
  25. )
  26. if(BUILD_SHARED_LIBS)
  27. if(MSVC)
  28. set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS)
  29. else()
  30. add_definitions(-DCVAPI_EXPORTS)
  31. endif()
  32. endif()
  33. if(MSVC)
  34. if(CMAKE_CROSSCOMPILING)
  35. set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:secchk")
  36. endif()
  37. set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc /DEBUG")
  38. endif()
  39. install(TARGETS ${the_module}
  40. RUNTIME DESTINATION bin COMPONENT main
  41. LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
  42. ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
  43. )
  44. # # only "public" headers need to be installed
  45. # if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};")
  46. # foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
  47. # string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
  48. # if(hdr2 MATCHES "^(opencv2/.*)/[^/]+.h(..)?$")
  49. # install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT main)
  50. # endif()
  51. # endforeach()
  52. # endif()