Skip to content

Commit

Permalink
Add CMake support libs-for-testing. (#8265)
Browse files Browse the repository at this point in the history
- Note that, since the package manager depends on `omc` itself, you would
   have to build and INSTALL `omc` before you can install the libraries.
  • Loading branch information
mahge committed Dec 6, 2021
1 parent 6e1c39c commit 0616ea8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -126,6 +126,7 @@ omc_add_subdirectory(OMNotebook EXCLUDE_FROM_ALL)

include(omsimulator.cmake)
omc_add_subdirectory(OMEdit EXCLUDE_FROM_ALL)
omc_add_subdirectory(testsuite EXCLUDE_FROM_ALL)
# omc_add_subdirectory(libraries)


Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/CMakeLists.txt
Expand Up @@ -273,6 +273,6 @@ install(DIRECTORY scripts
# or 'cmake --build <b_dir> --target install_omc' in the general case.
add_custom_target(install_omc
DEPENDS omc
COMMAND ${CMAKE_COMMAND} cmake -DCOMPONENT=compiler -P cmake_install.cmake
COMMAND ${CMAKE_COMMAND} -DCOMPONENT=compiler -P cmake_install.cmake
COMMENT "Installing omc."
)
3 changes: 2 additions & 1 deletion testsuite/CMakeLists.txt
@@ -1 +1,2 @@
ADD_SUBDIRECTORY(mofiles)

omc_add_subdirectory(libraries-for-testing)
14 changes: 14 additions & 0 deletions testsuite/libraries-for-testing/CMakeLists.txt
@@ -0,0 +1,14 @@


set(STAMP 20200610130629.stamp)

# Note that omc needs to be built and INSTALLED before you can add the libs for testing.
# The reason being omc needs to be ina folder **/bin to work. Otherwise it will refuse to run
# Plus it needs to know where find the shared libs it needs. That is structured to work for install.
add_custom_target(libs-for-testing
COMMAND ${CMAKE_COMMAND} -E remove_directory .openmodelica/libraries
COMMAND ${CMAKE_COMMAND} -E make_directory .openmodelica/libraries
COMMAND ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/omc -d=showStatement index.mos

WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

0 comments on commit 0616ea8

Please sign in to comment.