Skip to content

Commit

Permalink
ick...more hacking on cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
drummerdoc committed Sep 11, 2013
1 parent 475251a commit 38f4602
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
45 changes: 38 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,44 @@ if (${ADJUST_POLICY})
cmake_policy(SET CMP0017 NEW)
endif()

#
# Usage:
#
# Typically cmake is used to support an "out-of-source-tree" build. To this with default
# settings (see below):
#
# #> export bdir=`pwd`
# #> mkdir <new_build_dir>
# #> cd <new_build_dir>
# #> cmake $bdir
# #> make
# [ optionally #> make install ]
#
# The install target will place all C++/Fortran header and mod files in an include folder,
# and the CCSE libraries in a lib folder.
#
# Note: If you intend to use install, almost surely you will want to set the absolute path
# of the folder where the files will be installed:
#
# CMAKE_INSTALL_PREFIX
#
# Below, we have set some of the switches for reasonable default behavior, these can be
# overridden at the cmake command line, ie "cmake -DVAR=VALUE", or by editing the values
# directly below.
#

# Define the project name
# This command will define
# CCSE_SOURCE_DIR
# CCSE_BINARY_DIR
project(CCSE)

set(BL_SPACEDIM 2)
set(ENABLE_MPI 1)
set(ENABLE_OpenMP 0)
set(BL_PRECISION "DOUBLE")
set(CMAKE_INSTALL_PREFIX "${CCSE_BINARY_DIR}")

# Enable testing, ctest needs this
# all add_test commands are ignored unless this is called!
enable_testing()
Expand All @@ -33,16 +71,9 @@ set_property(GLOBAL PROPERTY CCSE_LINK_LINE "-L${CMAKE_INSTALL_PREFIX}/lib")

# A property for accumulating CCSE library targets
set_property(GLOBAL PROPERTY CCSE_LIBRARY_TARGETS)
set(CCSE_LINK_LINE_FILE "${CMAKE_INSTALL_PREFIX}/lib/link_line") # A filename to write link-line to.
include(InstallManager)


# Define the project name
# This command will define
# CCSE_SOURCE_DIR
# CCSE_BINARY_DIR
project(CCSE)

# Source files for all binaries and libraries found under src
add_subdirectory(Src)

Expand Down
4 changes: 2 additions & 2 deletions Tools/CMake/BoxLib_Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# VERSION_PATCH = patch version if requested, else 0
# VERSION_TWEAK = tweak version if requested, else 0
# VERSION_COUNT = number of version components, 0 to 4
SET(CCSE_VERSION 1.1.8)
SET(CCSE_VERSION 1.1.9)
SET(CCSE_VERSION_MAJOR 1)
SET(CCSE_VERSION_MINOR 1)
SET(CCSE_VERSION_PATCH 8)
SET(CCSE_VERSION_PATCH 9)
SET(CCSE_VERSION_COUNT 3)
11 changes: 1 addition & 10 deletions Tools/CMake/InstallManager.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function(makefile_library_dirs)

cmake_parse_arguments(PARSE_ARGS "" "MAKE_LIB_LIST" "CMAKE_LIB_LIST" ${ARGN})
#print_variable(PARSE_ARGS_CMAKE_LIB_LIST)
#print_variable(PARSE_ARGS_MAKE_LIB_LIST)
message(STATUS "PARSE_ARGS_CMAKE_LIB_LIST: ${PARSE_ARGS_CMAKE_LIB_LIST}")

set(tmp_lib_list)
set(loop_list ${PARSE_ARGS_CMAKE_LIB_LIST})
Expand Down Expand Up @@ -191,15 +191,6 @@ set(CCSE_LIBRARY_DIRS "${CMAKE_INSTALL_PREFIX}/lib")
list(REMOVE_DUPLICATES CCSE_INCLUDE_DIRS)
list(REMOVE_DUPLICATES CCSE_LIBRARY_DIRS)

# Convert the link line to a space deliminated string
foreach (arg ${LINK_LINE})
set(LINK_LINE_STRING "${LINK_LINE_STRING} ${arg}")
endforeach()

# Write and install the link-line file
file(WRITE ${CCSE_LINK_LINE_FILE} ${LINK_LINE_STRING})
install(FILES ${CCSE_LINK_LINE_FILE} DESTINATION lib)

# Write the export Makefile and add to the include install list
makefile_include_dirs(CMAKE_INCLUDE_LIST ${CCSE_INCLUDE_DIRS}
MAKE_INCLUDE_LIST CCSE_MAKE_INCLUDE_DIRS)
Expand Down

0 comments on commit 38f4602

Please sign in to comment.