Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
add_library(
add_library(${PROJECT_NAME} ${EXODUSIICPP_LIBRARY_TYPE})

target_sources(
${PROJECT_NAME}
${EXODUSIICPP_LIBRARY_TYPE}
PRIVATE
element_block.cpp
exception.cpp
file.cpp
node_set.cpp
side_set.cpp
)

file(GLOB_RECURSE HDRS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/include/exodusIIcpp/*.h)

target_sources(
${PROJECT_NAME}
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_SOURCE_DIR}/include
FILES ${HDRS}
)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)

if(CMAKE_PROJECT_NAME STREQUAL "exodusIIcpp")
Expand Down Expand Up @@ -56,22 +68,12 @@ if (EXODUSIICPP_INSTALL)

install(
TARGETS exodusIIcpp
EXPORT exodusIIcppTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(
DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
EXPORT exodusIIcpp-targets
FILE_SET HEADERS
)

install(
EXPORT exodusIIcppTargets
EXPORT exodusIIcpp-targets
FILE exodusiicpp-targets.cmake
NAMESPACE exodusIIcpp::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/exodusIIcpp
Expand Down
20 changes: 13 additions & 7 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ project(exodusIIcpp-test)

find_package(GTest REQUIRED)

add_executable(${PROJECT_NAME}
ElementBlock_test.cpp
Error_test.cpp
File_test.cpp
NodeSet_test.cpp
SideSet_test.cpp
main.cpp
add_executable(${PROJECT_NAME})

target_sources(
${PROJECT_NAME}
PRIVATE
ElementBlock_test.cpp
Error_test.cpp
File_test.cpp
NodeSet_test.cpp
SideSet_test.cpp
main.cpp
)

target_code_coverage(${PROJECT_NAME})

target_sanitization(${PROJECT_NAME})

target_include_directories(
Expand Down
9 changes: 4 additions & 5 deletions tools/exo2yml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ project(exo2yml LANGUAGES CXX)

find_package(yaml-cpp 0.8 REQUIRED)

add_executable(${PROJECT_NAME}
main.cpp
)
add_executable(${PROJECT_NAME})

target_sources(${PROJECT_NAME} PRIVATE main.cpp)

target_include_directories(
${PROJECT_NAME}
Expand All @@ -25,7 +25,6 @@ target_link_libraries(
if (EXODUSIICPP_INSTALL)
install(
TARGETS ${PROJECT_NAME}
EXPORT exodusIIcppTargets
RUNTIME DESTINATION bin
EXPORT exodusIIcpp-targets
)
endif()
9 changes: 4 additions & 5 deletions tools/yml2exo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ project(yml2exo LANGUAGES CXX)

find_package(yaml-cpp 0.8 REQUIRED)

add_executable(${PROJECT_NAME}
main.cpp
)
add_executable(${PROJECT_NAME})

target_sources(${PROJECT_NAME} PRIVATE main.cpp)

target_include_directories(
${PROJECT_NAME}
Expand All @@ -25,7 +25,6 @@ target_link_libraries(
if (EXODUSIICPP_INSTALL)
install(
TARGETS ${PROJECT_NAME}
EXPORT exodusIIcppTargets
RUNTIME DESTINATION bin
EXPORT exodusIIcpp-targets
)
endif()
Loading