Kaynağa Gözat

cmakelist commit

Johannes Ruehle 12 yıl önce
ebeveyn
işleme
cae57f7b6f

+ 14 - 10
CMakeLists.txt

@@ -13,9 +13,12 @@ set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR})
 
 set(NICE_BUILD_LIBS_STATIC_SHARED STATIC)
 
-FIND_PACKAGE(Boost)
+set(NICE_BUILD_PROGS 1)
+
+FIND_PACKAGE(Boost COMPONENTS date_time filesystem)
 IF (Boost_FOUND)
-    INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
+	message(STATUS "boost-incl-dir: ${Boost_INCLUDE_DIRS}")
+    INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
     ADD_DEFINITIONS( "-DNICE_BOOST_FOUND" )
 ENDIF()
 
@@ -41,15 +44,16 @@ set(the_module "libnice")
 
 set(NICE_CURR_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 SUBDIRLIST(__listSubDirs "${NICE_CURR_DIR}")
-foreach(_curSubdir ${__listSubDirs})
-	ocv_get_real_path(__modpath "${NICE_CURR_DIR}/${_curSubdir}/")
-	if(EXISTS "${__modpath}/CMakeLists.txt")
+ocv_glob_modules( ${NICE_CURR_DIR} )
+# foreach(_curSubdir ${__listSubDirs})
+	# ocv_get_real_path(__modpath "${NICE_CURR_DIR}/${_curSubdir}/")
+	# if(EXISTS "${__modpath}/CMakeLists.txt")
+		# message(STATUS "add module: ${__modpath}")
+		set(__modpath "${__modpath}/")
 		message(STATUS "add module: ${__modpath}")
-		#set(__modpath "${__modpath}/")
-		#message(STATUS "add module: ${__modpath}")
-		ocv_glob_modules( ${__modpath} )
-	endif()
-endforeach()
+		# ocv_glob_modules( ${__modpath} )
+	# endif()
+# endforeach()
 #ADD_SUBDIRECTORY(core bin)
   
 # doxygen support

+ 15 - 13
cmake/NiceModules.cmake

@@ -38,9 +38,9 @@ macro(ocv_glob_modules modulepath)
 
   #nice-----
   #get_filename_component(currDirName ${CMAKE_CURRENT_SOURCE_DIR} NAME )
-  get_filename_component(currDirName ${modulepath} NAME )
-  set(the_module "${the_module}_${currDirName}")
-  message(STATUS "currDirName=${currDirName}")
+  #get_filename_component(currDirName ${modulepath} NAME )
+  #set(the_module "${the_module}_${currDirName}")
+  #message(STATUS "currDirName=${currDirName}")
   #------
   
   # collect modules
@@ -60,7 +60,7 @@ macro(ocv_glob_modules modulepath)
       foreach(mod ${__ocvmodules})
         ocv_get_real_path(__modpath "${__path}/${mod}")
         if(EXISTS "${__modpath}/CMakeLists.txt")
-	      message(STATUS "${__modpath} adding subdir")
+	      #message(STATUS "${__modpath} adding subdir")
           list(FIND __directories_observed "${__modpath}" __pathIdx)
           if(__pathIdx GREATER -1)
             message(FATAL_ERROR "The module from ${__modpath} is already loaded.")
@@ -281,8 +281,8 @@ macro(ocv_glob_module_sources)
   #file(GLOB_RECURSE lib_int_hdrs "./*.hpp" "./*.h")
   #file(GLOB_RECURSE lib_int_hdrs "./*.hpp" "./*.h")
   file(GLOB lib_hdrs "*.hpp" "*.h" "*.tcc")
-  message(status "lib_srcs: ${lib_srcs}")
-  message(status "lib_hdrs: ${lib_hdrs}")
+  #message(status "lib_srcs: ${lib_srcs}")
+  #message(status "lib_hdrs: ${lib_hdrs}")
   source_group("Src" FILES ${lib_srcs})
   source_group("Include" FILES ${lib_hdrs})
   ocv_set_module_sources(${ARGN} HEADERS ${lib_hdrs} SOURCES ${lib_srcs})
@@ -306,18 +306,20 @@ macro(ocv_create_module)
 		foreach(currSubDir ${__listSubdirs})
 			ocv_get_real_path(__subdirpath "${__path}/${currSubDir}")
 			#message(STATUS "${currSubDir}")
-			message(STATUS "subdir examining: ${__subdirpath}")
+			#message(STATUS "subdir examining: ${__subdirpath}")
 			if(EXISTS "${__subdirpath}/CMakeLists.txt")
-				message(STATUS "has CMakeLists.txt")
+				message(STATUS "${currSubDir} has CMakeLists.txt")
 				if ( "${currSubDir}" STREQUAL "tests" )
 					if( NICE_BUILD_TESTS )
 						#add tests
+						#add_subdirectory("${__subdirpath}")
 					else()
 						message(STATUS "by configuration: tests/ not added")
 					endif()
 				elseif( "${currSubDir}" STREQUAL "progs" )
 					if( NICE_BUILD_PROGS )
 						#add progs
+						add_subdirectory("${__subdirpath}")
 					else()
 						message(STATUS "by configuration: progs/ not added")	
 					endif()
@@ -325,11 +327,11 @@ macro(ocv_create_module)
 					message(STATUS "adding subdir")
 					add_subdirectory("${__subdirpath}")
 					#add subdir sources to the accumulated source variable of this directory
-					message(STATUS "subdir-sources: ${OPENCV_MODULE_${the_module}_${currSubDir}_SOURCES}")
+					#message(STATUS "subdir-sources: ${OPENCV_MODULE_${the_module}_${currSubDir}_SOURCES}")
 					set(OPENCV_MODULE_${the_module}_SOURCES "${OPENCV_MODULE_${the_module}_SOURCES}" "${OPENCV_MODULE_${the_module}_${currSubDir}_SOURCES}")
 					set(OPENCV_MODULE_${the_module}_HEADERS "${OPENCV_MODULE_${the_module}_HEADERS}" "${OPENCV_MODULE_${the_module}_${currSubDir}_HEADERS}")
-					message(STATUS "accumulated sources of ${the_module}: ${OPENCV_MODULE_${the_module}_SOURCES}")
-					message(STATUS "accumulated headers of ${the_module}: ${OPENCV_MODULE_${the_module}_HEADERS}")
+					#message(STATUS "accumulated sources of ${the_module}: ${OPENCV_MODULE_${the_module}_SOURCES}")
+					#message(STATUS "accumulated headers of ${the_module}: ${OPENCV_MODULE_${the_module}_HEADERS}")
 				endif()
 			endif()
 		endforeach()
@@ -338,8 +340,8 @@ macro(ocv_create_module)
 	##################################################
 
   #add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES})
-  message(STATUS "linking source files of ${the_module}: ${OPENCV_MODULE_${the_module}_SOURCES}")
-  message(STATUS "linking header files of ${the_module}: ${OPENCV_MODULE_${the_module}_HEADERS}")
+#  message(STATUS "linking source files of ${the_module}: ${OPENCV_MODULE_${the_module}_SOURCES}")
+#  message(STATUS "linking header files of ${the_module}: ${OPENCV_MODULE_${the_module}_HEADERS}")
   add_library(${the_module} ${NICE_BUILD_LIBS_STATIC_SHARED} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES})  
 
   if(NOT "${ARGN}" STREQUAL "SKIP_LINK")

