Changeset d4a68940 in OpenModelica
- Timestamp:
- 2020-10-21T14:04:18+02:00 (3 years ago)
- 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)
- Location:
- OMCompiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/CMakeLists.txt
r88b5250f rd4a68940 215 215 DESTINATION ${CMAKE_INSTALL_LIBDIR}/omc 216 216 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. 223 add_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 8 8 However, 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. 9 9 10 # How to build10 # Usage 11 11 **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._** 12 12 13 ## Build 13 14 It is pretty straightforward cmake stuff. 14 15 … … 28 29 # omc will be generated in <build_dir>/Compiler/ 29 30 $ <build_dir>/Compiler/omc --help 31 ``` 30 32 31 # Install the files if you want 32 $ cmake -DCOMPONENT=compiler -P cmake_install.cmake # to just install omc 33 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 below or copy or move the generated omc into a folder called <something>/bin for now. 34 35 # Install 36 37 CMake uses a separate script (cmake_install.cmake) to perform installation. Since we are used to issuing 'make install' by default, CMake 38 provides 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 40 If 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 33 49 # $ 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 35 52 36 53 # omc will be installed in <install_dir>/bin/ … … 38 55 ``` 39 56 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._42 57 43 58 ###### Installation can be buggy. It will be improved.
Note: See TracChangeset
for help on using the changeset viewer.