2013-02-27 04:17:39 +05:30
|
|
|
project(libUtil)
|
2013-02-21 06:40:09 +05:30
|
|
|
|
2013-02-22 01:10:32 +05:30
|
|
|
######## Set compiler flags ########
|
|
|
|
IF(APPLE)
|
|
|
|
# assume clang 4.1.0+, add C++0x/C++11 stuff
|
|
|
|
message(STATUS "Using APPLE CMAKE_CXX_FLAGS")
|
2013-08-26 08:27:09 +05:30
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
2013-02-22 01:10:32 +05:30
|
|
|
ELSEIF(UNIX)
|
|
|
|
# assume GCC, add C++0x/C++11 stuff
|
|
|
|
MESSAGE(STATUS "Using UNIX CMAKE_CXX_FLAGS")
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
|
|
ELSEIF(MINGW)
|
|
|
|
MESSAGE(STATUS "Using MINGW CMAKE_CXX_FLAGS")
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
2013-02-21 06:40:09 +05:30
|
|
|
# Find Qt
|
|
|
|
find_package(Qt5Core REQUIRED)
|
|
|
|
|
|
|
|
# Include Qt headers.
|
|
|
|
include_directories(${Qt5Base_INCLUDE_DIRS})
|
2013-08-07 05:08:18 +05:30
|
|
|
# include_directories(${Qt5Network_INCLUDE_DIRS})
|
2013-02-21 06:40:09 +05:30
|
|
|
|
|
|
|
SET(LIBUTIL_HEADERS
|
|
|
|
include/libutil_config.h
|
|
|
|
|
|
|
|
include/apputils.h
|
|
|
|
|
|
|
|
include/pathutils.h
|
|
|
|
include/osutils.h
|
2013-02-22 01:10:32 +05:30
|
|
|
include/userutils.h
|
|
|
|
include/cmdutils.h
|
2013-02-21 06:40:09 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
SET(LIBUTIL_SOURCES
|
|
|
|
src/pathutils.cpp
|
|
|
|
src/osutils.cpp
|
2013-02-22 01:10:32 +05:30
|
|
|
src/userutils.cpp
|
|
|
|
src/cmdutils.cpp
|
2013-02-21 06:40:09 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
# Set the include dir path.
|
2013-02-27 04:17:39 +05:30
|
|
|
SET(LIBUTIL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
|
2013-02-21 06:40:09 +05:30
|
|
|
|
2013-08-26 06:23:29 +05:30
|
|
|
# Static link!
|
|
|
|
ADD_DEFINITIONS(-DLIBUTIL_STATIC)
|
|
|
|
|
2013-02-27 04:17:39 +05:30
|
|
|
add_definitions(-DLIBUTIL_LIBRARY)
|
2013-02-21 06:40:09 +05:30
|
|
|
|
2013-08-26 06:23:29 +05:30
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2013-08-26 02:18:41 +05:30
|
|
|
add_library(libUtil STATIC ${LIBUTIL_SOURCES} ${LIBUTIL_HEADERS})
|
2013-08-07 05:08:18 +05:30
|
|
|
# qt5_use_modules(libUtil Core Network)
|
|
|
|
qt5_use_modules(libUtil Core)
|
2013-02-27 04:17:39 +05:30
|
|
|
target_link_libraries(libUtil)
|