Skip to content

Commit

Permalink
Merge pull request #46 from joaoleal/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
joaoleal authored Feb 13, 2020
2 parents 46b2cea + 56009f7 commit c97c024
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ script:
- cd test
- make -j2 build_tests
- CTEST_OUTPUT_ON_FAILURE=TRUE make test
- cd ..
- make DESTDIR=cppadcg-install-dir install
- make DESTDIR=cppadcg-install-dir uninstall
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,8 @@ ADD_SUBDIRECTORY(doc)
# enable testing must be called here in order for the target test to be created
ENABLE_TESTING()
ADD_SUBDIRECTORY(test EXCLUDE_FROM_ALL)

# =============================================================================
# uninstall procedure
# =============================================================================
ADD_CUSTOM_TARGET(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppadcodegen_uninstall.cmake)
41 changes: 41 additions & 0 deletions cmake/cppadcodegen_uninstall.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (C) 2010 Olivier Stasse, JRL, CNRS, 2010
#
# Original source:
# https://github.com/jrl-umi3218/jrl-cmakemodules/blob/master/cmake_uninstall.cmake.in
#
# Contributor
# https://jcarpent.github.io/
#
# CppADCodeGen is distributed under multiple licenses:
#
# - Eclipse Public License Version 1.0 (EPL1), and
# - GNU General Public License Version 3 (GPL3).
#
# EPL1 terms and conditions can be found in the file "epl-v10.txt", while
# terms and conditions for the GPL3 can be found in the file "gpl3.txt".
#
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")

if(EXISTS ${MANIFEST})
file(STRINGS ${MANIFEST} files)
foreach(_file ${files})
SET(file "$ENV{DESTDIR}${_file}")
if(IS_SYMLINK ${file} OR EXISTS ${file})
message(STATUS "Removing file: '${file}'")

execute_process(
COMMAND ${CMAKE_COMMAND} -E remove ${file}
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)

if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Failed to remove file: '${file}'.")
endif()
else()
message(STATUS "File '${file}' does not exist.")
endif()
endforeach(_file)
else()
message(FATAL_ERROR "Cannot find install manifest: ${MANIFEST}")
endif()
21 changes: 15 additions & 6 deletions include/cppad/cg/cppadcg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@
*/

// --------------------------------------------------------------------------

// Make sure CppADCodeGen is included before CppAD
# ifdef CPPAD_CPPAD_HPP
static_assert(false,
"\ncppad/cppad.hpp was included before cppad/cg/cppadcg.hpp\n"
"cppadcg.hpp includes cppad.hpp with the proper environment for CppADCodeGen"
);
# endif

// System routines that can be used by rest of CppAD with out including

#include <algorithm>
#include <array>
#include <assert.h>
#include <cassert>
#include <cstddef>
#include <errno.h>
#include <cerrno>
#include <fstream>
#include <iomanip>
#include <iosfwd>
Expand All @@ -37,13 +46,13 @@
#include <deque>
#include <forward_list>
#include <set>
#include <stddef.h>
#include <cstddef>
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <string>
#include <string.h>
#include <cstring>
#include <chrono>
#include <thread>
#include <functional>
Expand Down
Loading

0 comments on commit c97c024

Please sign in to comment.