2017-02-07 17:07:25 +01:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2017-02-08 21:47:20 +03:00
|
|
|
project(profiler_sample CXX)
|
2016-02-16 23:21:12 +03:00
|
|
|
|
|
|
|
set(CPP_FILES
|
2016-09-06 22:23:55 +03:00
|
|
|
main.cpp
|
2016-02-16 23:21:12 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
set(SOURCES
|
2016-09-06 22:23:55 +03:00
|
|
|
${CPP_FILES}
|
2016-02-16 23:21:12 +03:00
|
|
|
)
|
|
|
|
|
2017-02-07 17:07:25 +01:00
|
|
|
include_directories(
|
|
|
|
../easy_profiler_core/include
|
|
|
|
)
|
|
|
|
link_directories(${CMAKE_SOURCE_DIR}/../bin)
|
|
|
|
|
2016-02-16 23:21:12 +03:00
|
|
|
add_executable(${PROJECT_NAME} ${SOURCES})
|
|
|
|
|
2016-06-22 23:59:49 +03:00
|
|
|
set(DISABLED_PROFILER_NAME
|
2016-09-06 22:23:55 +03:00
|
|
|
"${PROJECT_NAME}_disabled_profiler"
|
2016-06-22 23:59:49 +03:00
|
|
|
)
|
|
|
|
add_executable(${DISABLED_PROFILER_NAME} ${SOURCES})
|
|
|
|
|
2017-02-14 21:22:26 +03:00
|
|
|
if (MINGW)
|
2016-02-18 23:50:10 +03:00
|
|
|
|
2017-02-14 21:22:26 +03:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
|
|
|
|
elseif (CMAKE_VERSION VERSION_LESS "3.1")
|
2016-06-22 23:59:49 +03:00
|
|
|
|
2017-02-08 21:47:20 +03:00
|
|
|
if (UNIX OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
|
|
|
endif (UNIX OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
2017-02-14 21:22:26 +03:00
|
|
|
|
2017-02-08 21:47:20 +03:00
|
|
|
else ()
|
2017-02-14 21:22:26 +03:00
|
|
|
|
2017-02-08 21:47:20 +03:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
CXX_STANDARD 11
|
|
|
|
CXX_STANDARD_REQUIRED ON
|
|
|
|
)
|
2017-02-14 21:22:26 +03:00
|
|
|
|
|
|
|
set_target_properties(${DISABLED_PROFILER_NAME} PROPERTIES
|
|
|
|
CXX_STANDARD 11
|
|
|
|
CXX_STANDARD_REQUIRED ON
|
|
|
|
)
|
|
|
|
|
|
|
|
endif (MINGW)
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
set(SPEC_LIB ${SPEC_LIB} pthread)
|
|
|
|
endif(UNIX)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} easy_profiler ${SPEC_LIB})
|
|
|
|
target_link_libraries(${DISABLED_PROFILER_NAME} easy_profiler ${SPEC_LIB})
|
2017-02-08 21:47:20 +03:00
|
|
|
|
2016-09-29 23:08:20 +03:00
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_WITH_EASY_PROFILER)
|