proc OS:MKCMK { theOutDir {theModules {}} {theAllSolution ""} } {
puts stderr "Generating CMake meta project"
+ set anSubPath "adm/cmake"
set anOutFileName "CMakeLists.txt"
set aProjectName $theAllSolution
regsub -all -- {__PROJECT_NAME__} $theProjTmpl $aProjectName theProjTmpl
regsub -all -- {__BITNESS__} $theProjTmpl $::env(ARCH) theProjTmpl
regsub -all -- {__WOK_LIB_PATH__} $theProjTmpl [file normalize $::env(WOK_LIBRARY)] theProjTmpl
- regsub -all -- {__CASROOT_DIR__} $theProjTmpl "../.." theProjTmpl
-
set aBuff [list]
foreach aModule $theModules {
foreach aModule $theModules {
foreach aToolKit [${aModule}:toolkits] {
#create directory
- if {![file exists "$theOutDir/$aToolKit"]} {
- file mkdir "$theOutDir/$aToolKit"
+ if {![file exists "$theOutDir/$anSubPath/$aToolKit"]} {
+ file mkdir "$theOutDir/$anSubPath/$aToolKit"
}
#add directory to main cmake metafile
- lappend aBuff "subdirs(${aToolKit})"
+ lappend aBuff "subdirs($anSubPath/${aToolKit})"
# create cmake metafile into target subdir
- osutils:cmktk $theOutDir $aToolKit false ${aModule}
+ osutils:cmktk $theOutDir/$anSubPath $aToolKit false ${aModule}
}
foreach anExecutable [OS:executable ${aModule}] {
#create directory
- if {![file exists "$theOutDir/$anExecutable"]} {
- file mkdir "$theOutDir/$anExecutable"
+ if {![file exists "$theOutDir/$anSubPath/$anExecutable"]} {
+ file mkdir "$theOutDir/$anSubPath/$anExecutable"
}
#add directory to main cmake metafile
- lappend aBuff "subdirs(${anExecutable})"
+ lappend aBuff "subdirs($anSubPath/${anExecutable})"
# create cmake metafile into target subdir
- osutils:cmktk $theOutDir $anExecutable true ${aModule}
+ osutils:cmktk $theOutDir/$anSubPath $anExecutable true ${aModule}
}
}
regsub -all -- {__INCLUDE_TOOLKITS__} $theProjTmpl [join $aBuff "\n"] theProjTmpl
puts $aFile $theProjTmpl
close $aFile
- puts "The Cmake meta-files are stored in the $theOutDir directory"
+ puts "The Cmake meta-files are stored in the [file normalize $theOutDir] and [file normalize $theOutDir/$anSubPath] directories"
}
# Generates Code Blocks workspace.
"vc10" -
"vc11" { OS:MKVC $anOutDir $aModules $anAllSolution $theIDE }
"cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution }
- "cmake" { OS:MKCMK "${anOutRoot}/${theIDE}" $aModules $anAllSolution }
+ "cmake" { OS:MKCMK "${anOutRoot}/.." $aModules $anAllSolution }
"amk" { OS:MKAMK $anOutDir $aModules "adm/${aWokStation}/${theIDE}"}
"xcd" {
set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000"
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/bin)
# RESOURCES
-install(DIRECTORY "__CASROOT_DIR__/src/DrawResources" DESTINATION "${INSTALL_DIR}/res" )
-install(DIRECTORY "__CASROOT_DIR__/src/StdResource" DESTINATION "${INSTALL_DIR}/res" )
-install(DIRECTORY "__CASROOT_DIR__/src/SHMessage" DESTINATION "${INSTALL_DIR}/res" )
-install(DIRECTORY "__CASROOT_DIR__/src/Textures" DESTINATION "${INSTALL_DIR}/res" )
-install(DIRECTORY "__CASROOT_DIR__/src/XSMessage" DESTINATION "${INSTALL_DIR}/res" )
-install(DIRECTORY "__CASROOT_DIR__/src/TObj" DESTINATION "${INSTALL_DIR}/res" )
-install(DIRECTORY "__CASROOT_DIR__/src/XSTEPResource" DESTINATION "${INSTALL_DIR}/res" )
-install(DIRECTORY "__CASROOT_DIR__/src/XmlOcafResource" DESTINATION "${INSTALL_DIR}/res" )
-
-install(FILES "__CASROOT_DIR__/src/UnitsAPI/Lexi_Expr.dat" DESTINATION "${INSTALL_DIR}/res/UnitsAPI" )
-install(FILES "__CASROOT_DIR__/src/UnitsAPI/Units.dat" DESTINATION "${INSTALL_DIR}/res/UnitsAPI" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/DrawResources" DESTINATION "${INSTALL_DIR}/res" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/StdResource" DESTINATION "${INSTALL_DIR}/res" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/SHMessage" DESTINATION "${INSTALL_DIR}/res" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/Textures" DESTINATION "${INSTALL_DIR}/res" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSMessage" DESTINATION "${INSTALL_DIR}/res" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/TObj" DESTINATION "${INSTALL_DIR}/res" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSTEPResource" DESTINATION "${INSTALL_DIR}/res" )
+install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XmlOcafResource" DESTINATION "${INSTALL_DIR}/res" )
+
+install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Lexi_Expr.dat" DESTINATION "${INSTALL_DIR}/res/UnitsAPI" )
+install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Units.dat" DESTINATION "${INSTALL_DIR}/res/UnitsAPI" )
IF("${BUILD_TYPE}" STREQUAL "Release")
SET(BUILD_SUFFIX "")
MESSAGE(FATAL_ERROR "INSTALL_DIR is empty")
ELSE()
# INC DIRECTORY
- install(DIRECTORY __CASROOT_DIR__/inc DESTINATION "${INSTALL_DIR}" )
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/inc DESTINATION "${INSTALL_DIR}" )
# DRAW.BAT or DRAW.SH
- install(FILES draw.${SCRIPT_EXT} DESTINATION "${INSTALL_DIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ install(FILES "${CMAKE_SOURCE_DIR}/adm/cmake/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_WRITE WORLD_EXECUTE)
- configure_file(env.${SCRIPT_EXT}.in env.${SCRIPT_EXT} @ONLY)
+ configure_file("${CMAKE_SOURCE_DIR}/adm/cmake/env.${SCRIPT_EXT}.in" env.${SCRIPT_EXT} @ONLY)
install(FILES "${__PROJECT_NAME___BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" )
ENDIF()
SET(RUN_PROJECT "start __PROJECT_NAME__.sln")
SET(BIN_DIR_POSTFIX "out\\bin\\Debug")
SET(RESOURCE_DIR_PREFIX "%CASROOT%\\src")
- SET(CASROOT_DEFINITION "set \"CASROOT=__CASROOT_DIR__\"")
+ SET(CASROOT_DEFINITION "set \"CASROOT=${CMAKE_SOURCE_DIR}\"")
- configure_file(env.bat.in __PROJECT_NAME__.bat @ONLY)
+ configure_file("${CMAKE_SOURCE_DIR}/adm/cmake/env.bat.in" __PROJECT_NAME__.bat @ONLY)
ENDIF()
__TOOLKIT_DEPS__