source: trunk/test_more/compare_c/CMakeLists.txt @ 3935

Last change on this file since 3935 was 3935, checked in by bradbell, 2 years ago

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 59032b5b7861ee32953478a68b477c42445eaad7
end hash code: 4f7a9e1bd57be3d81361ce359222bd61f26e2a79

commit 4f7a9e1bd57be3d81361ce359222bd61f26e2a79
Author: Brad Bell <bradbell@…>
Date: Fri May 19 18:50:24 2017 -0700

Move compare_c -> test_more/compare_c.

commit 7cd305684b06892664571e312277f94c2f0dcd1c
Author: Brad Bell <bradbell@…>
Date: Fri May 19 17:32:15 2017 -0700

Specify separate built type for each test_more subdirectory.

  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1# -----------------------------------------------------------------------------
2# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
3#
4# CppAD is distributed under multiple licenses. This distribution is under
5# the terms of the
6#                     Eclipse Public License Version 1.0.
7#
8# A copy of this license is included in the COPYING file of this distribution.
9# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
10# -----------------------------------------------------------------------------
11# $begin compare_c$$ $newlinech #$$
12# $spell
13#       det
14#       cpp
15# $$
16#
17# $section Compare Speed of C and C++$$
18# $index compare, speed C and C++$$
19# $index speed, compare C and C++$$
20# $index C, compare speed with C++$$
21# $index C++, compare speed with C$$
22#
23# $head Syntax$$
24# $codei%test_more/compare_c/det_by_minor_c
25# %$$
26# $codei test_more/compare_c/det_by_minor_cpp$$
27#
28# $head Purpose$$
29# Compares the speed of the exact same source code compiled
30# using C versus C++.
31#
32# $childtable%
33#       test_more/compare_c/det_by_minor.c
34# %$$
35#
36# $end
37# -----------------------------------------------------------------------------
38
39# Specifies build type for this directory. Possible values are
40# empty, Debug, Release, RelWithDebInfo and MinSizeRel
41SET(CMAKE_BUILD_TYPE RELEASE)
42
43# Loop though the C and C++ compilers
44FOREACH( com c cpp )
45        # Copy a file to another location and modify its contents.
46        # configure_file(InputFile OutputFile [COPYONLY] [ESCAPE_QUOTES] [@ONLY])
47        SET( source det_by_minor_${com}.${com} )
48        CONFIGURE_FILE(
49                ${CMAKE_CURRENT_SOURCE_DIR}/det_by_minor.c
50                ${CMAKE_CURRENT_BINARY_DIR}/${source}
51                COPYONLY
52        )
53        ADD_EXECUTABLE( det_by_minor_${com} EXCLUDE_FROM_ALL ${source})
54        #
55        IF( ${com} STREQUAL cpp )
56                # These are C++ compiler flags (may not be valid for C)
57                add_cppad_cxx_flags(det_by_minor_${com})
58        ENDIF( ${com} STREQUAL cpp )
59        #
60        # Add target the executes this program
61        ADD_CUSTOM_TARGET(check_det_by_minor_${com}
62                det_by_minor_${com}
63                DEPENDS det_by_minor_${com}
64        )
65        MESSAGE(STATUS "make check_det_by_minor_${com}: available")
66
67ENDFOREACH(com)
68
69# check_test_more_compare_c target
70ADD_CUSTOM_TARGET( check_test_more_compare_c
71        DEPENDS check_det_by_minor_c check_det_by_minor_cpp
72)
73MESSAGE(STATUS "make check_test_more_compare_c: available")
74
75# Add check_test_more_compare_c to check depends in parent environment
76add_to_list(check_test_more_depends check_test_more_compare_c)
77SET(check_test_more_depends "${check_test_more_depends}" PARENT_SCOPE)
Note: See TracBrowser for help on using the repository browser.