浏览代码

add right sublib naming; added core_basics_progs example progs

Johannes R 12 年之前
父节点
当前提交
59ad0bec11
共有 6 个文件被更改,包括 56 次插入12 次删除
  1. 2 1
      CMakeLists.txt
  2. 14 5
      cmake/NiceModules.cmake
  3. 17 0
      core/CMakeLists.txt
  4. 12 0
      core/basics/CMakeLists.txt
  5. 6 6
      core/basics/progs/CMakeLists.txt
  6. 5 0
      core/vector/CMakeLists.txt

+ 2 - 1
CMakeLists.txt

@@ -37,8 +37,9 @@ set(OPENCV_LIB_INSTALL_PATH lib)
 INCLUDE_DIRECTORIES(".")
 INCLUDE_DIRECTORIES(core)
 
-ADD_SUBDIRECTORY(core bin)
+set(the_module "libnice")
 
+ADD_SUBDIRECTORY(core bin)
 
 # doxygen support
 FIND_PROGRAM(DOXYGEN_EXECUTABLE "doxygen")

+ 14 - 5
cmake/NiceModules.cmake

@@ -27,6 +27,11 @@ macro(ocv_glob_modules)
   endif()
   set(__directories_observed "")
 
+  #nice-----
+  get_filename_component(currDirName ${CMAKE_CURRENT_SOURCE_DIR} NAME )
+  set(the_module "${the_module}_${currDirName}")
+  #------
+  
   # collect modules
   set(OPENCV_INITIAL_PASS ON)
   foreach(__path ${ARGN})
@@ -118,10 +123,14 @@ endmacro()
 # Example:
 #   ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_gpu)
 macro(ocv_add_module _name)
-  string(TOLOWER "${_name}" name)
-  string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
-  set(the_module opencv_${name})
-
+  #string(TOLOWER "${_name}" name)
+  #string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
+  #set(the_module opencv_${name})
+  #-----
+  get_filename_component(currDirName ${CMAKE_CURRENT_SOURCE_DIR} NAME )
+  set(the_module "${the_module}_${currDirName}")
+  #----
+  
   # the first pass - collect modules info, the second pass - create targets
   if(OPENCV_INITIAL_PASS)
     #guard agains redefinition
@@ -257,7 +266,7 @@ macro(ocv_glob_module_sources)
 
 #  ocv_set_module_sources(${ARGN} HEADERS ${lib_hdrs} ${lib_hdrs_detail} SOURCES ${lib_srcs} ${lib_int_hdrs})
 
-  file(GLOB_RECURSE lib_srcs "*.cpp" "*.tcc")
+  file(GLOB lib_srcs "*.cpp" "*.tcc")
   #file(GLOB_RECURSE lib_int_hdrs "./*.hpp" "./*.h")
   #file(GLOB_RECURSE lib_int_hdrs "./*.hpp" "./*.h")
   file(GLOB lib_hdrs "*.hpp" "*.h")

+ 17 - 0
core/CMakeLists.txt

@@ -1,8 +1,25 @@
 set(NICE_CURR_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 message(STATUS "${NICE_CURR_DIR}")
+get_filename_component(currDirName ${NICE_CURR_DIR} NAME )
+message(status "CMAKE_CURRENT_LIST_DIR : ${currDirName}")
+set(testvar "${testvar}core_")
+message(STATUS "before: ${testvar}")
+
 ocv_glob_modules(${NICE_CURR_DIR})
+message(STATUS "after: ${testvar}")
+
+####
+ADD_EXECUTABLE(testConfig ./basics/progs/testConfig.cpp)
+ADD_EXECUTABLE(testMemoryUsage ./basics/progs/testMemoryUsage.cpp) 
+
+TARGET_LINK_LIBRARIES(testConfig libnice_core_basics libnice_core_vector)
+TARGET_LINK_LIBRARIES(testMemoryUsage libnice_core_basics libnice_core_vector)
+
+INSTALL(TARGETS testConfig DESTINATION bin)
+INSTALL(TARGETS testMemoryUsage DESTINATION bin)
 
 
+###
 
 #CONFIGURE_FILE(
 #  "CMakeDefinesConfig.h.in"

+ 12 - 0
core/basics/CMakeLists.txt

@@ -0,0 +1,12 @@
+message(STATUS "vector_location: ${OPENCV_MODULE_opencv_vector_LOCATION}")
+
+ocv_add_module(basics)# INTERNAL libnice_core_vector)
+
+message(STATUS "vector_location: ${OPENCV_MODULE_vector_LOCATION}")
+
+ocv_module_include_directories()
+message(STATUS "vec-sources: ${OPENCV_MODULE_libnice_core_vector_SOURCES}")
+ocv_glob_module_sources(SOURCES ${OPENCV_MODULE_libnice_core_vector_SOURCES})
+ocv_create_module()
+
+add_subdirectory(progs bin)

+ 6 - 6
core/basics/progs/CMakeLists.txt

@@ -1,9 +1,9 @@
 
-ADD_EXECUTABLE(testConfig testConfig.cpp)
-ADD_EXECUTABLE(testMemoryUsage testMemoryUsage.cpp) 
+#ADD_EXECUTABLE(testConfig testConfig.cpp)
+#ADD_EXECUTABLE(testMemoryUsage testMemoryUsage.cpp) 
 
-TARGET_LINK_LIBRARIES(testConfig core_basics)
-TARGET_LINK_LIBRARIES(testMemoryUsage core_basics)
+#TARGET_LINK_LIBRARIES(testConfig libnice_core_basics libnice_core_vector)
+#TARGET_LINK_LIBRARIES(testMemoryUsage libnice_core_basics libnice_core_vector)
 
-INSTALL(TARGETS testConfig DESTINATION bin)
-INSTALL(TARGETS testMemoryUsage DESTINATION bin)
+#INSTALL(TARGETS testConfig DESTINATION bin)
+#INSTALL(TARGETS testMemoryUsage DESTINATION bin)

+ 5 - 0
core/vector/CMakeLists.txt

@@ -2,6 +2,11 @@ message(STATUS "vector_location: ${OPENCV_MODULE_opencv_vector_LOCATION}")
 
 ocv_add_module(vector)
 
+
+set(testvar "${testvar}vector")
+message(STATUS "before: ${testvar}")
+
+
 message(STATUS "vector_location: ${OPENCV_MODULE_vector_LOCATION}")
 
 ocv_module_include_directories()