Skip to content

Commit

Permalink
exec is selectable for executable directory (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-hoo authored Feb 23, 2022
1 parent 583f76b commit 30fcea8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ if(BUILD_POSTEXEC)
endif()
endif()

### Switch RUNTIME DESTINATION DIR between bin and exec
set(exec_dir bin)
if(EMC_EXEC_DIR)
set(exec_dir exec)
endif()

add_subdirectory(sorc)
add_subdirectory(parm)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ Builds include:
```
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
make
make test
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
(or cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install -DEMC_EXEC_DIR=ON)
make -j 4
make install
```

Expand Down
4 changes: 2 additions & 2 deletions sorc/ncep_post.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ if(BUILD_POSTEXEC)
target_link_libraries(${EXENAME} PRIVATE
wrf_io::wrf_io)
endif()
install(TARGETS ${EXENAME} RUNTIME DESTINATION bin)
install(TARGETS ${EXENAME} RUNTIME DESTINATION ${exec_dir})
endif()

install(DIRECTORY ${module_dir} DESTINATION ${CMAKE_INSTALL_PREFIX})

install(
TARGETS ${LIBNAME}
EXPORT ${PROJECT_NAME}Exports
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${exec_dir}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

0 comments on commit 30fcea8

Please sign in to comment.