Skip to content

Commit

Permalink
add rpath, fix typo, add option, clean cmake file
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSiebert1 committed Oct 10, 2024
1 parent 6bf3e89 commit f8a5ebb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ADOL-C/c_interface/ADOLC_TB_interface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <adolc/adolc.h>
#include "ADOLC_TB_Interface.h"
#include "ADOLC_TB_interface.h"

/*
Constructor & Destructor for class tape-based adouble
Expand Down
12 changes: 1 addition & 11 deletions ADOL-C/c_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
cmake_minimum_required(VERSION 3.27)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

add_library(ExternalADOLC SHARED IMPORTED)
set_target_properties(ExternalADOLC PROPERTIES
IMPORTED_LOCATION ${ADOLC_INSTALL_DIR}/lib/libadolc.dylib
INTERFACE_INCLUDE_DIRECTORIES ${ADOLC_INSTALL_DIR}/include
)
add_library(ADOLCInterface SHARED ADOLC_TB_interface.cpp ADOLC_TL_interface.cpp array_handler.cpp driver_interface.cpp)
target_link_libraries(ADOLCInterface ExternalADOLC)

target_link_libraries(ADOLCInterface adolc)
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project(adol-c
DESCRIPTION "A Package for Automatic Differentiation of Algorithms Written in C/C++"
HOMEPAGE_URL "https://github.com/coin-or/ADOL-C")

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
add_library(adolc SHARED)
add_library(adolc::adolc ALIAS adolc)

Expand Down Expand Up @@ -49,6 +50,11 @@ set(USE_BOOST_POOL "#undef USE_BOOST_POOL")

add_subdirectory(ADOL-C)

option(BUILD_INTERFACE OFF)

if(BUILD_INTERFACE)
add_subdirectory(ADOL-C/c_interface)
endif()

# export the targets
# ------------------
Expand All @@ -57,9 +63,15 @@ include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

install(TARGETS adolc EXPORT adolcTargets)
install(TARGETS ADOLCInterface EXPORT ADOLCInterfaceTargets)
install(EXPORT adolcTargets
FILE adolc-targets.cmake
NAMESPACE adolc::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/adolc)


install(EXPORT ADOLCInterfaceTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/adolc)



0 comments on commit f8a5ebb

Please sign in to comment.