Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VirtualFluids
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iRMB
VirtualFluids
Commits
8fcf5ed3
Commit
8fcf5ed3
authored
4 years ago
by
Soeren Peters
Browse files
Options
Downloads
Patches
Plain Diff
Small clean up.
parent
fb2675f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMake/3rd/gmock.cmake
+5
-5
5 additions, 5 deletions
CMake/3rd/gmock.cmake
CMake/VirtualFluidsMacros.cmake
+31
-12
31 additions, 12 deletions
CMake/VirtualFluidsMacros.cmake
CMakeLists.txt
+3
-2
3 additions, 2 deletions
CMakeLists.txt
with
39 additions
and
19 deletions
CMake/3rd/gmock.cmake
+
5
−
5
View file @
8fcf5ed3
...
...
@@ -3,10 +3,10 @@
add_definitions
(
-DGTEST_LINKED_AS_SHARED_LIBRARY
)
endif
()
vf_get_library_test_name
(
library_name
)
target_include_directories
(
${
library_name
}
PRIVATE
${
GMOCK_ROOT
}
/googlemock/include
)
target_include_directories
(
${
library_name
}
PRIVATE
${
GMOCK_ROOT
}
/googletest/include
)
target_include_directories
(
${
targetName
}
PRIVATE
${
GMOCK_ROOT
}
/googlemock/include
)
target_include_directories
(
${
targetName
}
PRIVATE
${
GMOCK_ROOT
}
/googletest/include
)
target_link_directories
(
${
library_name
}
PRIVATE
${
GMOCK_ROOT
}
/build/lib
)
target_link_directories
(
${
targetName
}
PRIVATE
${
GMOCK_ROOT
}
/build/lib
)
target_link_libraries
(
${
targetName
}
PRIVATE gtest gmock gmock_main
)
target_link_libraries
(
${
library_name
}
PRIVATE gtest gmock gmock_main
)
This diff is collapsed.
Click to expand it.
CMake/VirtualFluidsMacros.cmake
+
31
−
12
View file @
8fcf5ed3
...
...
@@ -7,6 +7,10 @@
#
#################################################################################
function
(
status msg
)
message
(
STATUS
" VF --
${
msg
}
"
)
endfunction
()
#################################################################################
## set global project file endings
#################################################################################
...
...
@@ -25,7 +29,17 @@ set (VIRTUAL_FLUIDS_GLOB_FILES
function
(
vf_get_library_name library_name
)
get_filename_component
(
library_name_out
${
CMAKE_CURRENT_SOURCE_DIR
}
NAME
)
set
(
${
library_name
}
${
library_name_out
}
PARENT_SCOPE
)
endfunction
(
vf_get_library_name
)
endfunction
()
#################################################################################
## Sets the library test name to the current folder name + Tests.
## output parameter: library_test_name
#################################################################################
function
(
vf_get_library_test_name library_test_name
)
vf_get_library_name
(
folder_name
)
set
(
${
library_test_name
}
${
library_name
}
Tests PARENT_SCOPE
)
endfunction
()
#################################################################################
...
...
@@ -54,6 +68,7 @@ function(vf_add_library)
#message("Files: ${ARG_FOLDER}")
vf_get_library_name
(
library_name
)
message
(
"LIB NAME:
${
library_name
}
"
)
if
(
ARG_FILES
)
...
...
@@ -204,7 +219,7 @@ function(vf_add_library)
target_include_directories
(
${
library_name
}
PRIVATE
${
CMAKE_SOURCE_DIR
}
/src
)
endfunction
(
vf_add_library
)
endfunction
()
...
...
@@ -212,32 +227,36 @@ endfunction(vf_add_library)
## Add a test executable corresponding to the added target.
## Must be called after vf_add_library().
## The name of the test executable is: vf_get_library_name()Tests
##
## Precondition: BUILD_VF_UNIT_TESTS needs to be ON
#################################################################################
function
(
vf_add_tests
)
if
(
NOT BUILD_VF_UNIT_TESTS
)
return
()
endif
()
vf_get_library_test_name
(
library_test_name
)
vf_get_library_name
(
folder_name
)
set
(
targetName
${
folder_name
}
Tests
)
message
(
Add Test binary:
${
targetName
}
)
status
(
"Add test executable:
${
library_test_name
}
"
)
file
(
GLOB_RECURSE all_files
${
VIRTUAL_FLUIDS_GLOB_FILES
}
)
set
(
sourceFiles
${
sourceFiles
}
${
all_files
}
)
includeTestFiles
(
${
folder_name
}
"
${
sourceFiles
}
"
)
message
(
${
MY_SRCS
}
)
add_executable
(
${
targetName
}
${
MY_SRCS
}
)
cmake_print_variables
(
MY_SRCS
)
target_link_libraries
(
${
targetName
}
PRIVATE
${
folder_name
}
)
add_executable
(
${
library_test_name
}
${
MY_SRCS
}
)
target_include_directories
(
${
targetName
}
PRIVATE
${
CMAKE_BINARY_DIR
}
)
target_include_directories
(
${
targetName
}
PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
)
target_include_directories
(
${
targetName
}
PRIVATE
${
CMAKE_SOURCE_DIR
}
/src
)
target_link_libraries
(
${
library_test_name
}
PRIVATE
${
folder_name
}
)
target_include_directories
(
${
library_test_name
}
PRIVATE
${
CMAKE_BINARY_DIR
}
)
target_include_directories
(
${
library_test_name
}
PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
)
target_include_directories
(
${
library_test_name
}
PRIVATE
${
CMAKE_SOURCE_DIR
}
/src
)
include
(
${
CMAKE_PATH
}
/3rd/gmock.cmake
)
#add_compile_options (-std=c++11)
add_definitions
(
"-std=c++11"
)
endfunction
(
vf_add_tests
)
\ No newline at end of file
endfunction
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
3
−
2
View file @
8fcf5ed3
...
...
@@ -31,6 +31,7 @@ set (CMAKE_PATH "${CMAKE_SOURCE_DIR}/CMake")
include
(
"
${
CMAKE_PATH
}
/CMakeCABMacros.cmake"
)
include
(
"
${
CMAKE_PATH
}
/FileUtilities.cmake"
)
include
(
"
${
CMAKE_PATH
}
/VirtualFluidsMacros.cmake"
)
include
(
CMakePrintHelpers
)
#################################################################################
# COMMON LIBRARIES
...
...
@@ -41,9 +42,9 @@ add_subdirectory(src/basics)
# VIRTUAL FLUIDS CPU / GPU
#################################################################################
#if (BUILD_VF_CPU)
#
include (cpu.cmake)
include
(
cpu.cmake
)
#endif()
#if(BUILD_VF_GPU)
include
(
gpu.cmake
)
#
include (gpu.cmake)
#endif()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment