Changeset d4a68940 in OpenModelica


Ignore:
Timestamp:
2020-10-21T14:04:18+02:00 (3 years ago)
Author:
Mahder Gebremedhin <mahder.gebremedhin@…>
Children:
d36146f
Parents:
a7fdcec
git-author:
Mahder Gebremedhin <mahder.gebremedhin@…> (10/19/20 12:01:13)
git-committer:
Mahder Gebremedhin <mahder.gebremedhin@…> (10/21/20 14:04:18)
Message:

[cmake] Add a custom install target 'install_omc'.

  • This target builds and installs just omc. It is provided just for convenience to allow people to use something similar to what they are used to do , that is issue 'make install_omc', instead of having to run CMake's separate installation script.
Location:
OMCompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/CMakeLists.txt

    r88b5250f rd4a68940  
    215215            DESTINATION ${CMAKE_INSTALL_LIBDIR}/omc
    216216            COMPONENT compiler)
     217
     218
     219# This is a convenience target to install omc. We are used to issuing 'make install' to install
     220# components. CMake uses a separate install script to perform installations. This custom command
     221# runs that cmake script so that you can just write 'make install' (for makefile generators)
     222# or 'cmake --build <b_dir> --target install_omc' in the general case.
     223add_custom_target(install_omc
     224                  DEPENDS omc
     225                  COMMAND ${CMAKE_COMMAND} cmake -DCOMPONENT=compiler -P cmake_install.cmake
     226                  COMMENT "Installing omc."
     227                  )
  • OMCompiler/README.cmake.md

    ra7fdcec rd4a68940  
    88However, this does not mean that you will need CMake > 3.14 to compile and use OpenModelica as you do now. You should **still be able to compile OpenModelica using the current Makefile based and/or auto-tools based build system** that we are using at the moment even if you have CMake 2.6.
    99
    10 # How to build
     10# Usage
    1111**NOTE**: **_This does not yet support bootstrapping AND it also needs an omc with an UPDATED scripting API from this branch itself. This means, after you switch to this branch, you will have to **COMPILE omc ONCE** with the build method that you are currently using. Afterwards you can use the omc generated by this for further MetaModelica compilations._**
    1212
     13## Build
    1314It is pretty straightforward cmake stuff.
    1415
     
    2829# omc will be generated in <build_dir>/Compiler/
    2930$ <build_dir>/Compiler/omc --help
     31```
    3032
    31 # Install the files if you want
    32 $ cmake -DCOMPONENT=compiler -P cmake_install.cmake # to just install omc
     33If you are on Linux like systems omc will check if it is in a folder whose path includes `/bin` or `/lib`. If it is not, it will tell you to update your OPENMODELICAHOME env variable.  Instead, you can just INSTALL the files as shown below or copy or move the generated omc into a folder called <something>/bin for now.
     34
     35# Install
     36
     37CMake uses a separate script (cmake_install.cmake) to perform installation. Since we are used to issuing 'make install' by default, CMake
     38provides an specific built-in 'install' target. However, this target implies a **full build and full install**. That is you have no control on which parts you want to install. If this is what you want to do you can use that.
     39
     40If you are working on just omc and do not need the whole set of *simulation runtime* libraries built and installed, there is a custom target `install_omc` provided which will build and install what is needed to run omc.
     41
     42```
     43# Build and Install just omc
     44# $ make install_omc # For makefile generators
     45# $ cmake --build <build_dir> --target install_omc # Generic usage.
     46# $ cmake -DCOMPONENT=compiler -P cmake_install.cmake # The equivalent cmake_install invocation
     47
     48# Build and Install everything
    3349# $ make install # NOTE: This will first build everything. Not just omc.
    34 # $ cmake -P cmake_install.cmake # to install everything that is built
     50# $ cmake --build <build_dir> --target install # Generic usage.
     51# $ cmake -P cmake_install.cmake # The equivalent cmake_install invocation
    3552
    3653# omc will be installed in <install_dir>/bin/
     
    3855```
    3956
    40 
    41 **NOTE**: _if you are on Linux like systems omc will check if it is in a folder whose path includes `/bin` or `/lib`. If it is not, it will tell you to update your OPENMODELICAHOME env variable.  Instead, you can just INSTALL the files as shown above or copy or move the generated omc into a folder called <something>/bin for now._
    4257
    4358###### Installation can be buggy. It will be improved.
Note: See TracChangeset for help on using the changeset viewer.