# HG changeset patch # User koda # Date 1363652905 -3600 # Node ID 53481d65469198fbee6c29d6d33f5cb47d22e315 # Parent 54c770f91714655968c756dc916bc54ec9e39ff7 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS diff -r 54c770f91714 -r 53481d654691 CMakeLists.txt --- a/CMakeLists.txt Tue Mar 19 00:30:48 2013 +0100 +++ b/CMakeLists.txt Tue Mar 19 01:28:25 2013 +0100 @@ -331,7 +331,7 @@ #-XLA is a beta fpc flag that renames libraries before passing them to the linker #we also have to pass PHYSFS_INTERNAL to satisfy windows runtime requirements #(should be harmless on other platforms) - list(APPEND pascal_flags "-XLAphysfs=${physfs_output_name}" "-dPHYSFS_INTERNAL") + set(CMAKE_Pascal_FLAGS "-XLAphysfs=${physfs_output_name} -dPHYSFS_INTERNAL ${CMAKE_Pascal_FLAGS}") endif() find_package_or_disable_msg(FFMPEG NOVIDEOREC "Video recording will not be built") diff -r 54c770f91714 -r 53481d654691 cmake_modules/CMakePascalInformation.cmake --- a/cmake_modules/CMakePascalInformation.cmake Tue Mar 19 00:30:48 2013 +0100 +++ b/cmake_modules/CMakePascalInformation.cmake Tue Mar 19 01:28:25 2013 +0100 @@ -34,16 +34,18 @@ # For 90% of the systems, these are the same flags as the C versions # so if these are not set just copy the flags from the c version #IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS) +#-dynamiclib -Wl,-headerpad_max_install_names for C # SET(CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) #ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS) -#IF(NOT CMAKE_SHARED_LIBRARY_Ada_FLAGS) -# SET(CMAKE_SHARED_LIBRARY_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) -#ENDIF(NOT CMAKE_SHARED_LIBRARY_Ada_FLAGS) +IF(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS) + #another similarity, fpc: -fPIC Same as -Cg + SET(CMAKE_SHARED_LIBRARY_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS) -#IF(NOT CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS) -# SET(CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) -#ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_Ada_FLAGS) +IF(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS) + SET(CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS) #IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG) # SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) @@ -53,6 +55,18 @@ # SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) #ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP) +if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG) + set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) +endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG) + +# for most systems a module is the same as a shared library +# so unless the variable CMAKE_MODULE_EXISTS is set just +# copy the values from the LIBRARY variables +if(NOT CMAKE_MODULE_EXISTS) + set(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_Pascal_FLAGS}) + set(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS}) +endif() + # repeat for modules #IF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS) # SET(CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) @@ -145,43 +159,13 @@ IF(NOT CMAKE_Pascal_COMPILE_OBJECT) SET(CMAKE_Pascal_COMPILE_OBJECT " -Cn -FE${EXECUTABLE_OUTPUT_PATH} -FU${CMAKE_CURRENT_BINARY_DIR}/ -Fi${CMAKE_CURRENT_BINARY_DIR} ") -#" -o -Cn ENDIF(NOT CMAKE_Pascal_COMPILE_OBJECT) -# Constraints: GNAT_EXECUTABLE_BUILDER = gnatmake -# is required to do the compile+bind+link of -# Ada executables, and it requires a source file name which is constructed from -# .adb. The source file arguments of add_executable are -# all compiled by the above rule (which must remain that form since it -# is also used to compile objects for Ada libraries), but the results are -# ignored since they are put in a different directory while gnatmake assumes -# objects are located in the _current_ directory. Thus, put in a minimal -# source file (with correct .adb suffix to identify the Ada language) -# to reduce this useless compilation to a minimum. Usually, the main Ada -# routine qualifies since it is normally small. Thus, the normal usage is -# add_executable(foo foo.adb), but add_executable(foo path/minimal.adb) would -# work as well so long as both path/minimal.adb existed and foo.adb existed. -# Also, note there is no way to specify -# ${CMAKE_CURRENT_SOURCE_DIR}/.adb as the code for gnatmake to compile -# because in this context ${CMAKE_CURRENT_SOURCE_DIR} is set to the top -# of the source tree and not the expected sub-directory of the source tree. -# Thus, LINK_FLAGS -aI${CMAKE_CURRENT_SOURCE_DIR} must be set using -# set_target_properties in order to specify the directory where .adb -# exists. Note, LINK_FLAGS can also be used to set other gnatmake flags -# such as -aL. - -# In sum, you have to be careful of your target name, the nominal source file -# name has to be compilable, but otherwise it is ignored, and you must specify -# the required -aI and other GNAT_EXECUTABLE_BUILDER = gnatmake options -# using LINK_FLAGS specified with set_target_properties. -# However, so long as you pay attention to these -# constraints, add_executable should work for the Ada language. IF(NOT CMAKE_Pascal_LINK_EXECUTABLE) #GET_FILENAME_COMPONENT(COMPILER_LOCATION "${CMAKE_Pascal_COMPILER}" PATH) - message("look here ${CMAKE_CURRENT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH}") set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.sh") -# SET(CMAKE_Pascal_LINK_EXECUTABLE "${CMAKE_Pascal_COMPILER} .adb -cargs -largs ") +# SET(CMAKE_Pascal_LINK_EXECUTABLE "${CMAKE_Pascal_COMPILER} .adb -cargs -largs ") ENDIF(NOT CMAKE_Pascal_LINK_EXECUTABLE) IF(CMAKE_Ada_STANDARD_LIBRARIES_INIT) diff -r 54c770f91714 -r 53481d654691 hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Tue Mar 19 00:30:48 2013 +0100 +++ b/hedgewars/CMakeLists.txt Tue Mar 19 01:28:25 2013 +0100 @@ -168,13 +168,6 @@ list(APPEND pascal_flags "-FD${compiler_dir}") endif(APPLE) -find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP") -if(PNG_FOUND) - list(REMOVE_AT PNG_INCLUDE_DIR 1) #removing the zlib include path - list(APPEND pascal_flags "-dPNG_SCREENSHOTS -Fl${PNG_INCLUDE_DIR}") -endif() - - #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6 if(FREEPASCAL_VERSION VERSION_LESS "2.6") #under some configurations CMAKE_BUILD_TOOL fails to pass on the jobserver, breaking parallel compilation @@ -205,8 +198,14 @@ endif() endif() +find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP") +if(PNG_FOUND) + get_filename_component(PNG_LIB_DIR ${PNG_LIBRARY} PATH) + add_definitions(-dPNG_SCREENSHOTS -Fl${PNG_LIB_DIR}) +endif() -set(CMAKE_Pascal_FLAGS " -vm4079,4080,4081 -Fl${PROJECT_BINARY_DIR}/bin -k-L${PROJECT_BINARY_DIR}/bin -Cs2000000 -vewnq -dDEBUGFILE") + +set(CMAKE_Pascal_FLAGS "-vm4079,4080,4081 -Fl${PROJECT_BINARY_DIR}/bin -Cs2000000 -vewnq -dDEBUGFILE ${CMAKE_Pascal_FLAGS}") add_executable(hwengine ${engine_sources}) if(APPLE)