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-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 09:43:23 +00:00
|
|
|
|
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-12 18:42:44 +00:00
|
|
|
TARGET_LINK_LIBRARIES (lc linecount_static)
|
2015-12-12 09:43:23 +00:00
|
|
|
|
2015-12-12 18:42:44 +00:00
|
|
|
INSTALL(TARGETS lc
|
2015-12-12 09:43:23 +00:00
|
|
|
DESTINATION "bin"
|
|
|
|
)
|
2015-12-12 18:42:44 +00:00
|
|
|
INSTALL(TARGETS linecount linecount_static
|
2015-12-12 09:43:23 +00:00
|
|
|
DESTINATION "lib"
|
|
|
|
)
|
2015-12-12 18:42:44 +00:00
|
|
|
INSTALL(FILES linecount.h
|
2015-12-12 09:43:23 +00:00
|
|
|
DESTINATION "include"
|
|
|
|
)
|