Skip to content

Commit

Permalink
Add GTA Run Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeu committed Aug 14, 2024
1 parent 5f67c7c commit 5fb7d38
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<GoogleTestAdapterSettings>
<SolutionSettings>
<Settings>
<WorkingDir>@MODELICA_TABLE_ADDITIONS_TEST_DIR@</WorkingDir>
</Settings>
</SolutionSettings>
</GoogleTestAdapterSettings>
</RunSettings>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
project(${CMAKE_PROJECT_NAME}Tests CXX)
project(${CMAKE_PROJECT_NAME} CXX)

# Set up GoogleTest
include(FetchContent)

FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
GIT_TAG v1.15.2
)

# For Windows: Prevent overriding the parent project's compiler/linker settings
Expand Down Expand Up @@ -89,6 +89,11 @@ if(EXISTS "${MODELICA_TABLE_ADDITIONS_TEST_DIR}")
WORKING_DIRECTORY "${MODELICA_TABLE_ADDITIONS_TEST_DIR}"
)
endforeach()
configure_file(
${CMAKE_SOURCE_DIR}/BuildProjects/CMake/Modelica_Table_Additions.gta.runsettings.in
${CMAKE_BINARY_DIR}/Modelica_Table_Additions.gta.runsettings
@ONLY
)
else()
message(WARNING
" Testsuite not found in \"${MODELICA_TABLE_ADDITIONS_TEST_DIR}\"."
Expand Down
8 changes: 5 additions & 3 deletions ModelicaTableAdditions/Resources/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.21)

if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
Expand All @@ -12,7 +12,6 @@ project(Modelica_Table_Additions C)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

include(BuildProjects/CMake/Modelica_platform.cmake)
include(BuildProjects/CMake/Modelica_utilities.cmake)

set(MODELICA_TABLE_ADDITIONS_RESOURCES_DIR "${CMAKE_SOURCE_DIR}")
set(CMAKE_INSTALL_PREFIX "${MODELICA_TABLE_ADDITIONS_RESOURCES_DIR}" CACHE PATH "Library installation prefix path (don't change)" FORCE)
Expand All @@ -25,7 +24,10 @@ include(BuildProjects/CMake/options.cmake)

if(BUILD_TESTING)
enable_testing()
include(CTest)
if(PROJECT_IS_TOP_LEVEL)
include(CTest)
endif()
include(BuildProjects/CMake/Modelica_utilities.cmake)
include(BuildProjects/CMake/test.cmake)
endif()

Expand Down

0 comments on commit 5fb7d38

Please sign in to comment.