2 # Once done this will define
4 # ADOL-C_DIR - directory in which ADOL-C resides
7 set(ADOL-C_DIR $ENV{ADOL-C_DIR})
11 find_library(ADOL-C_LIBRARY NAMES adolc PATHS ${ADOL-C_DIR}/lib ${ADOL-C_DIR}/lib64)
12 find_path(ADOL-C_HEADER NAMES adolc/adolc.h PATHS ${ADOL-C_DIR}/include)
13 if(ADOL-C_LIBRARY AND ADOL-C_HEADER)
17 PATHS ${ADOL-C_DIR}/lib ${ADOL-C_DIR}/lib64 /usr/local/lib)
19 set(ADOL-C_LIBRARY ${ADOL-C_LIBRARY} ${COLPACK_LIBLARY})
20 endif(COLPACK_LIBLARY)
21 include_directories(${ADOL-C_HEADER})
22 add_definitions(-DWITH_ADOL_C)
23 endif(ADOL-C_LIBRARY AND ADOL-C_HEADER)
24 message(STATUS ${ADOL-C_LIBRARY})
25 message(STATUS ${ADOL-C_HEADER})
31 PREFIX ${PROJECT_BINARY_DIR}/external/
32 URL http://bitbucket.org/likask/mofem-joseph/downloads/ADOL-C-2.5.2.tgz
33 CONFIGURE_COMMAND ${PROJECT_BINARY_DIR}/external/src/adolc/configure CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} --disable-shared --prefix=${PROJECT_BINARY_DIR}/external
35 INSTALL_COMMAND make install
40 PATHS ${ADOL-C_DIR}/lib ${ADOL-C_DIR}/lib64 /usr/local/lib)
41 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/external/lib64)
42 execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_BINARY_DIR}/external/lib64/libadolc.a)
43 add_dependencies(install_prerequisites adolc)
47 if(NOT ADOL-C_LIBRARY)
49 ${PROJECT_BINARY_DIR}/external CACHE FILEPATH "path to adol-c" FORCE)
50 set(ADOL-C_HEADER ${ADOL-C_DIR}/include)
52 ${ADOL-C_DIR}/lib64/libadolc.a CACHE FILEPATH "adol-c lib" FORCE)
53 include_directories(${PROJECT_BINARY_DIR}/external/include)
54 add_definitions(-DWITH_ADOL_C)
56 set(ADOL-C_LIBRARY ${ADOL-C_LIBRARY} ${COLPACK_LIBLARY})
57 endif(COLPACK_LIBLARY)
58 message(STATUS ${ADOL-C_LIBRARY})
59 endif(NOT ADOL-C_LIBRARY)
60 message(STATUS ${ADOL-C_LIBRARY})
61 message(STATUS ${ADOL-C_HEADER})