]> OCCT Git - occt-wok.git/commitdiff
0025713: CMake configuring procedure should allow to build OCCT as static libraries IR-2015-01-30
authoribs <ibs@opencascade.com>
Fri, 16 Jan 2015 08:58:13 +0000 (11:58 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 29 Jan 2015 13:40:54 +0000 (16:40 +0300)
explicit specification of library type (static/shared) removed
DRAWEXE excluded when library build is static

src/WOKTclLib/OS.tcl
src/WOKTclLib/osutils.tcl

index 126f0ba056e83926c105df72c50d47834d4b01e6..44d1b3c03fb8b71267da8973c8fe7fae8e7509bf 100755 (executable)
@@ -2993,10 +2993,10 @@ proc OS:MKCMK { theOutDir {theModules {}} {theAllSolution ""} } {
   set aBuff [list]
   foreach aModule $theModules {
     if {$aModule == "Draw"} {
-      lappend aBuff "IF (NOT DEFINED ANDROID)"
+      lappend aBuff "if (NOT DEFINED ANDROID)"
     }
     
-    lappend aBuff "SET(BUILD_${aModule} ON CACHE BOOL \"include ${aModule}\"  )"
+    lappend aBuff "set (BUILD_${aModule} ON CACHE BOOL \"include ${aModule}\"  )"
     
     if {$aModule == "Draw"} {
       lappend aBuff "ENDIF()"
@@ -3030,21 +3030,26 @@ proc OS:MKCMK { theOutDir {theModules {}} {theAllSolution ""} } {
         set anIndent "  "
       }
       if {$isVTK} {
-        lappend aBuff " if (USE_VTK)"
+        lappend aBuff "  if (USE_VTK)"
       }
-      lappend aBuff "${anIndent} LIST(APPEND USED_TOOLKITS ${aToolKit} )"
-      lappend aBuff "${anIndent} foreach( TK \$\{${aToolKit}_DEPS\})"
+      lappend aBuff "${anIndent}  list (APPEND USED_TOOLKITS ${aToolKit} )"
+      lappend aBuff "${anIndent}  foreach( TK \$\{${aToolKit}_DEPS\})"
       lappend aBuff "${anIndent}    LIST(APPEND USED_TOOLKITS \$\{TK\} )"
-      lappend aBuff "${anIndent} endforeach()"
+      lappend aBuff "${anIndent}  endforeach()"
       if {$isVTK} {
         lappend aBuff " endif()"
       }
     }
     foreach anExecutable [OS:executable ${aModule}] {
-      lappend aBuff " LIST(APPEND USED_TOOLKITS ${anExecutable} )"
-      lappend aBuff " foreach( TK \$\{${anExecutable}_DEPS\})"
-      lappend aBuff "    LIST(APPEND USED_TOOLKITS \$\{TK\} )"
-      lappend aBuff " endforeach()"
+      lappend aBuff "  if (\"\$\{BUILD_LIBRARY_TYPE\}\" STREQUAL \"Shared\")"
+      lappend aBuff "    list (APPEND USED_TOOLKITS ${anExecutable} )"
+      lappend aBuff "    foreach( TK \$\{${anExecutable}_DEPS\})"
+      lappend aBuff "      list (APPEND USED_TOOLKITS \$\{TK\} )"
+      lappend aBuff "    endforeach()"
+      lappend aBuff "  else()"
+      lappend aBuff "    message (STATUS \"Info: ${anExecutable} is not included due to \$\{BUILD_LIBRARY_TYPE\} build library type\")"
+      lappend aBuff "  endif()"
+      lappend aBuff ""
     }
     lappend aBuff "endif()"
   }
@@ -3068,11 +3073,11 @@ proc OS:MKCMK { theOutDir {theModules {}} {theAllSolution ""} } {
         lappend aBuff "IF (USE_VTK)"
       }
       #add directory to main cmake metafile
-      lappend aBuff "${anIndent}IF(EXISTS \"\$\{TK_ROOT_DIR\}/$aSubPath/${aToolKit}\")"
+      lappend aBuff "${anIndent}if (EXISTS \"\$\{TK_ROOT_DIR\}/$aSubPath/${aToolKit}\")"
       lappend aBuff "${anIndent}  add_subdirectory(\$\{TK_ROOT_DIR\}/$aSubPath/${aToolKit})"
-      lappend aBuff "${anIndent}ELSE()"
-      lappend aBuff "${anIndent}  LIST(APPEND UNSUBDIRS \"$aSubPath/${aToolKit}\")"
-      lappend aBuff "${anIndent}ENDIF()"
+      lappend aBuff "${anIndent}else()"
+      lappend aBuff "${anIndent}  list (APPEND UNSUBDIRS \"$aSubPath/${aToolKit}\")"
+      lappend aBuff "${anIndent}endif()"
       if {$isVTK} {
         lappend aBuff "ENDIF()"
       }
@@ -3087,11 +3092,11 @@ proc OS:MKCMK { theOutDir {theModules {}} {theAllSolution ""} } {
       }
 
       #add directory to main cmake metafile
-      lappend aBuff "IF(EXISTS \"\$\{TK_ROOT_DIR\}/$aSubPath/${anExecutable}\")"
+      lappend aBuff "if (EXISTS \"\$\{TK_ROOT_DIR\}/$aSubPath/${anExecutable}\")"
       lappend aBuff "  add_subdirectory(\$\{TK_ROOT_DIR\}/$aSubPath/${anExecutable})"
-      lappend aBuff "ELSE()"
-      lappend aBuff "  LIST(APPEND UNSUBDIRS \"$aSubPath/${anExecutable}\")"
-      lappend aBuff "ENDIF()\n"
+      lappend aBuff "else()"
+      lappend aBuff "  list (APPEND UNSUBDIRS \"$aSubPath/${anExecutable}\")"
+      lappend aBuff "endif()\n"
 
       # create cmake metafile into target subdir
       osutils:cmktk $theOutDir/$aSubPath $anExecutable true ${aModule}
index a464b4a75ea4f6b093751c7ea595bc99adf0f0b8..b07296278eae47fa8ac306aa2c9fe21c7a33d0e7 100755 (executable)
@@ -2374,7 +2374,7 @@ proc osutils:cmktk { theOutDir theToolKit {theIsExec false} theModule} {
     lappend aFileBuff ""
     lappend aFileBuff " install( TARGETS ${theToolKit} DESTINATION \"\$\{INSTALL_DIR\}/\$\{OS_WITH_BIT\}/\$\{COMPILER\}/bin\$\{BUILD_POSTFIX\}\" )"
   } else {
-    lappend aFileBuff " add_library( ${theToolKit} SHARED \$\{${theToolKit}_USED_SRCFILES\} )"
+    lappend aFileBuff " add_library( ${theToolKit} \$\{${theToolKit}_USED_SRCFILES\} )"
     lappend aFileBuff ""
     lappend aFileBuff " set_property(TARGET ${theToolKit} PROPERTY FOLDER ${theModule})"
     lappend aFileBuff ""