Skip to content

Commit

Permalink
Consolidate all the CMake-built C++ libs into one using the OBJECT li…
Browse files Browse the repository at this point in the history
…brary feature post 2.8.8
  • Loading branch information
drummerdoc committed Sep 11, 2013
1 parent 0c26d27 commit bd7569a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- mode: cmake -*-
# Require cmake 2.8 or higher
cmake_minimum_required(VERSION 2.8.2)
# Require cmake 2.8.8 or higher
cmake_minimum_required(VERSION 2.8.8)

#set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
#set(CMAKE_DISABLE_SOURCE_CHANGES ON)
Expand Down
8 changes: 8 additions & 0 deletions Src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ add_subdirectory(${FBOXDIR})
add_subdirectory(${FMGDIR})

add_subdirectory(${CFMGDIR})

add_library(cboxlib $<TARGET_OBJECTS:box_c> $<TARGET_OBJECTS:box_cbndry> $<TARGET_OBJECTS:box_camr> $<TARGET_OBJECTS:box_cmg> $<TARGET_OBJECTS:box_ctmg> $<TARGET_OBJECTS:box_cfmg>)
add_library(cfboxlib $<TARGET_OBJECTS:box_cfmg>)
add_install_library(cboxlib)
add_install_library(cfboxlib)
SET_TARGET_PROPERTIES(cboxlib PROPERTIES LINKER_LANGUAGE C)
SET_TARGET_PROPERTIES(cfboxlib PROPERTIES LINKER_LANGUAGE C)

add_subdirectory(${CAMRDATADIR})

add_subdirectory(Extern/gslib)
Expand Down
3 changes: 1 addition & 2 deletions Src/C_AMRLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})

set(local_source_files ${FPP_out_files} ${F77_source_files} ${F90_source_files} ${CXX_source_files})
set(local_header_files ${CXX_header_files} ${F77_header_files} ${FPP_header_files} ${F90_header_files})
add_library(box_camr ${local_source_files})
add_library(box_camr OBJECT ${local_source_files})

add_install_include_file(${local_header_files})
add_install_library(box_camr)

if (BUILD_TESTS)

Expand Down
3 changes: 1 addition & 2 deletions Src/C_BaseLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ set(F90_header_files)
preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})
set(local_source_files ${CXX_source_files} ${F77_source_files} ${FPP_out_files} ${F90_source_files})
set(local_header_files ${CXX_header_files} ${F77_header_files} ${FPP_header_files} ${F90_header_files})
add_library(box_c ${local_source_files})
add_library(box_c OBJECT ${local_source_files})

add_install_include_file(${local_header_files})
add_install_library(box_c)

#if (BUILD_TESTS AND BL_SPACEDIM EQUAL 3)
# # Add UnitTest include directories
Expand Down
3 changes: 1 addition & 2 deletions Src/C_BoundaryLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ set(F90_header_files)
preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})
set(local_source_files ${CXX_source_files} ${F77_source_files} ${FPP_out_files} ${F90_source_files})
set(local_header_files ${CXX_header_files} ${F77_header_files} ${FPP_header_files} ${F90_header_files})
add_library(box_cbndry ${local_source_files})
add_library(box_cbndry OBJECT ${local_source_files})

add_install_include_file(${local_header_files})
add_install_library(box_cbndry)

if (BUILD_TESTS)

Expand Down
3 changes: 1 addition & 2 deletions Src/LinearSolvers/C_CellMG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})

set(local_source_files ${FPP_out_files} ${F77_source_files} ${F90_source_files} ${CXX_source_files})
set(local_header_files ${FPP_header_files} ${F77_header_files} ${F90_header_files} ${CXX_header_files})
add_library(box_cmg ${local_source_files})
add_library(box_cmg OBJECT ${local_source_files})

add_install_include_file(${local_header_files})
add_install_library(box_cmg)

if (BUILD_TESTS)

Expand Down
3 changes: 1 addition & 2 deletions Src/LinearSolvers/C_TensorMG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})

set(local_source_files ${FPP_out_files} ${F77_source_files} ${F90_source_files} ${CXX_source_files})
set(local_header_files ${FPP_header_files} ${F77_header_files} ${F90_header_files} ${CXX_header_files})
add_library(box_ctmg ${local_source_files})
add_library(box_ctmg OBJECT ${local_source_files})

add_install_include_file(${local_header_files})
add_install_library(box_ctmg)

if (BUILD_TESTS)

Expand Down
3 changes: 1 addition & 2 deletions Src/LinearSolvers/C_to_F_MG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})

set(local_source_files ${FPP_out_files} ${F77_source_files} ${F90_source_files} ${CXX_source_files})
set(local_header_files ${FPP_header_files} ${F77_header_files} ${F90_header_files} ${CXX_header_files})
add_library(box_cfmg ${local_source_files})
add_library(box_cfmg OBJECT ${local_source_files})

add_install_include_file(${local_header_files})
add_install_library(box_cfmg)

if (BUILD_TESTS)

Expand Down
1 change: 0 additions & 1 deletion Src/LinearSolvers/F_MG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ add_library(box_fmg ${local_source_files})
target_link_libraries(box_fmg box_f)

add_install_include_file(${local_header_files})
add_install_library(box_fmg)

if (BUILD_TESTS AND BL_SPACEDIM EQUAL 3)
endif()
Expand Down

0 comments on commit bd7569a

Please sign in to comment.