Skip to content

Commit

Permalink
likelyhood examples, lib for each of them
Browse files Browse the repository at this point in the history
  • Loading branch information
stenczelt committed Jul 7, 2021
1 parent e5acda5 commit a1250fd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions likelihoods/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
project(likelyhoods)

# only include the tree
add_subdirectory(examples)
23 changes: 23 additions & 0 deletions likelihoods/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project(examples)

# parse each example separately
file(GLOB ${PROJECT_NAME}_sources "*.f90" "*.F90")
set(${PROJECT_NAME}_library_list "") # hold all the targets we make
foreach(filename ${${PROJECT_NAME}_sources})
# strip the file name
get_filename_component(archive_name ${filename} NAME_WE)
add_library(${archive_name} ${filename})

# add to target list
list(APPEND ${PROJECT_NAME}_library_list ${archive_name})

# tell the user
message("Adding example: ${archive_name} (from ${filename})")
endforeach()


# standard: where to put the targets
install(TARGETS ${${PROJECT_NAME}_library_list}
RUNTIME DESTINATION ${target_bin_dir}
LIBRARY DESTINATION ${target_lib_dir}
ARCHIVE DESTINATION ${target_lib_dir})
2 changes: 1 addition & 1 deletion src/polychord/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ add_library(${PROJECT_NAME} STATIC $<TARGET_OBJECTS:objlib>)
add_library(${PROJECT_NAME}_shared SHARED $<TARGET_OBJECTS:objlib>)
set_target_properties(${PROJECT_NAME}_shared PROPERTIES OUTPUT_NAME ${PROJECT_NAME} CLEAN_DIRECT_OUTPUT 1)

# this seems to be standard stuff
# standard: where to put the targets
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${target_bin_dir}
LIBRARY DESTINATION ${target_lib_dir}
Expand Down

0 comments on commit a1250fd

Please sign in to comment.