+ 2 - 2
cmake/OpenCVUtils.cmake

@@ -15,9 +15,9 @@ endif()
 function(ocv_include_directories)
   set(__add_before "")
   foreach(dir ${ARGN})
-	message(STATUS "Dir: ${dir}")
+	#message(STATUS "Dir: ${dir}")
     get_filename_component(__abs_dir "${dir}" ABSOLUTE)
-	message(STATUS "filecomponent: ${__abs_dir}")
+	#message(STATUS "filecomponent: ${__abs_dir}")
     if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")
       list(APPEND __add_before "${dir}")
     else()

+ 6 - 6
core/CMakeLists.txt

@@ -11,14 +11,14 @@ ocv_create_module()
 # set(NICE_CURR_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 # ocv_glob_modules(${NICE_CURR_DIR})
 
-ADD_EXECUTABLE(testConfig ./basics/progs/testConfig.cpp)
-ADD_EXECUTABLE(testMemoryUsage ./basics/progs/testMemoryUsage.cpp)
+# 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)
+# TARGET_LINK_LIBRARIES(testConfig libnice_core_basics libnice_core_vector)
+# TARGET_LINK_LIBRARIES(testMemoryUsage libnice_core_basics)
 
-INSTALL(TARGETS testConfig DESTINATION bin)
-INSTALL(TARGETS testMemoryUsage DESTINATION bin)
+# INSTALL(TARGETS testConfig DESTINATION bin)
+# INSTALL(TARGETS testMemoryUsage DESTINATION bin)
 
 
 ###

+ 2 - 2
core/basics/CMakeLists.txt

@@ -1,10 +1,10 @@
 #message(STATUS "vector_location: ${OPENCV_MODULE_opencv_vector_LOCATION}")
 
-ocv_add_module(basics)# INTERNAL libnice_core_vector)
+ocv_add_module(basics)# ${Boost_LIBRARIES})# INTERNAL libnice_core_vector)
 
 #message(STATUS "vector_location: ${OPENCV_MODULE_vector_LOCATION}")
 
-ocv_module_include_directories()
+ocv_module_include_directories()#${Boost_INCLUDE_DIR})
 #message(STATUS "vec-sources: ${OPENCV_MODULE_libnice_core_vector_SOURCES}")
 ocv_glob_module_sources()#(SOURCES ${OPENCV_MODULE_libnice_core_vector_SOURCES})
 ocv_create_module()

+ 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 libnice_core_basics libnice_core_vector)
-#TARGET_LINK_LIBRARIES(testMemoryUsage libnice_core_basics libnice_core_vector)
+TARGET_LINK_LIBRARIES(testConfig libnice_core_basics)
+TARGET_LINK_LIBRARIES(testMemoryUsage libnice_core_basics)
 
-#INSTALL(TARGETS testConfig DESTINATION bin)
-#INSTALL(TARGETS testMemoryUsage DESTINATION bin)
+INSTALL(TARGETS testConfig DESTINATION bin)
+INSTALL(TARGETS testMemoryUsage DESTINATION bin)