|
|
| |
|
![]() |
| project1 /\ / \ / \ main.c simple |
|
project1 / | \ / | \ / | \ / | \ main.c simple CMakeLists.txt |
| $ cd project1 $ cmake . -- The C compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: .../project1 |
| $ make [100%] Building C object CMakeFiles/simple.dir/main.c.o Linking C executable simple [100%] Built target simple |
| $ make clean |
| CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(project1 C) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) ADD_EXECUTABLE(simple main.c) |
| project2 /\ / \ / \ main.c crypto |
|
project2 / | \ / | \ / | \ / | \ main.c crypto CMakeLists.txt |
| $ cd project2 $ cmake . -- The C compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: .../project2 |
| $ make [100%] Building C object CMakeFiles/crypto.dir/main.c.o Linking C executable crypto [100%] Built target crypto |
| $ make clean |
| CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(project2 C) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) ADD_EXECUTABLE(crypto main.c) TARGET_LINK_LIBRARIES(crypto crypt) |
|
roof / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ lib client include bin | | | | | | | | roof.c main.c roof.h main.o roof_p.h roof.o roof libroof.so |
|
roof / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ lib client include bin CMakeLists.txt | | | | | | | | roof.c main.c roof.h main.o roof_p.h CMakeLists.txt roof.o CMakeLists.txt roof libroof.so |
| $ cd roof $ cmake . -- Configuring done -- Generating done -- Build files have been written to: .../roof |
| $ make [ 50%] Building C object bin/CMakeFiles/roof.dir/roof.o Linking C shared library libroof.so [ 50%] Built target roof [100%] Building C object bin/CMakeFiles/main.dir/main.o Linking C executable roof [100%] Built target main |
| $ make clean |
| CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(roof C) INCLUDE_DIRECTORIES(include lib) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) ADD_SUBDIRECTORY(lib bin) ADD_SUBDIRECTORY(client bin) |
| SET(roof_lib_src roof.c) ADD_LIBRARY(roof SHARED ${roof_lib_src}) |
| ADD_EXECUTABLE(roof) TARGET_LINK_LIBRARIES(roof roof) |
| CMake Error: Attempt to add
link target roof of type: EXECUTABLE to target roof. You can only link to STATIC or SHARED libraries. |
| SET(roof_client_src main.c) ADD_EXECUTABLE(main ${roof_client_src}) TARGET_LINK_LIBRARIES(main roof) SET_TARGET_PROPERTIES(main PROPERTIES OUTPUT_NAME roof) |
| project4 | | pdip.c pdip_en.1 pdip_fr.1 |
| project4 | | pdip.c pdip_en.1 pdip_fr.1 FindGZIP.cmake CMakeLists.txt pdip_chown.cmake |
| $ cd project4 -- The C compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: .../project4 |
| $ make [ 33%] Building pdip_fr.1.gz [ 66%] Building pdip_en.1.gz Scanning dependencies of target pdip [100%] Building C object CMakeFiles/pdip.dir/pdip.c.o Linking C executable pdip [100%] Built target pdip |
| $ make install |
| $ make clean |
| FIND_PROGRAM(GZIP_TOOL NAMES gzip PATHS /bin /usr/bin /usr/local/bin) IF(NOT GZIP_TOOL) MESSAGE(FATAL_ERROR "Unable to find 'gzip' program") ENDIF(NOT GZIP_TOOL) |
| CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(project4 C) # Search for gzip program INCLUDE (FindGZIP.cmake) SET(pdip_src pdip.c) SET(pdip_exe pdip) SET(pdip_man_src pdip_en.1 pdip_fr.1) SET(pdip_man_gz pdip_en.1.gz pdip_fr.1.gz) # Compression of the manuals FOREACH(man ${pdip_man_src}) ADD_CUSTOM_COMMAND(OUTPUT ${man}.gz COMMAND ${GZIP_TOOL} -c ${man} > ${man}.gz DEPENDS ${man} COMMENT "Building ${man}.gz") ENDFOREACH(man) # Compilation options passed to the compiler ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) # Build of the program ADD_EXECUTABLE(${pdip_exe} ${pdip_src} ${pdip_man_gz}) # Installation of the program INSTALL(TARGETS pdip DESTINATION "bin" PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # Installation of the manuals INSTALL(FILES pdip_fr.1.gz DESTINATION "share/man/fr/man1" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ RENAME pdip.1.gz) INSTALL(FILES pdip_en.1.gz DESTINATION "share/man/man1" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ RENAME pdip.1.gz) # Script to be executed at installation time (kind of post-intallation script) to # change the right accesses on the installed files INSTALL(SCRIPT pdip_chown.cmake) |
| # Copy the files to the
destination directory EXECUTE_PROCESS(COMMAND chown root ${CMAKE_INSTALL_PREFIX}/bin/pdip COMMAND chgrp root ${CMAKE_INSTALL_PREFIX}/bin/pdip COMMAND chown root ${CMAKE_INSTALL_PREFIX}/share/man/fr/man1/pdip.1.gz COMMAND chgrp root ${CMAKE_INSTALL_PREFIX}/share/man/fr/man1/pdip.1.gz COMMAND chown root ${CMAKE_INSTALL_PREFIX}/share/man/man1/pdip.1.gz COMMAND chgrp root ${CMAKE_INSTALL_PREFIX}/share/man/man1/pdip.1.gz) |
|
roof / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ lib client include man | | | | | | | | roof.c main.c roof.h roof.1 roof_p.h roof.3 ... roof.7 |
|
roof / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ / | \ \ \ lib client include man CMakeLists.txt | | | | | | | | roof.c main.c roof.h roof.1 roof_p.h CMakeLists.txt CMakeLists.txt roof.3 CMakeLists.txt ... roof.7 CMakeLists.txt FindGZIP.cmake |
| $ cd roof $ cmake . -DCMAKE_INSTALL_PREFIX=/tmp -- Configuring done -- Generating done -- Build files have been written to: .../roof |
| $ make [ 50%] Building C object bin/CMakeFiles/roof.dir/roof.o Linking C shared library libroof.so [ 50%] Built target roof [100%] Building C object bin/CMakeFiles/main.dir/main.o Linking C executable roof [100%] Built target main |
| $ make install [ 3%] Built target roof [ 7%] Built target main [100%] Built target man Install the project... -- Install configuration: "" -- Install configuration: "" -- Installing /tmp/lib/libroof.so.1.0.0 -- Install configuration: "" -- Installing /tmp/bin/roof -- Install configuration: "" -- Installing /tmp/share/man/man1/roof.1.gz -- Installing /tmp/share/man/man3/roof_cwd.3.gz -- Installing /tmp/share/man/man3/roof_login.3.gz ... |
| $ make clean |
| CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(roof C) INCLUDE_DIRECTORIES(include lib) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) ADD_SUBDIRECTORY(lib) ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(man) ADD_SUBDIRECTORY(include) |
| # Make shared library
libroof.so from 'roof.c' ADD_LIBRARY(roof SHARED roof.c) # Set the build version (VERSION) and the API version (SOVERSION) SET_TARGET_PROPERTIES(roof PROPERTIES VERSION 1.0.0 SOVERSION 1) # Installation of the library INSTALL(TARGETS roof DESTINATION lib PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) |
| ADD_EXECUTABLE(roof) TARGET_LINK_LIBRARIES(roof roof) |
| CMake Error: Attempt to add
link target roof of type: EXECUTABLE to target roof. You can only link to STATIC or SHARED libraries. |
| # 'main' depends on some C
source files ADD_EXECUTABLE(main main.c) # 'main' depends on libroof.so TARGET_LINK_LIBRARIES(main roof) # In the preceding rules, we can't use 'roof' as target name otherwise # cmake will return in error with TARGET_LINK_LIBRARIES(roof roof): # # CMake Error: Attempt to add link target roof of type: EXECUTABLE # to target roof. You can only link to STATIC or SHARED libraries. # # Hence the SET_TARGET_PROPERTIES to rename main to roof # SET_TARGET_PROPERTIES(main PROPERTIES OUTPUT_NAME roof) # Installation of the program INSTALL(TARGETS main RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
| INSTALL(FILES roof.h DESTINATION include PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) |
| FIND_PROGRAM(GZIP_TOOL NAMES gzip PATHS /bin /usr/bin /usr/local/bin) IF(NOT GZIP_TOOL) MESSAGE(FATAL_ERROR "Unable to find 'gzip' program") ENDIF(NOT GZIP_TOOL) |
| # Search for gzip program INCLUDE (FindGZIP.cmake) # Lists of source manuals SET(roof_man_src_1 roof.1) SET(roof_man_src_3 roof_cwd.3 roof_login.3 roof_pwd.3 roof_syst.3 roof_delete.3 roof_mkdir.3 roof_retr.3 roof_type.3 roof.3 roof_get_debug_level.3 roof_mv.3 roof_rm.3 roof_get_reply.3 roof_new.3 roof_rmdir.3 roof_cdup.3 roof_initialize.3 roof_nlst.3 roof_set_debug_level.3 roof_close_ctrl.3 roof_list.3 roof_open_ctrl.3 roof_stor.3) SET(roof_man_src_7 roof.7) # Lists of compressed manuals STRING(REGEX REPLACE ".1" ".1.gz" roof_man_gz_1 "${roof_man_src_1}") STRING(REGEX REPLACE ".3" ".3.gz" roof_man_gz_3 "${roof_man_src_3}") STRING(REGEX REPLACE ".7" ".7.gz" roof_man_gz_7 "${roof_man_src_7}") # Compression of the manuals FOREACH(man ${roof_man_src_1} ${roof_man_src_3} ${roof_man_src_7}) ADD_CUSTOM_COMMAND(OUTPUT ${man}.gz COMMAND ${GZIP_TOOL} -c ${man} > ${man}.gz DEPENDS ${man} COMMENT "Building ${man}.gz") ENDFOREACH(man) # Add the manual generation in the global rules ADD_CUSTOM_TARGET(man ALL DEPENDS ${roof_man_gz_1} ${roof_man_gz_3} ${roof_man_gz_7}) # Installation of the manuals INSTALL(FILES ${roof_man_gz_1} DESTINATION "share/man/man1" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) INSTALL(FILES ${roof_man_gz_3} DESTINATION "share/man/man3" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) INSTALL(FILES ${roof_man_gz_7} DESTINATION "share/man/man7" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) |
| CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(roof C) INCLUDE_DIRECTORIES(include lib) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) ADD_SUBDIRECTORY(lib) ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(man) ADD_SUBDIRECTORY(include) SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Remote Operations On Files") SET(CPACK_PACKAGE_VENDOR "Rachid Koucha") #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") SET(CPACK_PACKAGE_VERSION_MAJOR "1") SET(CPACK_PACKAGE_VERSION_MINOR "0") SET(CPACK_PACKAGE_VERSION_PATCH "0") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") #SET(CPACK_STRIP_FILES "bin/MyExecutable") #SET(CPACK_SOURCE_STRIP_FILES "") SET(CPACK_PACKAGE_EXECUTABLES "roof" "FTP client") INCLUDE(CPack) |
| $ make package [ 3%] Built target roof [ 7%] Built target main [100%] Built target man Linking C executable CMakeFiles/CMakeRelink.dir/roof Run CPack packaging tool... CPack: Create package using STGZ CPack: Install projects CPack: - Run preinstall target for: roof CPack: - Install project: roof CPack: Compress package CPack: Finalize package CPack: Package .../roof/roof-1.0.0-Linux.sh generated. CPack: Create package using TGZ CPack: Install projects CPack: - Run preinstall target for: roof CPack: - Install project: roof CPack: Compress package CPack: Finalize package CPack: Package .../roof/roof-1.0.0-Linux.tar.gz generated. CPack: Create package using TZ CPack: Install projects CPack: - Run preinstall target for: roof CPack: - Install project: roof CPack: Compress package CPack: Finalize package CPack: Package .../roof/roof-1.0.0-Linux.tar.Z generated. |
| $ ./roof-1.0.0-Linux.sh
--help Usage: ./roof-1.0.0-Linux.sh [options] Options: [defaults in brackets after descriptions] --help print this message --prefix=dir directory in which to install --include-subdir include the roof-1.0.0-Linux subdirectory --exclude-subdir exclude the roof-1.0.0-Linux subdirectory $ ./roof-1.0.0-Linux.sh --prefix=/tmp --exclude-subdir roof Installer Version: 1.0.0, Copyright (c) Rachid Koucha This is a self-extracting archive. The archive will be extracted to: /tmp Using target directory: /tmp Extracting, please wait... Unpacking finished successfully $ |
| project7 /\ / \ / \ main.c simple |
|
project7 / / | \ / / | \ / / | \ / / | \ main.c config.h.cmake simple CMakeLists.txt |
| $ cd project7 $ cmake . -- The C compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: .../project7 |
| $ make Scanning dependencies of target simple [100%] Building C object CMakeFiles/simple.dir/main.c.o Linking C executable simple [100%] Built target simple |
| $ make clean |
| CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(project7 C) SET(PROJECT_NAME SIMPLE) SET(SIMPLE_MAJOR 1) SET(SIMPLE_MINOR 8) SET(SIMPLE_PATCH 6) SET(SIMPLE_VERSION ${SIMPLE_MAJOR}.${SIMPLE_MINOR}.${SIMPLE_PATCH}) CONFIGURE_FILE(config.h.cmake config.h) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) ADD_EXECUTABLE(simple main.c) |
| //
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // File : config.h // Description : Configuration of @PROJECT_NAME@ // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #ifndef CONFIG_H #define CONFIG_H //--------------------------------------------------------------------------- // Name : SIMPLE_VERSION // Usage: Version of @PROJECT_NAME@ //---------------------------------------------------------------------------- #define SIMPLE_VERSION "@SIMPLE_VERSION@" #endif // CONFIG_H |
| //
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // File : config.h // Description : Configuration of SIMPLE // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #ifndef CONFIG_H #define CONFIG_H //--------------------------------------------------------------------------- // Name : SIMPLE_VERSION // Usage: Version of SIMPLE //---------------------------------------------------------------------------- #define SIMPLE_VERSION "1.8.6" #endif // CONFIG_H |
|
project8 / / \ \ \ / / \ \ \ / / \ \ \ / / \ \ \ udp_console_u.c udpc_console_k.c udpc Kbuild udpc.ko |
|
project8 / / | \ \ \ \ / / | \ \ \ \ / / | \ \ \ \ / / | \ \ \ \ udpc_console_u.c udpc_console_k.c config.h.cmake udpc Kbuild udpc.ko CMakeLists.txt |
| $ cd project8 $ cmake . -- Building UDPC version 1.0.0 -- Configuring done -- Generating done -- Build files have been written to: .../project8 |
| $ make Scanning dependencies of target kudpc [ 0%] Building udpc.ko [ 50%] Built target kudpc Scanning dependencies of target udpc [100%] Building C object CMakeFiles/udpc.dir/udp_console_u.o Linking C executable udpc [100%] Built target udpc |
| $ make clean |
| cmake_minimum_required(VERSION 2.4) PROJECT(udpc C) SET(PROJECT_NAME UDPC) # Version number SET(UDPC_MAJOR 1) SET(UDPC_MINOR 0) SET(UDPC_PATCH 0) SET(UDPC_VERSION ${UDPC_MAJOR}.${UDPC_MINOR}.${UDPC_PATCH}) MESSAGE(STATUS "Building UDPC version ${UDPC_VERSION}") CONFIGURE_FILE(config.h.cmake config.h) SET(udpc_src udp_console_u.c) SET(udpc_exe udpc) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Winline -Werror) # Build of the program ADD_EXECUTABLE(${udpc_exe} ${udpc_src}) # Build the module EXECUTE_PROCESS(COMMAND uname -r OUTPUT_VARIABLE os_release OUTPUT_STRIP_TRAILING_WHITESPACE) SET(module_path /lib/modules/${os_release}) SET(module_build_path ${module_path}/build) ADD_CUSTOM_COMMAND(OUTPUT udpc.ko COMMAND make -C ${module_build_path} M=`pwd` DEPENDS udp_console_k.c Kbuild COMMENT "Building udpc.ko" ) ADD_CUSTOM_TARGET(kudpc ALL DEPENDS udpc.ko) # Installation of the module SET(module_install_path ${module_path}/kernel) INSTALL(FILES udpc.ko DESTINATION ${module_install_path} PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # Installation of the program INSTALL(TARGETS udpc DESTINATION "bin" PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
| //
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // File : config.h // Description : Configuration of @PROJECT_NAME@ // License : // // Copyright (C) 2011 Rachid Koucha <rachid dot koucha at free dot fr> // // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // // Evolutions : // // 25-Jan-2011 R. Koucha - Creation // // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #ifndef CONFIG_H #define CONFIG_H //--------------------------------------------------------------------------- // Name : @PROJECT_NAME@_VERSION // Usage: Version of @PROJECT_NAME@ //---------------------------------------------------------------------------- #define @PROJECT_NAME@_VERSION "@UDPC_VERSION@" #endif // CONFIG_H |
| //
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // File : config.h // Description : Configuration of UDPC // License : // // Copyright (C) 2011 Rachid Koucha <rachid dot koucha at free dot fr> // // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // // Evolutions : // // 25-Jan-2011 R. Koucha - Creation // // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #ifndef CONFIG_H #define CONFIG_H //--------------------------------------------------------------------------- // Name : UDPC_VERSION // Usage: Version of UDPC //---------------------------------------------------------------------------- #define UDPC_VERSION "1.0.0" #endif // CONFIG_H |
| # Driver for the UDP based Linux
console obj-m += udpc.o udpc-objs := udp_console_k.o |
|
project9
/ | \ / | \ / | \ hello.cc CMakeLists.txt hello |
| $ cd project9 $ cmake . -- The CXX compiler identification is GNU -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done Found Qt include files in /usr/include/qt4 Found Qt libraries in /usr/lib -- Configuring done -- Generating done -- Build files have been written to: .../project9 |
| $ make Scanning dependencies of target hello [100%] Building CXX object CMakeFiles/hello.dir/hello.o Linking CXX executable hello [100%] Built target hello |
$ ./hello &![]() |
| $ make clean |
| CMAKE_MINIMUM_REQUIRED(VERSION
2.8) PROJECT(hello CXX) FIND_PATH(QT_INC_DIR NAMES QtGui PATHS /usr/include /usr/include/qt4) IF(NOT QT_INC_DIR) MESSAGE(FATAL_ERROR "Unable to find Qt include files") ELSE(NOT QT_INC_DIR) STRING(REGEX REPLACE "/QtGui" "" QT_INC_DIR "${QT_INC_DIR}") MESSAGE("Found Qt include files in " ${QT_INC_DIR}) ENDIF(NOT QT_INC_DIR) ADD_DEFINITIONS(-g -O2 -fsigned-char -freg-struct-return -Wall -W -Wshadow -Wpointer-arith -Wcast-qual -Winline -Werror) INCLUDE_DIRECTORIES(${QT_INC_DIR}) ADD_EXECUTABLE(hello hello.cc) TARGET_LINK_LIBRARIES(hello QtCore QtGui) |



|
|