diff --git a/README.txt b/README.txt index e2800c8e71..c8aec1cd24 100644 --- a/README.txt +++ b/README.txt @@ -29,24 +29,23 @@ Packaging You can receive certified version of OCCT code in different packages. -- Snapshot of Git repository: contains only bare sources of OCCT; many C++ - files, HTML documentation, and project files / makefiles for building OCCT - need to be generated. +- Snapshot of Git repository: contains C++ header and source files of OCCT, + documentation sources, build scripts, and CMake project files. -- Complete source archive: contains all sources of OCCT, including C++ files - generated by WOK, HTML and PDF documentation, and projects / makefiles for - building on all officially supported platforms. +- Complete source archive: contains all sources of OCCT, generated HTML and PDF + documentation, and ready-to-use projects for building on all officially + supported platforms. - Binary package (platform-specific): in addition to complete source archive, it includes binaries of OCCT and third-party libraries built on one platform. This package allows using OCCT immediately after installation. -Certified versions of OCCT can be downloaded from http://www.opencascade.org +Certified versions of OCCT can be downloaded from http://www.opencascade.com You can also find OCCT pre-installed on your system, or install it from packages provided by a third party. Note that packaging and functionality of such versions can be different from certified releases. Please consult -documentation accompanyog your version for details. +documentation accompanying your version for details. Documentation ------------- @@ -59,8 +58,8 @@ If HTML documentation is not available in your package, you can: You need to have Tcl and Doxygen 1.8.4 (or above) installed on your system. and accessible in your environment (check environment variable PATH). - Run batch file *gendoc.bat* on Windows or Bash scriot *gendoc.sh* on Linux - or Mac OS X to (re)generate documentation. + Use batch file *gendoc.bat* on Windows or Bash script *gendoc* on Linux + or OS X to (re)generate documentation. - Read documentation in source plain text (MarkDown) format found in subfolder *dox* diff --git a/adm/genconf.tcl b/adm/genconf.tcl index a9cf537843..d6d874504f 100644 --- a/adm/genconf.tcl +++ b/adm/genconf.tcl @@ -136,9 +136,9 @@ proc wokdep:gui:UpdateList {} { if { "$::HAVE_TBB" == "true" } { wokdep:SearchTBB anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs } - if { "$::HAVE_OPENCL" == "true" } { - wokdep:SearchOpenCL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs - } +# if { "$::HAVE_OPENCL" == "true" } { +# wokdep:SearchOpenCL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs +# } if { "$::HAVE_VTK" == "true" } { wokdep:SearchVTK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs } @@ -384,8 +384,8 @@ checkbutton .myFrame.myChecks.myGl2psCheck -offvalue "false" -onvalue "true ttk::label .myFrame.myChecks.myGl2psLbl -text "Use GL2PS" checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList ttk::label .myFrame.myChecks.myTbbLbl -text "Use Intel TBB" -checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList -ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL" +#checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList +#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL" checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing" ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK" diff --git a/adm/genproj.tcl b/adm/genproj.tcl index aabb02321c..ebae8f2f3b 100644 --- a/adm/genproj.tcl +++ b/adm/genproj.tcl @@ -16,30 +16,18 @@ # ======================================================================= # This script defines Tcl command genproj generating project files for -# different IDEs: -# "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" -# -# Example: -# genproj -path=D:/occt -target=vc10 -# genproj -target=xcd -ios -static +# different IDEs and platforms. Run it with -help to get synopsis. # ======================================================================= source [file join [file dirname [info script]] genconfdeps.tcl] -set path "" +# the script is assumed to be run from CASROOT (or dependent Products root) +set path [file normalize .] set THE_CASROOT "" set fBranch "" if { [info exists ::env(CASROOT)] } { set THE_CASROOT "$::env(CASROOT)" } -switch -exact -- "$tcl_platform(platform)" { - "windows" {set targetStation "wnt"} - "unix" {set targetStation "lin"} -} - -switch -exact -- "$tcl_platform(os)" { - "Darwin" {set targetStation "mac"} -} proc _get_options { platform type branch } { set res "" @@ -121,84 +109,56 @@ proc osutils:findSrcSubPath {theSubPath} { } # Wrapper-function to generate VS project files -proc genproj { args } { - global path THE_CASROOT targetStation - set aSupportedTargets { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" } - set anArgs $args - - # Setting default IDE. - set anTarget "" - set aCmpl "gcc" - switch -exact -- "$targetStation" { - "wnt" {set anTarget "$::env(VCVER)"} - "lin" {set anTarget "cbp"} - "mac" {set anTarget "xcd"} - } - - set isTargetDefault true - if { [set anIndex [lsearch -nocase $anArgs -target=*]] != -1 } { - regsub -nocase "\\-target=" [lindex $anArgs $anIndex] "" anTarget - set anArgs [removeAllOccurrencesOf -target=* $anArgs] - set isTargetDefault false - } - - if { [set anIndex [lsearch -nocase $anArgs -path=*]] != -1} { - regsub -nocase "\\-path=" [lindex $anArgs $anIndex] "" path - set anArgs [removeAllOccurrencesOf -path=* $anArgs] - puts "Starting work with \"$path\"" - } - - if { [llength $anArgs] == 0 && $isTargetDefault == true } { - puts "the default \'$anTarget\' target has been applied" - } - +proc genproj {theIDE args} { + set aSupportedIDEs { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" } + set aSupportedPlatforms { "wnt" "lin" "mac" "ios" "qnx" } set isHelpRequire false - if { [lsearch -nocase $anArgs -h] != -1} { - set anArgs [removeAllOccurrencesOf -h $anArgs] - set isHelpRequire true - } - if {$path == ""} { + # check IDE argument + if { $theIDE == "-h" || $theIDE == "-help" || $theIDE == "--help" } { + set isHelpRequire true + } elseif { [lsearch -exact $aSupportedIDEs $theIDE] < 0 } { + puts "Error: genproj: unrecognized IDE \"$theIDE\"" set isHelpRequire true } - set aLibType "dynamic" - if { [lsearch -nocase $anArgs "-static"] != -1} { - set anArgs [removeAllOccurrencesOf "-static" $anArgs] - set aLibType "static" - puts "static build has been selected" - } elseif { [lsearch -nocase $anArgs "-dynamic"] != -1} { - set anArgs [removeAllOccurrencesOf "-dynamic" $anArgs] - set aLibType "dynamic" - puts "dynamic build has been selected" - } - - set aPlatform "" - if { [lsearch -nocase $anArgs "-ios"] != -1} { - set anArgs [removeAllOccurrencesOf "-ios" $anArgs] - set aPlatform "ios" - } + # choice of compiler for Code::Blocks, currently hard-coded + set aCmpl "gcc" - if { [lsearch -nocase $aSupportedTargets $anTarget] == -1} { - puts "the \'$anTarget\' is wrong TARGET" - set isHelpRequire true + # Determine default platform: wnt for vc*, mac for xcd, current for cbp + if { [regexp "^vc" $theIDE] } { + set aPlatform "wnt" + } elseif { $theIDE == "xcd" || $::tcl_platform(os) == "Darwin" } { + set aPlatform "mac" + } elseif { $::tcl_platform(platform) == "windows" } { + set aPlatform "wnt" + } elseif { $::tcl_platform(platform) == "unix" } { + set aPlatform "lin" } - if {[llength $anArgs] > 0} { - set isHelpRequire true - - foreach anArg $anArgs { - puts "genproj: unrecognized option \'$anArg\'" + # Check optional arguments + set aLibType "dynamic" + foreach arg $args { + if { $arg == "-h" || $arg == "-help" || $arg == "--help" } { + set isHelpRequire true + } elseif { [lsearch -exact $aSupportedPlatforms $arg] >= 0 } { + set aPlatform $arg + } elseif { $arg == "-static" } { + set aLibType "static" + puts "Static build has been selected" + } elseif { $arg == "-dynamic" } { + set aLibType "dynamic" + puts "Dynamic build has been selected" + } else { + puts "Error: genproj: unrecognized option \"$arg\"" + set isHelpRequire true } } if { $isHelpRequire == true } { - puts "usage: genproj \[ -target= \] \[ -path= \] - - PATH: - path to the project + puts "usage: genproj IDE \[Platform\] \[-static\] \[-h|-help|--help\] - TARGET: + IDE must be one of: vc8 - Visual Studio 2005 vc9 - Visual Studio 2008 vc10 - Visual Studio 2010 @@ -206,53 +166,59 @@ proc genproj { args } { vc12 - Visual Studio 2013 vc14 - Visual Studio 2015 cbp - CodeBlocks - xcd - XCode" - return + xcd - XCode + + Platform (optional, only for CodeBlocks and XCode): + wnt - Windows + lin - Linux + mac - OS X + ios - iOS + qnx - QNX + + Option -static can be used with XCode to build static libraries + " + return } - if {!$isTargetDefault} { - puts "the \'$anTarget\' target has been applied" + if { ! [info exists aPlatform] } { + puts "Error: genproj: Cannon identify default platform, please specify!" + return } - set anAdmPath "$path/adm" + puts "Preparing to generate $theIDE projects for $aPlatform platform..." - OS:MKPRC "$anAdmPath" "$anTarget" "$aLibType" "$aPlatform" "$aCmpl" + # path to where to generate projects, hardcoded from current dir + set anAdmPath [file normalize "${::path}/adm"] - genprojbat "$anTarget" -} + OS:MKPRC "$anAdmPath" "$theIDE" "$aLibType" "$aPlatform" "$aCmpl" -proc genprojbat {theIDE} { - set aTargetPlatform "lin" - if { "$::tcl_platform(platform)" == "windows" } { - set aTargetPlatform "wnt" - } - - if {[regexp {(vc)[0-9]*$} $theIDE] == 1} { - set aTargetPlatform wnt - } elseif {"$theIDE" == "xcd"} { - set aTargetPlatform mac - } + genprojbat "$theIDE" $aPlatform +} +proc genprojbat {theIDE thePlatform} { set aTargetPlatformExt sh - if { "$aTargetPlatform" == "wnt" } { + if { $thePlatform == "wnt" } { set aTargetPlatformExt bat } if {"$theIDE" != "cmake"} { - set anEnvTmplFile [open "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}" "r"] - set anEnvTmpl [read $anEnvTmplFile] - close $anEnvTmplFile - - set aCasRoot "" - if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } { - set aCasRoot [relativePath "$::path" "$::THE_CASROOT"] - } + # copy env.bat/sh only if not yet present + if { ! [file exists "$::path/env.${aTargetPlatformExt}"] } { + set anEnvTmplFile [open "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}" "r"] + set anEnvTmpl [read $anEnvTmplFile] + close $anEnvTmplFile + + set aCasRoot "" + if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } { + set aCasRoot [relativePath "$::path" "$::THE_CASROOT"] + } - regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl + regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl - set anEnvFile [open "$::path/env.${aTargetPlatformExt}" "w"] - puts $anEnvFile $anEnvTmpl - close $anEnvFile + set anEnvFile [open "$::path/env.${aTargetPlatformExt}" "w"] + puts $anEnvFile $anEnvTmpl + close $anEnvFile + } file copy -force -- "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}" } @@ -264,6 +230,9 @@ proc genprojbat {theIDE} { "cbp" { file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh" file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.bat" "$::path/codeblocks.bat" + # Code::Blocks 16.01 does not create directory for import libs, help him + file mkdir "$::path/$thePlatform/cbp/lib" + file mkdir "$::path/$thePlatform/cbp/libd" } "xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" } } @@ -289,22 +258,14 @@ set THE_GUIDS_LIST($aTKNullKey) "{00000000-0000-0000-0000-000000000000}" # @param thePlatform Optional target platform for cross-compiling, e.g. ios for iOS # @param theCmpl Compiler option (msvc or gcc) proc OS:MKPRC { theOutDir theIDE theLibType thePlatform theCmpl } { - global path targetStation - set aSupportedIDE { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" } - - if { [lsearch $aSupportedIDE $theIDE] < 0 } { - puts stderr "WOK does not support generation of project files for the selected IDE: $theIDE\nSupported IDEs: [join ${aSupportedIDE} " "]" - return - } - + global path set anOutRoot $theOutDir if { $anOutRoot == "" } { error "Error : \"theOutDir\" is not initialized" } # Create output directory - set aWokStation "$targetStation" - + set aWokStation "$thePlatform" if { [lsearch -exact {vc7 vc8 vc9 vc10 vc11 vc12 vc14} $theIDE] != -1 } { set aWokStation "msvc" } @@ -350,7 +311,7 @@ proc OS:MKPRC { theOutDir theIDE theLibType thePlatform theCmpl } { # collect all required header files puts "Collecting required header files into $path/inc ..." - osutils:collectinc $aModules $path/inc $targetStation + osutils:collectinc $aModules $path/inc # Generating project files for the selected IDE switch -exact -- "$theIDE" { @@ -361,7 +322,7 @@ proc OS:MKPRC { theOutDir theIDE theLibType thePlatform theCmpl } { "vc11" - "vc12" - "vc14" { OS:MKVC $anOutDir $aModules $anAllSolution $theIDE } - "cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution $theCmpl } + "cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution $thePlatform $theCmpl } "xcd" { set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000" OS:MKXCD $anOutDir $aModules $anAllSolution $theLibType $thePlatform @@ -606,7 +567,6 @@ proc osutils:tk:eatpk { EXTERNLIB } { # Define libraries to link using only EXTERNLIB file proc LibToLink {theTKit} { - global path regexp {^.*:([^:]+)$} $theTKit dummy theTKit set type [_get_type $theTKit] if {$type != "t" && $type != "x"} { @@ -652,9 +612,8 @@ proc OS:genGUID { {theIDE "vc"} } { } # collect all include file that required for theModules in theOutDir -proc osutils:collectinc {theModules theIncPath theTargetStation} { +proc osutils:collectinc {theModules theIncPath} { global path - set aCasRoot [file normalize $path] set anIncPath [file normalize $theIncPath] @@ -1051,12 +1010,10 @@ proc wokUtils:FILES:FileToString { fin } { return {} } } -# List extensions of compilable files in OCCT -proc osutils:compilable { } { - global targetStation - set aWokStation "$targetStation" - if { "$aWokStation" == "mac" } { +# List extensions of compilable files in OCCT +proc osutils:compilable {thePlatform} { + if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } { return [list .c .cxx .cpp .mm] } return [list .c .cxx .cpp] @@ -1463,7 +1420,7 @@ proc osutils:readtemplate:rc {theOutDir theToolKit} { proc osutils:vcproj { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {} } } { if { $theProjTmpl == {} } {set theProjTmpl [osutils:vcproj:readtemplate $theVcVer 0]} - set l_compilable [osutils:compilable] + set l_compilable [osutils:compilable wnt] regsub -all -- {__TKNAM__} $theProjTmpl $theToolKit theProjTmpl upvar $theGuidsMap aGuidsMap @@ -1509,7 +1466,7 @@ proc osutils:vcproj { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {} set fxloparam "" foreach fxlo $resultloc { set xlo $fxlo - set aSrcFiles [osutils:tk:files $xlo osutils:compilable 0] + set aSrcFiles [osutils:tk:files $xlo wnt] set fxlo_cmplrs_options_cxx [_get_options wnt cmplrs_cxx $fxlo] if {$fxlo_cmplrs_options_cxx == ""} { set fxlo_cmplrs_options_cxx [_get_options wnt cmplrs_cxx b] @@ -1615,24 +1572,16 @@ proc osutils:tk:loadunit { loc map } { } # Returns the list of all compilable files name in a toolkit, or devunit of any type -# Call unit filter on units name to accept or reject a unit # Tfiles lists for each unit the type of file that can be compiled. -proc osutils:tk:files { tkloc {l_compilable {} } {justail 1} {unitfilter {}} } { +proc osutils:tk:files { tkloc thePlatform } { set Tfiles(source,nocdlpack) {source pubinclude} set Tfiles(source,toolkit) {} set Tfiles(source,executable) {source pubinclude} set listloc [concat [osutils:tk:units $tkloc] $tkloc] #puts " listloc = $listloc" - if { $l_compilable == {} } { - set l_comp [list .c .cxx .cpp] - } else { - set l_comp [$l_compilable] - } - if { $unitfilter == {} } { - set resultloc $listloc - } else { - set resultloc [$unitfilter $listloc] - } + + set l_comp [osutils:compilable $thePlatform] + set resultloc $listloc set lret {} foreach loc $resultloc { set utyp [_get_type $loc] @@ -1656,15 +1605,7 @@ proc osutils:tk:files { tkloc {l_compilable {} } {justail 1} {unitfilter {}} } foreach f $map($type) { #puts $f if { [lsearch $l_comp [file extension $f]] != -1 } { - if { $justail == 1 } { - if {$type == "source"} { - if {[lsearch $lret "@top_srcdir@/src/$loc/[file tail $f]"] == -1} { - lappend lret @top_srcdir@/src/$loc/[file tail $f] - } - } - } else { - lappend lret $f - } + lappend lret $f } } } @@ -1675,14 +1616,14 @@ proc osutils:tk:files { tkloc {l_compilable {} } {justail 1} {unitfilter {}} } # Generate Visual Studio project file for executable proc osutils:vcprojx { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {} } } { set aVcFiles {} - foreach f [osutils:tk:files $theToolKit osutils:compilable 0] { + foreach f [osutils:tk:files $theToolKit wnt] { if { $theProjTmpl == {} } { set aProjTmpl [osutils:vcproj:readtemplate $theVcVer 1] } else { set aProjTmpl $theProjTmpl } set aProjName [file rootname [file tail $f]] - set l_compilable [osutils:compilable] + set l_compilable [osutils:compilable wnt] regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl upvar $theGuidsMap aGuidsMap @@ -1875,13 +1816,13 @@ proc osutils:justunix { listloc } { ####### CODEBLOCK ################################################################### # Function to generate Code Blocks workspace and project files -proc OS:MKCBP { theOutDir theModules theAllSolution theCmpl } { +proc OS:MKCBP { theOutDir theModules theAllSolution thePlatform theCmpl } { puts stderr "Generating project files for Code Blocks" # Generate projects for toolkits and separate workspace for each module foreach aModule $theModules { OS:cworkspace $aModule $aModule $theOutDir - OS:cbp $theCmpl $aModule $theOutDir + OS:cbp $theCmpl $aModule $theOutDir $thePlatform } # Generate single workspace "OCCT" containing projects from all modules @@ -1893,32 +1834,29 @@ proc OS:MKCBP { theOutDir theModules theAllSolution theCmpl } { } # Generate Code Blocks projects -proc OS:cbp { theCmpl theModules theOutDir } { +proc OS:cbp { theCmpl theModules theOutDir thePlatform } { set aProjectFiles {} foreach aModule $theModules { foreach aToolKit [${aModule}:toolkits] { - lappend aProjectFiles [osutils:cbptk $theCmpl $theOutDir $aToolKit ] + lappend aProjectFiles [osutils:cbptk $theCmpl $theOutDir $aToolKit $thePlatform] } foreach anExecutable [OS:executable ${aModule}] { - lappend aProjectFiles [osutils:cbpx $theCmpl $theOutDir $anExecutable] + lappend aProjectFiles [osutils:cbpx $theCmpl $theOutDir $anExecutable $thePlatform] } } return $aProjectFiles } # Generate Code::Blocks project file for ToolKit -proc osutils:cbptk { theCmpl theOutDir theToolKit } { +proc osutils:cbptk { theCmpl theOutDir theToolKit thePlatform} { set aUsedLibs [list] set aFrameworks [list] set anIncPaths [list] set aTKDefines [list] set aTKSrcFiles [list] - global path targetStation - set aWokStation "$targetStation" - # collect list of referred libraries to link with - osutils:usedOsLibs $theToolKit "$aWokStation" aUsedLibs aFrameworks + osutils:usedOsLibs $theToolKit $thePlatform aUsedLibs aFrameworks set aDepToolkits [wokUtils:LIST:Purge [osutils:tk:close $theToolKit]] foreach tkx $aDepToolkits { lappend aUsedLibs "${tkx}" @@ -1931,7 +1869,7 @@ proc osutils:cbptk { theCmpl theOutDir theToolKit } { set listloc $theToolKit } - if { "$aWokStation" == "wnt" } { + if { $thePlatform == "wnt" } { set resultloc [osutils:justwnt $listloc] } else { set resultloc [osutils:justunix $listloc] @@ -1939,7 +1877,7 @@ proc osutils:cbptk { theCmpl theOutDir theToolKit } { if [array exists written] { unset written } foreach fxlo $resultloc { set xlo $fxlo - set aSrcFiles [osutils:tk:files $xlo osutils:compilable 0] + set aSrcFiles [osutils:tk:files $xlo $thePlatform] foreach aSrcFile [lsort $aSrcFiles] { if { ![info exists written([file tail $aSrcFile])] } { set written([file tail $aSrcFile]) 1 @@ -1950,12 +1888,12 @@ proc osutils:cbptk { theCmpl theOutDir theToolKit } { } # macros for correct DLL exports - if { "$aWokStation" == "wnt" } { + if { $thePlatform == "wnt" } { lappend aTKDefines "__${xlo}_DLL" } } - return [osutils:cbp $theCmpl $theOutDir $theToolKit $aTKSrcFiles $aUsedLibs $aFrameworks $anIncPaths $aTKDefines] + return [osutils:cbp $theCmpl $theOutDir $theToolKit $thePlatform $aTKSrcFiles $aUsedLibs $aFrameworks $anIncPaths $aTKDefines] } # Generates Code Blocks workspace. @@ -2028,13 +1966,12 @@ proc OS:cworkspace { theSolName theModules theOutDir } { } # Generate Code::Blocks project file for Executable -proc osutils:cbpx { theCmpl theOutDir theToolKit } { - global path targetStation - set aWokStation "$targetStation" +proc osutils:cbpx { theCmpl theOutDir theToolKit thePlatform } { + global path set aWokArch "$::env(ARCH)" set aCbpFiles {} - foreach aSrcFile [osutils:tk:files $theToolKit osutils:compilable 0] { + foreach aSrcFile [osutils:tk:files $theToolKit $thePlatform] { # collect list of referred libraries to link with set aUsedLibs [list] set aFrameworks [list] @@ -2043,7 +1980,7 @@ proc osutils:cbpx { theCmpl theOutDir theToolKit } { set aTKSrcFiles [list] set aProjName [file rootname [file tail $aSrcFile]] - osutils:usedOsLibs $theToolKit "$aWokStation" aUsedLibs aFrameworks + osutils:usedOsLibs $theToolKit $thePlatform aUsedLibs aFrameworks set aDepToolkits [LibToLinkX $theToolKit $aProjName] foreach tkx $aDepToolkits { @@ -2070,14 +2007,14 @@ proc osutils:cbpx { theCmpl theOutDir theToolKit } { } # macros for correct DLL exports - if { "$aWokStation" == "wnt" } { + if { $thePlatform == "wnt" } { lappend aTKDefines "__${theToolKit}_DLL" } # common include paths lappend anIncPaths "../../../inc" - lappend aCbpFiles [osutils:cbp $theCmpl $theOutDir $aProjName $aTKSrcFiles $aUsedLibs $aFrameworks $anIncPaths $aTKDefines $isExecutable] + lappend aCbpFiles [osutils:cbp $theCmpl $theOutDir $aProjName $thePlatform $aTKSrcFiles $aUsedLibs $aFrameworks $anIncPaths $aTKDefines $isExecutable] } return $aCbpFiles @@ -2093,9 +2030,8 @@ proc osutils:cbpx { theCmpl theOutDir theToolKit } { # @param theIncPaths - header search paths # @param theDefines - compiler macro definitions # @param theIsExe - flag to indicate executable / library target -proc osutils:cbp { theCmpl theOutDir theProjName theSrcFiles theLibsList theFrameworks theIncPaths theDefines {theIsExe "false"} } { - global targetStation - set aWokStation "$targetStation" +proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibsList theFrameworks theIncPaths theDefines {theIsExe "false"} } { + set aWokStation $thePlatform set aWokArch "$::env(ARCH)" set aCmplCbp "gcc" @@ -2469,7 +2405,7 @@ proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection set aDepToolkits [lappend [wokUtils:LIST:Purge [osutils:tk:close $theToolKit]] $theToolKit] if { "$theTargetType" == "executable" } { - set aFile [osutils:tk:files $theToolKit osutils:compilable 0] + set aFile [osutils:tk:files $theToolKit mac] set aProjName [file rootname [file tail $aFile]] set aDepToolkits [LibToLinkX $theToolKit $aProjName] } @@ -2535,7 +2471,7 @@ proc osutils:xcdtk:sources {theToolKit theTargetType theSrcFileRefSection theGro set aGuidsMap($aPackage) [OS:genGUID "xcd"] } - set aSrcFiles [osutils:tk:files $xlo osutils:compilable 0] + set aSrcFiles [osutils:tk:files $xlo mac] foreach aSrcFile [lsort $aSrcFiles] { set aFileExt "sourcecode.cpp.cpp" diff --git a/adm/templates/codeblocks.bat b/adm/templates/codeblocks.bat index f70d479742..b4a72871f9 100644 --- a/adm/templates/codeblocks.bat +++ b/adm/templates/codeblocks.bat @@ -11,6 +11,7 @@ if not "%4" == "" ( ) if "%CB_PATH%"=="" if exist "%PROGRAMFILES%\CodeBlocks" set "CB_PATH=%PROGRAMFILES%\CodeBlocks\codeblocks.exe" +if "%CB_PATH%"=="" if exist "%PROGRAMFILES(x86)%\CodeBlocks" set "CB_PATH=%PROGRAMFILES(x86)%\CodeBlocks\codeblocks.exe" if "%CB_PATH%"=="" set "CB_PATH=codeblocks.exe" set "CASBIN=wnt\cbp" diff --git a/dox/dev_guides/building/code_blocks.md b/dox/dev_guides/building/code_blocks.md index 571382a5f2..a370c09dbb 100644 --- a/dox/dev_guides/building/code_blocks.md +++ b/dox/dev_guides/building/code_blocks.md @@ -6,7 +6,7 @@ Building with Code::Blocks {#occt_dev_guides__building_code_blocks} @section build_codeblocks_intro General This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using project files generated by OCCT legacy tool **genproj**. -It can be an alternative to use of CMake build system (see @ref occt_dev_guides__building_cmake) for all supported platforms. +It can be used as an alternative to CMake build system (see @ref occt_dev_guides__building_cmake) for all supported platforms. @section build_codeblocks_3rdparty Third-party libraries @@ -34,11 +34,11 @@ Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* @section build_codeblocks_gen Projects generation -Launch **genproj** tool with option *-target=cbp* to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files: +Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files: ~~~~~ $ cd /dev/OCCT/opencascade-7.0.0 - $ ./genproj.sh -target=cbp + $ ./genproj cbp ~~~~~ The generated Code::Blocks project are placed into subfolder *adm/<OS>/cbp*. diff --git a/dox/dev_guides/building/xcode.md b/dox/dev_guides/building/xcode.md index cf98ae8c38..023090051b 100644 --- a/dox/dev_guides/building/xcode.md +++ b/dox/dev_guides/building/xcode.md @@ -43,7 +43,7 @@ For instance, in Terminal application: ~~~~~ $ cd /dev/OCCT/opencascade-7.0.0 - $ ./genproj.sh + $ ./genproj ~~~~~ @section build_xcode_build Building diff --git a/genproj b/genproj index dff8537380..745157aba7 100755 --- a/genproj +++ b/genproj @@ -37,7 +37,8 @@ source "${aScriptPath}/custom.sh" if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi -tclsh "${aScriptPath}/adm/start.tcl" genproj -path="${aScriptPath}" -target=${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5 +cd $aScriptPath +tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5 export PATH="$anOldPath" export LD_LIBRARY_PATH="$anOldLd" diff --git a/genproj.bat b/genproj.bat index f931114dfc..aa4296a97f 100644 --- a/genproj.bat +++ b/genproj.bat @@ -2,6 +2,9 @@ rem Helper script to run generation of VS projects on Windows. rem Running it requires that Tcl should be in the PATH +rem Optional arguments: IDE OS +rem IDE can be vc10, vc11, vc12, vc14, cbp, or xcd +rem OS can be wnt, mac, or lin SET "OLD_PATH=%PATH%" @@ -17,7 +20,7 @@ if not exist "%~dp0custom.bat" ( ) if exist "%~dp0env.bat" ( - call "%~dp0env.bat" + call "%~dp0env.bat" %1 ) rem find Tcl @@ -39,5 +42,5 @@ if not defined TCL_FOUND ( ) cd %~dp0 -%TCL_EXEC% %~dp0adm/start.tcl genproj -path=. -target=%VCVER% +%TCL_EXEC% %~dp0adm/start.tcl genproj %VCVER% %2 %3 %4 %5 SET "PATH=%OLD_PATH%"