|
|
Home » Developing U++ » UppHub » Building TheIDE with using CMake
Re: Building TheIDE with using CMake [message #46557 is a reply to message #46556] |
Thu, 26 May 2016 15:03 |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
Hello Radek.
coolman wrote on Thu, 26 May 2016 06:16
Based on this discussion I created bash script to generate CMakeList.txt from the Ultimate++ project - see https://github.com/CoolmanCZ/upp_cmake
Looks like, you did a lot of work to automate CMakeLists.txt files generation. Very nice.
I managed to build TheIDE on FreeBSD 10.2 with using "Ninja" CMake generator (just for example), with some fixes. I added "link_directories(/usr/local/lib)" (because this is where local libraries reside on FreeBSD by default) and some checks for Clang compiler:
Toggle patch
diff -ruN upp_cmake.orig/GenerateCMakeFiles-lib.sh upp_cmake/GenerateCMakeFiles-lib.sh
--- upp_cmake.orig/GenerateCMakeFiles-lib.sh 2016-05-26 13:09:40
+++ upp_cmake/GenerateCMakeFiles-lib.sh
@@ -983,11 +983,12 @@
echo >> ${OFN}
echo '# Set compiler flags' >> ${OFN}
echo 'if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )' >> ${OFN}
+ echo ' set ( CMAKE_COMPILER_IS_CLANG TRUE )' >> ${OFN}
echo ' set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-logical-op-parentheses" )' >> ${OFN}
echo 'endif()' >> ${OFN}
echo >> ${OFN}
- echo 'if ( CMAKE_COMPILER_IS_GNUCC )' >> ${OFN}
+ echo 'if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)' >> ${OFN}
echo ' set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -O3 -ffunction-sections -fdata-sections" )' >> ${OFN}
echo ' set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -O0" )' >> ${OFN}
echo 'elseif ( MSVC )' >> ${OFN}
@@ -1045,6 +1046,10 @@
echo ' include_directories( ${PNG_INCLUDE_DIR} )' >> ${OFN}
echo " list ( APPEND main_${LINK_LIST} \${PNG_LIBRARIES} )" >> ${OFN}
echo ' endif()' >> ${OFN}
+ echo >> ${OFN}
+ echo ' if ( ${CMAKE_SYSTEM_NAME} MATCHES BSD )' >> ${OFN}
+ echo ' link_directories( /usr/local/lib )' >> ${OFN}
+ echo ' endif()' >> ${OFN}
echo 'endif()' >> ${OFN}
echo >> ${OFN}
Then I configured upp_cmake/GenerateCMakeFiles.sh file for FreeBSD, used it, generated CMake building files and make a build. Just example for current U++ nightly source files:
% cd upp_cmake
% sed -i '.bak' -e '/^UPP_SRC_DIR/s/=/?&/' -e 's/LINUX/BSD -DflagFREEBSD/' GenerateCMakeFiles.sh
% wget http://www.ultimatepp.org/downloads/upp-x11-src-9886.tar.gz
% tar -xf upp-x11-src-9886.tar.gz
% env UPP_SRC_DIR=upp-x11-src-9886/uppsrc bash GenerateCMakeFiles.sh
% mkdir build && cd build && cmake -G Ninja ../
% ninja
Edit:
Submitted pull request with proposed patch in this message. And it was committed later.
[Updated on: Fri, 27 May 2016 14:24] Report message to a moderator
|
|
|
|
|
Re: Building TheIDE with using CMake [message #46858 is a reply to message #32310] |
Mon, 29 August 2016 12:31 |
coolman
Messages: 116 Registered: April 2006 Location: Czech Republic
|
Experienced Member |
|
|
Hi,
The script now supports precompiled headers for GCC and Clang. Here are some measurements when building the ide:
Results using new PCH refactored code are red marked.
Upp source code:
git-svn-id: svn://ultimatepp.org/upp/trunk@10191 f0d560ea-af0d-0410-9eb7-867de7ffcac7 ( last commit: .doc .ctrlib Change several image in GUI tutorial )
Notebook Dell Latitude E5440:
(cat /proc/cpuinfo | grep 'model name' | uniq)
model name : Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
(cat /proc/cpuinfo | grep processor | wc -l)
4
Ubuntu 14.04 LTS Linux:
(uname -a)
Linux ul001172 4.3.0-040300-generic #201511020949 SMP Mon Nov 2 15:04:56 UTC 2015 i686 i686 i686 GNU/Linux
(cmake --version)
cmake version 2.8.12.2
Using original Makefile
linux, gcc version 4.9.3 (Ubuntu 4.9.3-8ubuntu2~14.04)
00:24:24 - orig Makefile - 1 core (size: 11 872 144)
Using generated CMakeLists.txt
linux, gcc version 4.9.3 (Ubuntu 4.9.3-8ubuntu2~14.04)
00:27:12 - pch disable - 1 core (size: 15 339 076)
00:24:36 - pch enable - 1 core (size: 15 334 980)
00:10:39 - pch disable - 4 core (size: 15 339 076)
00:13:40 - pch disable - 4 core (size: 15 339 076)
00:12:40 - pch disable - 4 core (size: 15 339 076) (refactored code)
00:08:07 - pch enable - 4 core (size: 15 334 980)
00:09:28 - pch enable - 4 core (size: 15 334 980)
00:09:43 - pch enable - 4 core (size: 15 334 980)
00:06:14 - pch enable - 4 core (size: 15 334 980) (refactored code)
00:05:57 - pch enable - 4 core (size: 15 334 980) (refactored code)
linux, clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
00:19:30 - pch disable - 1 core (size: 12 939 896)
00:15:48 - pch disable - 1 core (size: 12 939 896)
00:08:08 - pch enable - 1 core (size: 12 939 896)
00:09:06 - pch disable - 4 core (size: 12 939 896)
00:09:20 - pch disable - 4 core (size: 12 939 896) (refactored code)
00:04:36 - pch enable - 4 core (size: 12 939 896)
00:03:56 - pch enable - 4 core (size: 12 939 896)
00:03:54 - pch enable - 4 core (size: 12 939 896)
00:04:10 - pch enable - 4 core (size: 12 939 896) (refactored code)
00:04:40 - pch enable - 4 core (size: 12 939 896) (refactored code)
linux, cross-compilation, mingw32 gcc version 4.9.2 (GCC)
00:20:13 - pch disable - 1 core (size: 12 535 296)
00:13:02 - pch enable - 1 core (size: 12 513 280)
00:10:05 - pch disable - 4 core (size: 12 535 296)
00:10:11 - pch disable - 4 core (size: 12 535 296) (refactored code)
00:08:22 - pch enable - 4 core (size: 12 513 280)
00:08:19 - pch enable - 4 core (size: 12 513 280)
00:08:14 - pch enable - 4 core (size: 12 513 280)
00:04:30 - pch enable - 4 core (size: 12 513 280) (refactored code)
00:05:10 - pch enable - 4 core (size: 12 513 280) (refactored code)
linux, cross-compilation, mingw64 gcc version 4.9.2 (GCC)
00:20:28 - pch disable - 1 core (size: 13 800 448)
00:09:12 - pch enable - 1 core (size: 13 778 672)
00:11:13 - pch disable - 4 core (size: 13 800 448)
00:10:46 - pch disable - 4 core (size: 13 800 448)
00:10:35 - pch disable - 4 core (size: 13 800 448) (refactored code)
00:04:57 - pch enable - 4 core (size: 13 778 672)
00:04:40 - pch enable - 4 core (size: 13 778 672)
00:04:45 - pch enable - 4 core (size: 13 778 672)
00:05:05 - pch enable - 4 core (size: 13 778 672) (refactored code)
00:04:47 - pch enable - 4 core (size: 13 778 672) (refactored code)
Best regards, Radek
[Updated on: Fri, 02 September 2016 10:55] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 09:29:47 CEST 2024
Total time taken to generate the page: 0.03309 seconds
|
|
|