Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit aa12476

Browse files
committed
ref #3 modified CMakeLists.txt to find PAPI
1 parent fd02c7d commit aa12476

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ set(CMAKE_DISABLE_SOURCE_CHANGES ON)
44
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
55
set(CMAKE_VERBOSE_MAKEFILE OFF)
66
set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR})
7-
7+
8+
set(CMAKE_BUILD_TYPE Release)
9+
810
project(bencho C CXX)
911

1012
find_library(PAPI NAMES papi)
1113

12-
if ((NOT ${PAPI}) AND (${CMAKE_BUILD_TYPE} MATCHES "RELEASE.*"))
14+
if ((PAPI-NOTFOUND) AND (${CMAKE_BUILD_TYPE} MATCHES "RELEASE.*"))
1315
MESSAGE(FATAL_ERROR "cannot set up release build without PAPI!")
1416
endif ()
1517

@@ -54,10 +56,8 @@ src/resultFileHelper.cpp)
5456

5557
set(bencho_CXX_FLAGS "-std=c++0x")
5658

57-
if (${PAPI})
58-
set(bencho_CXX_FLAGS "${bencho_CXX_FLAGS} -D USE_PAPI_TRACE" CACHE_STRING "bencho
59-
compile flags")
60-
add_definitions(USE_PAPI_TRACE)
59+
if (NOT PAPI-NOTFOUND)
60+
add_definitions(-DUSE_PAPI_TRACE)
6161
target_link_libraries(bencho ${PAPI})
6262
endif()
6363

0 commit comments

Comments
 (0)