2013-02-26 22:47:39 +00:00
|
|
|
project(libUtil)
|
2013-02-21 01:10:09 +00:00
|
|
|
|
2013-02-21 19:40:32 +00:00
|
|
|
######## 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 03:57:09 +01:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
2013-02-21 19:40:32 +00:00
|
|
|
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 01:10:09 +00:00
|
|
|
# Find Qt
|
|
|
|
find_package(Qt5Core REQUIRED)
|
|
|
|
|
|
|
|
# Include Qt headers.
|
|
|
|
include_directories(${Qt5Base_INCLUDE_DIRS})
|
|
|
|
|
2014-04-06 18:43:09 +01:00
|
|
|
set(LIBUTIL_SOURCES
|
|
|
|
include/libutil_config.h
|
2013-02-21 01:10:09 +00:00
|
|
|
|
2014-04-06 18:43:09 +01:00
|
|
|
include/pathutils.h
|
|
|
|
src/pathutils.cpp
|
2013-11-04 01:53:05 +00:00
|
|
|
|
2014-04-06 18:43:09 +01:00
|
|
|
include/osutils.h
|
2013-02-21 01:10:09 +00:00
|
|
|
|
2014-04-06 18:43:09 +01:00
|
|
|
include/userutils.h
|
|
|
|
src/userutils.cpp
|
2013-11-04 01:53:05 +00:00
|
|
|
|
2014-04-06 18:43:09 +01:00
|
|
|
include/cmdutils.h
|
|
|
|
src/cmdutils.cpp
|
2014-02-02 13:05:07 +00:00
|
|
|
|
2014-04-06 18:43:09 +01:00
|
|
|
include/modutils.h
|
|
|
|
src/modutils.cpp
|
2013-02-21 01:10:09 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Set the include dir path.
|
2014-04-06 18:43:09 +01:00
|
|
|
set(LIBUTIL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
|
2013-02-21 01:10:09 +00:00
|
|
|
|
2013-08-26 01:53:29 +01:00
|
|
|
# Static link!
|
2014-04-06 18:43:09 +01:00
|
|
|
add_definitions(-DLIBUTIL_STATIC)
|
2013-08-26 01:53:29 +01:00
|
|
|
|
2013-02-26 22:47:39 +00:00
|
|
|
add_definitions(-DLIBUTIL_LIBRARY)
|
2013-02-21 01:10:09 +00:00
|
|
|
|
2013-08-26 01:53:29 +01:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2013-12-02 10:09:56 +00:00
|
|
|
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 01:53:05 +00:00
|
|
|
add_library(libUtil STATIC ${LIBUTIL_SOURCES})
|
2013-08-07 00:38:18 +01:00
|
|
|
qt5_use_modules(libUtil Core)
|
2013-02-26 22:47:39 +00:00
|
|
|
target_link_libraries(libUtil)
|