CMakeLists.txt 2.0 KB

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