cmake: attempt to get the cuba library compiled as collection of object libraries. Compiles and links, but not yet tested.
This commit is contained in:
parent
5f3cf3c64a
commit
f6d8df74e1
49
src/external/libCuba/src/CMakeLists.txt
vendored
49
src/external/libCuba/src/CMakeLists.txt
vendored
@ -9,37 +9,32 @@ set(CUBA_VERSION "1.0.0")
|
||||
set(CUBA_LIBRARY_NAME "cuba")
|
||||
configure_file("cuba.pc.in" "cuba.pc" @ONLY)
|
||||
|
||||
add_subdirectory(cuhre)
|
||||
add_subdirectory(divonne)
|
||||
add_subdirectory(suave)
|
||||
add_subdirectory(vegas)
|
||||
|
||||
#--- lib creation -------------------------------------------------------------
|
||||
add_library(cuba SHARED
|
||||
cuhre/Cuhre.c
|
||||
divonne/Divonne.c
|
||||
suave/Suave.c
|
||||
vegas/Vegas.c
|
||||
common/WorkerIni.c
|
||||
)
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
cuba BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cuhre>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/divonne>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/suave>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/vegas>
|
||||
$<TARGET_OBJECTS:cuhre>
|
||||
$<TARGET_OBJECTS:divonne>
|
||||
$<TARGET_OBJECTS:suave>
|
||||
$<TARGET_OBJECTS:vegas>
|
||||
)
|
||||
|
||||
#--- check for pre compile flags ----------------------------------------------
|
||||
set(COMP_DEF "")
|
||||
if (HAVE_FORK)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
|
||||
endif (HAVE_FORK)
|
||||
if (HAVE_ALLOCA_H)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
|
||||
endif (HAVE_ALLOCA_H)
|
||||
if (HAVE_SHMGET)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
|
||||
endif (HAVE_SHMGET)
|
||||
#--- install cuba solib -------------------------------------------------------
|
||||
install(TARGETS cuba DESTINATION lib)
|
||||
|
||||
target_compile_definitions(
|
||||
cuba PRIVATE ${COMP_DEF}
|
||||
#--- install cuba header ------------------------------------------------------
|
||||
install(
|
||||
FILES
|
||||
cuba.h
|
||||
DESTINATION
|
||||
include
|
||||
)
|
||||
|
||||
#--- install pkg-config info --------------------------------------------------
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/cuba.pc
|
||||
DESTINATION lib/pkgconfig
|
||||
)
|
||||
|
2
src/external/libCuba/src/common/stddecl.h
vendored
2
src/external/libCuba/src/common/stddecl.h
vendored
@ -12,7 +12,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define _BSD_SOURCE
|
||||
#define _DEFAULT_SOURCE
|
||||
#define _XOPEN_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
|
31
src/external/libCuba/src/cuhre/CMakeLists.txt
vendored
Normal file
31
src/external/libCuba/src/cuhre/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
#--- cuhre --------------------------------------------------------------------
|
||||
|
||||
#--- obj lib creation ---------------------------------------------------------
|
||||
add_library(cuhre OBJECT
|
||||
Cuhre.c
|
||||
)
|
||||
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
cuhre BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
|
||||
)
|
||||
|
||||
#--- check for pre compile flags ----------------------------------------------
|
||||
set(COMP_DEF "")
|
||||
if (HAVE_FORK)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
|
||||
endif (HAVE_FORK)
|
||||
if (HAVE_ALLOCA_H)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
|
||||
endif (HAVE_ALLOCA_H)
|
||||
if (HAVE_SHMGET)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
|
||||
endif (HAVE_SHMGET)
|
||||
|
||||
target_compile_definitions(
|
||||
cuhre PRIVATE ${COMP_DEF}
|
||||
)
|
||||
|
31
src/external/libCuba/src/divonne/CMakeLists.txt
vendored
Normal file
31
src/external/libCuba/src/divonne/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
#--- divonne ------------------------------------------------------------------
|
||||
|
||||
#--- obj lib creation ---------------------------------------------------------
|
||||
add_library(divonne OBJECT
|
||||
Divonne.c
|
||||
)
|
||||
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
divonne BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
|
||||
)
|
||||
|
||||
#--- check for pre compile flags ----------------------------------------------
|
||||
set(COMP_DEF "")
|
||||
if (HAVE_FORK)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
|
||||
endif (HAVE_FORK)
|
||||
if (HAVE_ALLOCA_H)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
|
||||
endif (HAVE_ALLOCA_H)
|
||||
if (HAVE_SHMGET)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
|
||||
endif (HAVE_SHMGET)
|
||||
|
||||
target_compile_definitions(
|
||||
divonne PRIVATE ${COMP_DEF}
|
||||
)
|
||||
|
31
src/external/libCuba/src/suave/CMakeLists.txt
vendored
Normal file
31
src/external/libCuba/src/suave/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
#--- suave --------------------------------------------------------------------
|
||||
|
||||
#--- obj lib creation ---------------------------------------------------------
|
||||
add_library(suave OBJECT
|
||||
Suave.c
|
||||
)
|
||||
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
suave BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
|
||||
)
|
||||
|
||||
#--- check for pre compile flags ----------------------------------------------
|
||||
set(COMP_DEF "")
|
||||
if (HAVE_FORK)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
|
||||
endif (HAVE_FORK)
|
||||
if (HAVE_ALLOCA_H)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
|
||||
endif (HAVE_ALLOCA_H)
|
||||
if (HAVE_SHMGET)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
|
||||
endif (HAVE_SHMGET)
|
||||
|
||||
target_compile_definitions(
|
||||
suave PRIVATE ${COMP_DEF}
|
||||
)
|
||||
|
31
src/external/libCuba/src/vegas/CMakeLists.txt
vendored
Normal file
31
src/external/libCuba/src/vegas/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
#--- vegas --------------------------------------------------------------------
|
||||
|
||||
#--- obj lib creation ---------------------------------------------------------
|
||||
add_library(vegas OBJECT
|
||||
Vegas.c
|
||||
)
|
||||
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
vegas BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
|
||||
)
|
||||
|
||||
#--- check for pre compile flags ----------------------------------------------
|
||||
set(COMP_DEF "")
|
||||
if (HAVE_FORK)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
|
||||
endif (HAVE_FORK)
|
||||
if (HAVE_ALLOCA_H)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
|
||||
endif (HAVE_ALLOCA_H)
|
||||
if (HAVE_SHMGET)
|
||||
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
|
||||
endif (HAVE_SHMGET)
|
||||
|
||||
target_compile_definitions(
|
||||
vegas PRIVATE ${COMP_DEF}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user