Skip to content

Commit

Permalink
Progress with generating **Config.cmake; Still WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hnkolla committed Mar 5, 2021
1 parent 345e4a1 commit 0cc9c64
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 9 deletions.
10 changes: 1 addition & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,7 @@ INSTALL (

#---- Adding the higher moment interface to the Library sources
#---- Must be a better way to do this. Inside an IF??
ADD_LIBRARY (
gt_higher_moments SHARED
${Genten_SOURCE_DIR}/joint_moments/Genten_HigherMoments.cpp
)
TARGET_LINK_LIBRARIES(gt_higher_moments ${GENTEN_LINK_LIBS})
INSTALL (
TARGETS gt_higher_moments
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
ADD_SUBDIRECTORY(joint_moments)

# FIND_PACKAGE(GTest REQUIRED)
# IF (${GTest_FOUND})
Expand Down
46 changes: 46 additions & 0 deletions joint_moments/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#--https://stackoverflow.com/questions/49857596/cmake-simple-config-file-example/49858236
#--https://stackoverflow.com/questions/20746936/what-use-is-find-package-if-you-need-to-specify-cmake-module-path-anyway
ADD_LIBRARY (
gt_higher_moments SHARED
${Genten_SOURCE_DIR}/joint_moments/Genten_HigherMoments.cpp
)
TARGET_LINK_LIBRARIES(gt_higher_moments PUBLIC ${GENTEN_LINK_LIBS})


INSTALL(
TARGETS genten_mathlibs_c gentenlib gt_higher_moments
DESTINATION ${CMAKE_INSTALL_LIBDIR}
EXPORT gt_higher_momentsConfig
)

INSTALL(
EXPORT gt_higher_momentsConfig
DESTINATION cmake
)

#HK3
#HK3EXPORT(
#HK3 EXPORT gt_higher_momentsConfig
#HK3 NAMESPACE gt_higher_moments::
#HK3 FILE gt_higher_momentsConfig.cmake
#HK3 )
#HK3
#HK3EXPORT( PACKAGE gt_higher_moments)

#HKINSTALL (
#HK TARGETS gt_higher_moments
#HK DESTINATION ${CMAKE_INSTALL_LIBDIR}
#HK )
#HK
#HKinclude(CMakePackageConfigHelpers)
#HKconfigure_package_config_file(gt_higher_momentsConfig.cmake.in
#HK ${CMAKE_CURRENT_BINARY_DIR}/gt_higher_momentsConfig.cmake
#HK INSTALL_DESTINATION cmake)
#HK
#HKINSTALL(
#HK FILES
#HK ${CMAKE_CURRENT_BINARY_DIR}/gt_higher_momentsConfig.cmake
#HK DESTINATION cmake
#HK )


5 changes: 5 additions & 0 deletions joint_moments/gt_higher_momentsConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

#include("${CMAKE_CURRENT_LIST_DIR}/gt_higher_momentsTargets.cmake")

0 comments on commit 0cc9c64

Please sign in to comment.