|
|
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
|
|
|
|
|
Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Building umk with using CMake
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
By: cyrion on Fri, 13 February 2015 13:16
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
By: cyrion on Fri, 13 February 2015 18:26
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
By: cyrion on Fri, 13 February 2015 18:34
|
|
|
Re: Building TheIDE with using CMake
By: cyrion on Fri, 13 February 2015 18:55
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
By: cyrion on Fri, 13 February 2015 19:30
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
By: cyrion on Sat, 14 February 2015 01:05
|
|
|
Re: Building TheIDE with using CMake
By: coolman on Thu, 26 May 2016 08:16
|
|
|
Re: Building TheIDE with using CMake
|
|
|
Re: Building TheIDE with using CMake
By: coolman on Fri, 15 July 2016 20:55
|
|
|
Re: Building TheIDE with using CMake
By: coolman on Thu, 25 August 2016 12:44
|
|
|
Re: Building TheIDE with using CMake
By: coolman on Mon, 29 August 2016 12:31
|
|
|
Re: Building TheIDE with using CMake
By: Klugier on Thu, 01 February 2018 23:03
|
|
|
Re: Building TheIDE with using CMake
By: coolman on Fri, 02 February 2018 07:09
|
|
|
Re: Building TheIDE with using CMake
By: coolman on Thu, 30 July 2020 12:05
|
Goto Forum:
Current Time: Sat May 11 14:16:51 CEST 2024
Total time taken to generate the page: 0.02885 seconds
|
|
|