Skip to content

Commit

Permalink
added CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
setvisible committed Nov 9, 2016
1 parent b2cdc06 commit 9b9f155
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
!/test
!/user-manual
!/.gitignore
!/CMakeLists.txt
!/doxyfile
!/LICENSE
!/BoltGroup.pro
!/FastenerPattern.pro
!/README.md
!/version.pri

Expand Down
108 changes: 108 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
project(FastenerPattern)

message(STATUS "Tips: Building with all the CPU cores: > cmake --build . --target '' -j")

### Versioning
set(APP_VERSION_MAJOR "0")
set(APP_VERSION_MINOR "1")
set(APP_VERSION_PATCH "0")
set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}")

configure_file( ./src/config.h.cmake ./src/config.h )

# -------- Qt5 --------
# RTFM here:
# https://cmake.org/cmake/help/v3.0/manual/cmake-qt.7.html
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)


# -------- Boost --------
find_package(Boost REQUIRED)
configure_file( ./3rd/boost.pri.cmake ./3rd/boost.pri )
include_directories(${Boost_INCLUDE_DIRS})
add_definitions(-DBOOST_MATH_DISABLE_FLOAT128)

### Include
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(./include/)

### CMake Compiler Options
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)

### Sources
include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/core/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/editor/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/CMakeLists.txt)

# Qt -- Run the MOC, resource, etc.
qt5_wrap_cpp( fastenerpattern_HEADERS_MOC ${MY_HEADERS} )
qt5_wrap_ui( fastenerpattern_FORMS_HEADERS ${MY_FORMS} )

add_library(configwin
${fastenerpattern_HEADERS_MOC}
${fastenerpattern_FORMS_HEADERS}
)

qt5_use_modules(configwin Widgets)

# Linking the executable
add_executable(fastenerpattern WIN32 ${MY_SOURCES} ${configwin} ${MY_RESOURCES})
qt5_use_modules(fastenerpattern Core Gui Widgets)


#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------

# # Deploy MinGW *.DLL files for Windows
# # Note: This is a dirty 'hack' for MinGW
# if(WIN32 AND MINGW)
# find_path( LIBGCC_S_DW2_DLL_DIR libgcc_s_dw2-1.dll DOC "Location of libgcc_s_dw2-1.dll")
# find_path( LIBSTDC_6_DLL_DIR libstdc++-6.dll DOC "Location of libstdc++-6.dll")
# find_path( LIBWINPTHREAD_DLL_DIR libwinpthread-1.dll DOC "Location of libwinpthread-1.dll")
# set(MY_MINGW_DEPENDANCIES
# ${LIBGCC_S_DW2_DLL_DIR}/libgcc_s_dw2-1.dll
# ${LIBSTDC_6_DLL_DIR}/libstdc++-6.dll
# ${LIBWINPTHREAD_DLL_DIR}/libwinpthread-1.dll
# )
# install (
# FILES ${MY_MINGW_DEPENDANCIES}
# DESTINATION ${CMAKE_INSTALL_PREFIX}
# COMPONENT mingw_dependancies
# )
# message(STATUS "Found MINGW compiler: ${MINGW}")
# endif(WIN32 AND MINGW)


# Deploy documentation files
set(MY_RELEASE_DOCS
./src/examples/4BoltJoint.splice
./src/examples/PatternJoint.splice
./src/examples/RandomJoint.splice
./user-manual/User_Manual.pdf
./LICENSE
)

install (
FILES ${MY_RELEASE_DOCS}
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT release_docs
)

# Deploy the executable
install(TARGETS fastenerpattern RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})

6 changes: 6 additions & 0 deletions FastenerPattern.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered

SUBDIRS += $$PWD/src/src.pro
SUBDIRS += $$PWD/test/test.pro

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Its core is developed in C++, based on the [Qt framework](https://www.qt.io/ "Qt

## CP solver

Optionaly, FastenerPattern can use a third-party CP solver called CPFP (*Constraint Programming Solver for FastenerPattern*).
Optionally, FastenerPattern can use a third-party CP solver called CPFP (*Constraint Programming Solver for FastenerPattern*).

More info [here](cpsolver/README.md "here").

Expand Down
2 changes: 1 addition & 1 deletion cpsolver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

CPFP can be found [here](https://github.com/setvisible/cpfp "CPFP's git repository").

*Rem: CPFP is stored in a separated repository for maintenance reasons and a better dependancies separation.*
*Rem: CPFP is stored in a separated repository for maintenance reasons and a better dependencies separation.*


0 comments on commit 9b9f155

Please sign in to comment.