Browse Source

#IQRV #comment [CMake] 添加是否编译各个模块的脚本

gifur 4 năm trước cách đây
mục cha
commit
28020e2ec2
2 tập tin đã thay đổi với 17 bổ sung3 xóa
  1. 13 3
      CMakeLists.txt
  2. 4 0
      addin/cmake/ConfigOptions.cmake

+ 13 - 3
CMakeLists.txt

@@ -447,12 +447,22 @@ else()
 endif(SIMULATE_ON)#end simulate
 
 add_subdirectory(ThirdParty)
-add_subdirectory(Other)
-add_subdirectory(Module)
-add_subdirectory(Tool)
+if(BUILD_MODULE)
+	add_subdirectory(Other)
+	add_subdirectory(Module)
+else()
+	message(WARNING "skipping Other and Module directories.")
+endif(BUILD_MODULE)
+if(BUILD_TOOLS)
+	add_subdirectory(Tool)
+else()
+	message(WARNING "skipping Tool directory.")
+endif(BUILD_TOOLS)
 add_subdirectory(Plugins)
 if(BUILD_DEVADAPTER)
 	add_subdirectory(DevAdapter)
+else()
+	message(WARNING "skipping DevAdapter directory.")
 endif(BUILD_DEVADAPTER)
 
 set(CMAKE_INSTALL_LOCAL_ONLY ON)

+ 4 - 0
addin/cmake/ConfigOptions.cmake

@@ -29,6 +29,10 @@ option(WITH_THIRD_PARTY "Build third-party components" ON)
 
 option(SIMULATE_ON "/run/version/1.2.3.4/" OFF)
 
+option(BUILD_MODULE "whether build entity module or not" ON)
+
+option(BUILD_TOOLS "whether build tools or not" ON)
+
 option(BUILD_DEVADAPTER "whether build device adapter or not" ON)
 
 option(WITH_LOCAL_DEVLIB "build dev adapter with local dependency libraries except conan" OFF)