CMakeLists.txt 2.2 KB

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