Skip to content

Commit

Permalink
Clean up build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristopherson committed Oct 2, 2020
1 parent 1135d15 commit 5c8cacc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)

if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
# gfortran
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3")
set(CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -Wall -Wno-surprising")
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3 -Wl,--allow-multiple-definition")
set(CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -Wall -Wno-surprising -Wl,--allow-multiple-definition")
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
# ifort (untested)
set(CMAKE_Fortran_FLAGS_RELEASE "-f77rtl -O3")
Expand Down
31 changes: 5 additions & 26 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,25 @@
# Link in dependencies necessary to generate plots
find_package(fplot)
find_package(ferror 1.3.0)
find_package(collections)
find_package(fcore)

# Van Der Pol Example
add_executable(vanderpol vanderpol.f90)
target_link_libraries(vanderpol integral fplot)
target_link_libraries(vanderpol integral fplot fcore)

# Lorenz Example
add_executable(lorenz lorenz.f90)
target_link_libraries(lorenz integral fplot)
target_link_libraries(lorenz integral fplot fcore)

# Bouncing Ball Example
add_executable(bouncing_ball bouncing_ball.f90)
target_link_libraries(bouncing_ball integral fplot)
target_link_libraries(bouncing_ball integral fplot fcore)

# Integral Example 1
add_executable(integral_example_1 integral_example_1.f90)
target_link_libraries(integral_example_1 integral)

# Pendulum Example
add_executable(pendulum pendulum.f90)
target_link_libraries(pendulum integral fplot)
target_link_libraries(pendulum integral fplot fcore)

# ------------------------------------------------------------------------------
if (WIN32)
# Copy shared libraries necessary to generate plots to the runtime directory
get_target_property(ferror_LibLocation ferror LOCATION)
add_custom_command(TARGET vanderpol POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ferror_LibLocation} $<TARGET_FILE_DIR:vanderpol>
)

get_target_property(fplot_LibLocation fplot LOCATION)
add_custom_command(TARGET vanderpol POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${fplot_LibLocation} $<TARGET_FILE_DIR:vanderpol>
)

get_target_property(collections_LibLocation collections LOCATION)
add_custom_command(TARGET vanderpol POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${collections_LibLocation} $<TARGET_FILE_DIR:vanderpol>
)
endif()

0 comments on commit 5c8cacc

Please sign in to comment.