From 97bef3e0ff53c74594148c657b8a827324db5738 Mon Sep 17 00:00:00 2001 From: ibs Date: Fri, 16 Jan 2015 11:58:13 +0300 Subject: [PATCH] 0025713: CMake configuring procedure should allow to build OCCT as static libraries explicit specification of library type (static/shared) removed DRAWEXE excluded when library build is static --- src/WOKTclLib/OS.tcl | 41 ++++++++++++++++++++++----------------- src/WOKTclLib/osutils.tcl | 2 +- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/WOKTclLib/OS.tcl b/src/WOKTclLib/OS.tcl index 126f0ba..44d1b3c 100755 --- a/src/WOKTclLib/OS.tcl +++ b/src/WOKTclLib/OS.tcl @@ -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} diff --git a/src/WOKTclLib/osutils.tcl b/src/WOKTclLib/osutils.tcl index a464b4a..b072962 100755 --- a/src/WOKTclLib/osutils.tcl +++ b/src/WOKTclLib/osutils.tcl @@ -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 "" -- 2.39.5