Skip to content

Commit

Permalink
fix CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
Amazingkivas committed Nov 1, 2023
1 parent b19bb0c commit 9e6800c
Show file tree
Hide file tree
Showing 26 changed files with 1,455 additions and 819 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ include_directories(include gtest)
add_subdirectory(include)
add_subdirectory(samples)
add_subdirectory(test)
add_subdirectory(gtest)
add_subdirectory(gtest)

set_target_properties(FDTD PROPERTIES
FOLDER "sln")

configure_file(${CMAKE_SOURCE_DIR}/FDTD.sln ${CMAKE_BINARY_DIR}/sln/FDTD.sln COPYONLY)
Binary file added PlotScript/src/Release/sample.exe
Binary file not shown.
10 changes: 9 additions & 1 deletion gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ if((${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" OR
set(pthread "-pthread")
endif()

target_link_libraries(${target} ${pthread})
add_compile_options(/wd4996)

target_link_libraries(${target} ${pthread})

set_target_properties(${target} PROPERTIES
FOLDER "sln")

configure_file(${CMAKE_SOURCE_DIR}/gtest/gtest.vcxproj ${CMAKE_BINARY_DIR}/sln/gtest/gtest.vcxproj COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/gtest/gtest.vcxproj.filters ${CMAKE_BINARY_DIR}/sln/gtest/gtest.vcxproj.filters COPYONLY)
9 changes: 8 additions & 1 deletion samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
file(GLOB hdrs "*.h*" "../include/*.h")
file(GLOB srcs "*.cpp" "../src/*.cpp")

add_executable(FDTD ${srcs} ${hdrs})
add_executable(sample ${srcs} ${hdrs})
set_target_properties(sample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/PlotScript/src")

set_target_properties(sample PROPERTIES
FOLDER "sln")

configure_file(${CMAKE_SOURCE_DIR}/samples/sample.vcxproj ${CMAKE_BINARY_DIR}/sln/samples/sample.vcxproj COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/samples/sample.vcxproj.filters ${CMAKE_BINARY_DIR}/sln/samples/sample.vcxproj.filters COPYONLY)
4 changes: 2 additions & 2 deletions samples/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ double max_abs_error_x(Field& this_field, int size_N[2], double size_x[2], doubl
int j = 0;
for (int i = 0; i < this_field.get_Ni(); ++i, x += size_d[0])
{
double this_n = fabs(this_field(i, j) - sign * sin(2.0 * M_PI * (x - size_x[0] - FDTD_Const::C * t) / (size_x[1] - size_x[0])));
double this_n = fabs(sign * this_field(i, j) - sin(2.0 * M_PI * (x - size_x[0] - FDTD_Const::C * t) / (size_x[1] - size_x[0])));
if (this_n > extr_n)
extr_n = this_n;
}
Expand All @@ -119,7 +119,7 @@ double max_abs_error_y(Field& this_field, int size_N[2], double size_y[2], doubl
int i = 0;
for (int j = 0; j < this_field.get_Nj(); ++j, y += size_d[1])
{
double this_n = fabs(this_field(i, j) - sign * sin(2.0 * M_PI * (y - size_y[0] - FDTD_Const::C * t) / (size_y[1] - size_y[0])));
double this_n = fabs(sign * this_field(i, j) - sin(2.0 * M_PI * (y - size_y[0] - FDTD_Const::C * t) / (size_y[1] - size_y[0])));
if (this_n > extr_n)
extr_n = this_n;
}
Expand Down
96 changes: 96 additions & 0 deletions sln/FDTD.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{59D02B1D-55B8-3DB8-9515-97EB63E56A31}"
ProjectSection(ProjectDependencies) = postProject
{F08A1823-B3B2-357E-988D-41023F3918E4} = {F08A1823-B3B2-357E-988D-41023F3918E4}
{39E4FCC4-A034-3B5C-8B3F-356919E55680} = {39E4FCC4-A034-3B5C-8B3F-356919E55680}
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7} = {F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7} = {F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}
{0AF53429-B9B1-3C84-9836-4D808277580E} = {0AF53429-B9B1-3C84-9836-4D808277580E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FDTD", "include\FDTD.vcxproj", "{F08A1823-B3B2-357E-988D-41023F3918E4}"
ProjectSection(ProjectDependencies) = postProject
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7} = {F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FDTD_test", "test\FDTD_test.vcxproj", "{39E4FCC4-A034-3B5C-8B3F-356919E55680}"
ProjectSection(ProjectDependencies) = postProject
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7} = {F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7} = {F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest\gtest.vcxproj", "{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}"
ProjectSection(ProjectDependencies) = postProject
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7} = {F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "samples\sample.vcxproj", "{0AF53429-B9B1-3C84-9836-4D808277580E}"
ProjectSection(ProjectDependencies) = postProject
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7} = {F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
MinSizeRel|x64 = MinSizeRel|x64
RelWithDebInfo|x64 = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{59D02B1D-55B8-3DB8-9515-97EB63E56A31}.Debug|x64.ActiveCfg = Debug|x64
{59D02B1D-55B8-3DB8-9515-97EB63E56A31}.Release|x64.ActiveCfg = Release|x64
{59D02B1D-55B8-3DB8-9515-97EB63E56A31}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{59D02B1D-55B8-3DB8-9515-97EB63E56A31}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.Debug|x64.ActiveCfg = Debug|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.Debug|x64.Build.0 = Debug|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.Release|x64.ActiveCfg = Release|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.Release|x64.Build.0 = Release|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{F08A1823-B3B2-357E-988D-41023F3918E4}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.Debug|x64.ActiveCfg = Debug|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.Debug|x64.Build.0 = Debug|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.Release|x64.ActiveCfg = Release|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.Release|x64.Build.0 = Release|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{39E4FCC4-A034-3B5C-8B3F-356919E55680}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.Debug|x64.ActiveCfg = Debug|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.Debug|x64.Build.0 = Debug|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.Release|x64.ActiveCfg = Release|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.Release|x64.Build.0 = Release|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{F7EDEBF2-518F-3519-A641-E2EB02DBF9B7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.Debug|x64.ActiveCfg = Debug|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.Debug|x64.Build.0 = Debug|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.Release|x64.ActiveCfg = Release|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.Release|x64.Build.0 = Release|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{F922B38C-8C9E-3927-9F70-7DD13CB3E3B7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.Debug|x64.ActiveCfg = Debug|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.Debug|x64.Build.0 = Debug|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.Release|x64.ActiveCfg = Release|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.Release|x64.Build.0 = Release|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{0AF53429-B9B1-3C84-9836-4D808277580E}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {15C4505B-94F7-33A9-AAA1-BCCD44AA457F}
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
61 changes: 0 additions & 61 deletions sln/FDTD/FDTD.sln

This file was deleted.

Loading

0 comments on commit 9e6800c

Please sign in to comment.