Skip to content

Commit

Permalink
Auto generate export macro
Browse files Browse the repository at this point in the history
  • Loading branch information
cbuahin committed Nov 15, 2023
1 parent 4800dfe commit 2f40a39
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ find_package(OpenMP)


set(EPANETMSX_PUBLIC_HEADERS
${PROJECT_SOURCE_DIR}/include/epanetmsx.h
${CMAKE_CURRENT_SOURCE_DIR}/include/epanetmsx.h
)

file(GLOB
Expand Down Expand Up @@ -63,6 +63,19 @@ target_link_options(epanetmsx
">"
)

include(GenerateExportHeader)
generate_export_header(epanetmsx
BASE_NAME epanetmsx
EXPORT_MACRO_NAME MSXDLLEXPORT
EXPORT_FILE_NAME epanetmsx_export.h
STATIC_DEFINE SHARED_EXPORTS_BUILT_AS_STATIC
)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/epanetmsx_export.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include
)



target_link_libraries(epanetmsx
PUBLIC
Expand All @@ -75,7 +88,7 @@ target_link_libraries(epanetmsx
target_include_directories(epanetmsx
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/EPANET2.2/SRC_engines/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${INCLUDE_DIST}>

PRIVATE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2f40a39

Please sign in to comment.