Skip to content

Commit

Permalink
Clean up Chrono demos
Browse files Browse the repository at this point in the history
  • Loading branch information
rserban committed Dec 9, 2024
1 parent 0147921 commit a032615
Show file tree
Hide file tree
Showing 3 changed files with 747 additions and 593 deletions.
45 changes: 30 additions & 15 deletions src/demos/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#--------------------------------------------------------------
# Add executables

SET(DEMOS
set(DEMOS
demo_CH_coords
demo_CH_linalg
demo_CH_matrix_ref
Expand All @@ -15,23 +15,38 @@ SET(DEMOS
demo_CH_filesystem
)

#--------------------------------------------------------------

# Set include paths, compiler & linker flags, and libraries

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

include_directories(${CH_INCLUDES})
set(COMPILER_FLAGS "${CH_CXX_FLAGS}")
set(LINKER_FLAGS "${CH_LINKERFLAG_EXE}")
list(APPEND LIBS "ChronoEngine")

if(ENABLE_MODULE_PARDISO_MKL)
include_directories(${CH_MKL_INCLUDES})
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${CH_MKL_CXX_FLAGS}")
set(LINKER_FLAGS "${LINKER_FLAGS} ${CH_MKL_LINK_FLAGS}")
list(APPEND LIBS "ChronoEngine_pardisomkl")
endif()

#--------------------------------------------------------------

MESSAGE(STATUS "Demo programs for CORE module...")
message(STATUS "Demo programs for CORE module...")

FOREACH(PROGRAM ${DEMOS})
MESSAGE(STATUS "...add ${PROGRAM}")
foreach(PROGRAM ${DEMOS})
message(STATUS "...add ${PROGRAM}")

ADD_EXECUTABLE(${PROGRAM} "${PROGRAM}.cpp")
SOURCE_GROUP("" FILES "${PROGRAM}.cpp")
add_executable(${PROGRAM} "${PROGRAM}.cpp")
source_group("" FILES "${PROGRAM}.cpp")

SET_TARGET_PROPERTIES(${PROGRAM} PROPERTIES
FOLDER demos
COMPILE_FLAGS "${CH_CXX_FLAGS}"
LINK_FLAGS "${CH_LINKERFLAG_EXE}")
SET_PROPERTY(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:${PROGRAM}>")
TARGET_LINK_LIBRARIES(${PROGRAM} ChronoEngine)
ADD_DEPENDENCIES(${PROGRAM} ChronoEngine)
set_target_properties(${PROGRAM} PROPERTIES FOLDER demos COMPILE_FLAGS "${COMPILER_FLAGS}" LINK_FLAGS "${LINKER_FLAGS}")
set_property(TARGET ${PROGRAM} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:${PROGRAM}>")
target_link_libraries(${PROGRAM} ${LIBS})

INSTALL(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO})
ENDFOREACH(PROGRAM)
install(TARGETS ${PROGRAM} DESTINATION ${CH_INSTALL_DEMO})
endforeach(PROGRAM)

Loading

0 comments on commit a032615

Please sign in to comment.