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
|
|
|
|
2013-11-04 07:23:05 +05:30
|
|
|
SET(LIBUTIL_SOURCES
|
2013-02-21 06:40:09 +05:30
|
|
|
include/libutil_config.h
|
|
|
|
|
|
|
|
include/pathutils.h
|
2013-11-04 07:23:05 +05:30
|
|
|
src/pathutils.cpp
|
|
|
|
|
2013-02-21 06:40:09 +05:30
|
|
|
include/osutils.h
|
|
|
|
|
2013-11-04 07:23:05 +05:30
|
|
|
include/userutils.h
|
2013-02-22 01:10:32 +05:30
|
|
|
src/userutils.cpp
|
2013-11-04 07:23:05 +05:30
|
|
|
|
|
|
|
include/cmdutils.h
|
2013-02-22 01:10:32 +05:30
|
|
|
src/cmdutils.cpp
|
2014-02-02 18:35:07 +05:30
|
|
|
|
|
|
|
include/modutils.h
|
|
|
|
src/modutils.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-12-02 15:39:56 +05:30
|
|
|
IF(MultiMC_CODE_COVERAGE)
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage")
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage")
|
|
|
|
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 --coverage")
|
|
|
|
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O0 --coverage")
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O0 --coverage")
|
|
|
|
ENDIF(MultiMC_CODE_COVERAGE)
|
|
|
|
|
2013-11-04 07:23:05 +05:30
|
|
|
add_library(libUtil STATIC ${LIBUTIL_SOURCES})
|
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)
|