crioux__turbo-linecount/CMakeLists.txt

34 lines
997 B
CMake
Raw Normal View History

2015-12-12 20:35:58 +00:00
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT (turbo-linecount)
2015-12-12 08:44:11 +00:00
2015-12-12 18:42:44 +00:00
IF(MSVC)
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "limited configs" FORCE)
SET(CMAKE_CXX_FLAGS_RELEASE "/Ox /Ob2")
SET(CMAKE_C_FLAGS_RELEASE "/Ox /Ob2")
ELSE()
2015-12-13 01:14:53 +00:00
FIND_PACKAGE (Threads REQUIRED)
2015-12-12 20:35:58 +00:00
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
2015-12-12 18:42:44 +00:00
SET(CMAKE_C_FLAGS_RELEASE "-O3")
ENDIF()
2015-12-12 21:28:42 +00:00
ADD_LIBRARY (linecount SHARED src/turbo_linecount.cpp src/turbo_linecount.h)
ADD_LIBRARY (linecount_static STATIC src/turbo_linecount.cpp src/turbo_linecount.h)
2015-12-12 20:35:58 +00:00
ADD_EXECUTABLE (lc src/main.cpp)
2015-12-13 01:14:53 +00:00
IF(THREADS_HAVE_PTHREAD_ARG)
SET_PROPERTY(TARGET lc PROPERTY COMPILE_OPTIONS "-pthread")
SET_PROPERTY(TARGET lc PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread")
ENDIF()
TARGET_LINK_LIBRARIES (lc linecount_static ${CMAKE_THREAD_LIBS_INIT})
2015-12-12 18:42:44 +00:00
INSTALL(TARGETS lc
DESTINATION "bin"
)
2015-12-12 18:42:44 +00:00
INSTALL(TARGETS linecount linecount_static
DESTINATION "lib"
)
2015-12-12 18:42:44 +00:00
INSTALL(FILES linecount.h
DESTINATION "include"
)