Skip to content

Commit

Permalink
Updated cmake and build recipe (#242)
Browse files Browse the repository at this point in the history
* Updated build config

* Updated build recipe

* Cleaned up build deps
  • Loading branch information
jessemapel authored and jlaura committed Aug 6, 2019
1 parent 468e8f2 commit cb4a4a2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 38 deletions.
52 changes: 30 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
# Specify the required version of CMake.
# cmake 3.10 required for ctest/gtest integration
cmake_minimum_required(VERSION 3.10)
project(ale VERSION 0.0.1 DESCRIPTION "Abstraction Library for Ephemerides ")
project(ale VERSION 0.3.0 DESCRIPTION "Abstraction Library for Ephemerides ")

# include what we need
include(GNUInstallDirs)
include(cmake/gtest.cmake)
include(GoogleTest)
include(CTest)

set(CMAKE_CXX_STANDARD 11)

Expand All @@ -37,27 +34,38 @@ target_include_directories(ale
${EIGEN3_INCLUDE_DIR}
${PYTHON_INCLUDE_DIR}
PUBLIC
${ALE_INCLUDE_DIRS})
${ALE_INCLUDE_DIRS})

# Setup for GoogleTest
find_package(Threads)
target_link_libraries(ale
PRIVATE
${GSL_LIBRARIES}
${PYTHON_LIBRARY}
PUBLIC
gtest ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(ale
PRIVATE
${GSL_LIBRARIES}
${PYTHON_LIBRARY})

# Setup for ctest
enable_testing()
add_subdirectory(tests/ctests)
# Optional build tests
option (BUILD_TESTS "Build tests" ON)
if(BUILD_TESTS)
include(cmake/gtest.cmake)
include(GoogleTest)
include(CTest)

# Setup for code coverage
# default to off
set(COVERAGE OFF CACHE BOOL "Coverage")
if(COVERAGE)
target_compile_options(ale PRIVATE --coverage -O0)
target_link_libraries(ale PRIVATE --coverage -O0)
find_package (Threads)

target_link_libraries(ale
PRIVATE
${GSL_LIBRARIES}
${PYTHON_LIBRARY}
PUBLIC
gtest ${CMAKE_THREAD_LIBS_INIT})
enable_testing()
add_subdirectory(tests/ctests)

# Setup for code coverage
# default to off
set(COVERAGE OFF CACHE BOOL "Coverage")
if(COVERAGE)
target_compile_options(ale PRIVATE --coverage -O0)
target_link_libraries(ale PRIVATE --coverage -O0)
endif()
endif()

# Install commands
Expand Down
2 changes: 1 addition & 1 deletion recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release ..
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ..
make install
17 changes: 2 additions & 15 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,17 @@ requirements:
build:
- cmake>=3.10
- eigen
# - eigen=3.3.3
- gsl
# - gsl==2.2.1
- numpy
- openblas
# - openblas==0.2.19
- python
# - python==3.6
- python-dateutil
- pvl
- spiceypy
run:
- cmake>=3.10
- eigen
# - eigen=3.3.3
- gsl
# - gsl==2.2.1
- netowrkx
- numpy
- openblas
# - openblas==0.2.19
- python
# - python==3.6
- python-dateutil
- pvl
- pysis
- spiceypy

# Add the tests eventually
Expand Down

0 comments on commit cb4a4a2

Please sign in to comment.